π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import os, sys | |
| import subprocess | |
| procs = [] | |
| with open(sys.argv[1], 'r') as f: | |
| for line in f.readlines(): | |
| if line.find("host1") > -1: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| with open("stdout.txt","wb") as out, open("stderr.txt","wb") as err: | |
| subprocess.Popen("ls",stdout=out,stderr=err) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os, sys | |
| import re | |
| in_fd = open('reference.bib', 'r') | |
| out_fd = open('test.bib', 'a') | |
| p = '\{(.*)\}' | |
| for line in in_fd.readlines(): | |
| if line.find('author') > -1 or line.find('AUTHOR') > -1: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| XTickLabel = get(gca,'XTickLabel'); | |
| set(gca,'XTickLabel',' '); | |
| hxLabel = get(gca,'XLabel'); | |
| set(hxLabel,'Units','data'); | |
| xLabelPosition = get(hxLabel,'Position'); | |
| y = xLabelPosition(2); | |
| XTick = get(gca,'XTick'); | |
| y=repmat(y,length(XTick),1); | |
| fs = get(gca,'fontsize'); | |
| hText = text(XTick, y, ... XTickLabel,'fontsize',fs); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function s=TimeStamp | |
| strcat(datestr(clock,'yyyy-mm-dd-HHhMM'),'m',datestr(clock,'ss'),'s') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding=utf-8 | |
| import httplib, urllib, json | |
| import locale, datetime | |
| import base64, hmac | |
| from hashlib import sha1 | |
| gid = 'sh600580' | |
| apihub_key = 'YSBYsT2nNVBNykK1' |
NewerOlder