这是我的。我想写一个程序到一个文件
"""
Author: Michael Wellman (wellmanm)
Title: pa10.py
Description: Deciphering a document using pennymath.
"""
def decode(inputfile,outputfile):
**inputfile = open("superDuperTopSecretStudyGuide.txt","rU").read()
outputfile = open("translatedguide.txt","w")**
count = 0
aList = []
for words in inputfile:
aList.append(words)
charCount = len(aList)
**outpufile.write(aList)**
while count<charCount:
print aList[count],
if (aList[count].isalpha()):
if (ord(aList[count])>90):
count = count + ord(aList[count])-95
else:
count = count + ord(aList[count])-63
else:
if (aList[count].isdigit()):
count = count + ord(aList[count])-46
else:
count = count + 6
**inputfile.close()
outputfile.close()**
的txt文件是从我的教授:P
加粗的部分是最重要的,我相信。
有什么想法?
您是要求一般反馈还是您有一个问题要解决?如果您需要一般反馈,[代码评论](http://codereview.stackexchange.com/)网站将更适合这类问题。 – Darthfett 2012-04-25 21:21:38
您问的唯一问题是“有什么想法?”,我相信大部分受访者会回答“是”。但是,如果您对该计划的某个方面有实际的疑问,请提出。 – 2012-04-25 21:23:00