摘要:
# this one is like your scripts with argvdef print_two(*args):arg1, arg2 = args print "arg1: %r, arg2: %r" % (arg1, arg2)# ok, that *args is actually ... 阅读全文
摘要:
from sys import argv from os.path import existsscript, from_file, to_file = argvprint "Copying from %s to %s" % (from_file, to_file)# we could do thes... 阅读全文
摘要:
from sys import argvscript, filename = argvprint "We're going to erase %r." % filename print "If you don't want that, hit CTRL-C (^C)." print "If you ... 阅读全文
摘要:
Defination:累积分布函数:The cumulative distribution function (CDF) does just that. The CDF at point x tells us whatfraction of events has occurred “to the l... 阅读全文
摘要:
from sys import argvscript, filename = argvtxt = open(filename)print "Here's your file %r:" % filename print txt.read()print "Type the filename again:... 阅读全文
摘要:
from sys import argvscript, user_name = argvprompt = '> 'print "Hi %s, I'm the %s script." % (user_name, script)print "I'd like to ask you a few quest... 阅读全文
摘要:
from sys import argvscript, first, second, third = argvprint "The script is called:", scriptprint "Your first variable is:", firstprint "Your second v... 阅读全文
摘要:
age = raw_input("How old are you? ")height = raw_input("How tall are you? ")weight = raw_input("How much do you weigh? ")print "So, you're %r old, %r ... 阅读全文
摘要:
print "How old are you?",age = raw_input()print "How tall are you?",height = raw_input()print "How much do you weigh?",weight = raw_input()print "So, ... 阅读全文