Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

tkinter - Python Notebooks and using import vs exec

I'm working on a GUI (Tkinter, Python 2.7) to control test instruments. Trying to load/run Python (Tkinter) code on the fly, depending on the device. (Obviously, the widgets for a signal generator would be different from a power supply)

import does not work. should I use execfile instead?

I am creating tabs (notebooks) for each instrument and want to run code from a 'template' file with text, entry (etc) widgets. That way I can create these 'templates' (Tkinter code for all the widgets) and use that code as if it was actually there.

How do I do that?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...