-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathhello-world.py
executable file
·73 lines (58 loc) · 1.52 KB
/
hello-world.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python
from __future__ import (absolute_import, division, print_function,
unicode_literals, generators, nested_scopes, with_statement)
from builtins import (bytes, dict, int, list, object, range, str, ascii, chr,
hex, input, next, oct, open, pow, round, super, filter, map, zip)
import ProgramName
import sys
import os
from Interval import Interval
from ConfigFile import ConfigFile
from SummaryStats import SummaryStats
import random
# Process command line
name=ProgramName.get();
if(len(sys.argv)!=3):
print(name," <parm1> <parm2>")
exit()
parm1=sys.argv[1]
parm2=sys.argv[2]
print(parm1, parm2)
print ("Hello, world\n")
for i in range(1,10):
print (i,end="")
print("\n")
i1=Interval(1,10)
i2=Interval(1.5,7.3)
sub=i1.minus(i2)
print(sub)
a=["a","b","c"]
for x in a:
print(x)
def main():
try:
raise Exception("cookie")
except Exception as e:
print(e)
main()
my_generator = (letter for letter in 'abcdefg')
#import tempfile
#[fh,filename]=tempfile.mkstemp(prefix="tmp.");
#print(filename,fh)
#os.close(fh)
import TempFilename
filename=TempFilename.generate()
fh=open(filename,'w')
print(fh)
x=0
while(x<10): fh.write(str(x)); x+=3
fh.close()
os.remove(filename)
config=ConfigFile("test/data/ice.0-43.config")
print(config.lookup("donor-consensus"))
a=[1.1, 6.4, 9.3, 3.4, 9.2, 4.6, 1.6, 0.3]
b=list(map(lambda x:x+random.uniform(-10,10),a))
[mean,SD,min,max]=SummaryStats.summaryStats(a)
print(mean,"+/-",SD)
print("sum=",SummaryStats.sum(a))
print("r=",SummaryStats.correlation(a,b))