我写了这个代码我想进入到文本框中的值传递给一个Python程序
app = Tk()
app.title('Myapp')
app.geometry('260x100+50+50')
labelText =StringVar()
labelText.set('Insert the version you want to check')
label1 = Label(app, textvar=labelText, height=4)
label1.pack()
stringadacercare = StringVar(None)
lastringa = Entry(app, textvar=stringadacercare)
lastringa.place(x=30, y=40, width=200)
progressbar = ttk.Progressbar(orient=HORIZONTAL, length=260, mode='determinate')
progressbar.pack(side='bottom')
progressbar.start()
app.mainloop()
我想通过文本框采取的输入进入这个程序,而不是的raw_input所以结合这进行测试V
import csv
import re
import os
testV = raw_input('Insert the version you want to find: ')
fileobj = csv.reader(open('c:\\paths1.csv', 'rb'), delimiter=' ', quotechar='|')
for row in fileobj:
for x in row:
with open(x) as f:
for line in f:
if re.match(testV, line):
print 'The version match: '+ line
else:
print 'wrong version'
filesize= os.path.getsize(x)
print 'The file size is :'+ str(filesize) +' bytes';
有人能帮我吗? 提前谢谢!!!!!
对不起nassio,看着你的gui后,我意识到我的代码不是一个好主意。我删了它。 – joaquin 2012-02-07 17:38:23
@Niall你可以更具体一些吗?没有复选标记.... – nassio 2012-02-07 20:58:41
快速浏览http://stackoverflow.com/faq#howtoask。如果你接受答案,如果给别人更多的动力来帮助你:) – 2012-02-07 21:10:01