python第二次运行会出错_pythonttkinter在第二次运行时崩溃了自动化桌面

代码在第一次运行时按预期运行,但如果我再次运行它,它会使自动化服务台崩溃。如果我在Python中运行它,就没有错误,我可以重复运行它。在

“AD”是AutomationDesk变量,在AutomationDesk之外不工作。对于测试,我将该部分注释掉,只使用DEBUG而不是AD.DEBUG。在

Automation desk是dSpace的一个软件。在from Tkinter import *

import Tkinter,tkFileDialog,tkMessageBox

from datetime import datetime

#print time

now = datetime.now()

print "Test Start time is: "+'%s:%s:%s' % (now.hour, now.minute,now.second)

#hide the main window

root = Tk()

root.withdraw()

#Debugger option

debugYN = tkMessageBox.askyesno("Debug", "Would you like to debug?")

if debugYN == True:

_AD_.DEBUG = 1

print "Debugging enabled"

else:

_AD_.DEBUG = 0

#File name selection

file = tkFileDialog.askopenfilename()

if file != None and debugYN == True:

print file

_AD_.DFCxlsPath = file

if _AD_.DEBUG == 1:

now = datetime.now()

print "Select XLS & Debug Completed at "+'%s:%s:%s' % (now.hour, now.minute,now.second)

root = None

#root.destroy()

del file

del debugYN

#remove now here because no matter what we print the start time

del now

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值