How to use the exec statement
JB
jb at yahoo.de
Sun Oct 6 07:46:22 EDT 2002
Alex Martelli wrote:
> If you explain what
> you're trying to do with exec, it's possible that better
> suggestions can be advanced regarding how to perform that.
Thx. I am playing with a very simple application using PyQt.
The main window has a single central widget which is a
QSplitter. The QSplitter consists of two parts. One is a
QTextEdit and the other is simply a QWidget. The user can
enter text in (or into?) the QTextEdit. At the moment the
text consists of Python statements, like a = ... or
dosomething(x,y,z,...). Then, when a toolbar button is
pressed, the statements should be executed by exec and then
something is done in the other window.
I thought that the definition of the QMainWindow and the
QSplitter widget (that is the definition of my derived
classes) should be in the main module and the definition of
the other classes in one or several other windows.
Probably, I shall have to call a function in the main
module, when the execution has to start and this function
will then call another function in the second module. This
second function will call exec.
Is this sensible?
(off topic remark: I was stunned when I found out that in Qt
setting the world matrix of a painter will not influece the
way straight lines are drawn via drawLine (the arguments of
drawLine are always integers). This is not very nice and I
consider it a shortcoming of a brillant tool kit.)
--
Janos Blazi
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
More information about the Python-list
mailing list