/ Published in: Python
URL: http://www.wellho.net/resources/ex.php4?item=y110/tablog.py
Expand |
Embed | Plain Text
#!/usr/local/bin/python import sys import time havevalue = 0 while havevalue < 1: try: table = input("What table to you want? ") havevalue=1 except: print "Looking for a number" counter = 1 save = open("tabout.txt","w") while counter <= 12: result = table * counter print counter,"time",table, "is",result save.write (str(counter) " times " \ str(table) " is " \ str(result) "\n") counter = counter 1 print "Counter ends at",counter save.close(); handle = open("logfile.txt","a") logline = [] logline.append(sys.argv[0]) logline.append(str(time.time())) logline.append(str(table)) handle.write((" ".join(logline)) "\n") handle.close()
You need to login to post a comment.
