示例#1
0
#!/usr/bin/env python
"""Scientific Hello World script using a module hw."""
import sys
from hw import hw1, hw2

try:
    r1 = float(sys.argv[1])
    r2 = float(sys.argv[2])
except:
    print 'Usage:', sys.argv[0], 'r1 r2'
    sys.exit(1)
print 'hw1, result:', hw1(r1, r2)
print 'hw2, result: ',
hw2(r1, r2)

# test hw3:
from hw import hw3
s = hw3(r1, r2)
print 'hw3, result:', s
示例#2
0
文件: hwa.py 项目: HunterAllman/kod
#!/usr/bin/env python
"""Scientific Hello World script using a module hw."""
import sys
from hw import hw1, hw2

try:
    r1 = float(sys.argv[1]);  r2 = float(sys.argv[2])
except:
    print 'Usage:', sys.argv[0], 'r1 r2'; sys.exit(1)
print 'hw1, result:', hw1(r1, r2)
print 'hw2, result: ',
hw2(r1, r2)

# test hw3 (s as pointer):
from hw import hw3
s = hw3(r1, r2)
print 'hw3, result:', s

# test hw4 (s as reference):
from hw import hw4
s = hw4(r1, r2)
print 'hw4, result:', s

示例#3
0
#!/usr/bin/env python
"""Scientific Hello World script using a module hw."""
import sys
from hw import hw1, hw2, hw3

try:
    r1 = float(sys.argv[1])
    r2 = float(sys.argv[2])
except:
    print 'Usage:', sys.argv[0], 'r1 r2'
    sys.exit(1)
print 'hw1, result:', hw1(r1, r2)
print 'hw2, result: ',
hw2(r1, r2)
s = 10
hw3(r1, r2, s)
print 'hw3, result:', s
示例#4
0
#!/usr/bin/env python
"""Scientific Hello World script using a module hw."""
import sys
from hw import hw1, hw2, hw3

try:
    r1 = float(sys.argv[1]);  r2 = float(sys.argv[2])
except:
    print 'Usage:', sys.argv[0], 'r1 r2'; sys.exit(1)
print 'hw1, result:', hw1(r1, r2)
print 'hw2, result: ',
hw2(r1, r2)
s = 10
hw3(r1, r2, s)
print 'hw3, result:', s