Re: [Tutor] Opening a Qt .py file from within another python app

2012-03-22 Thread Alan Gauld
On 22/03/12 19:59, ken brockman wrote: PS maybe time to find a new hobby. I hear that knitting is very relaxing and no heavy mental lifting. Nah, I tried that once. programming is much easier! :-) -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/

Re: [Tutor] Opening a Qt .py file from within another python app

2012-03-22 Thread Prasad, Ramit
> python fibo.py > the code in the module will be executed, just as if you imported it, but > with the __name__ set to "__main__". That means that by adding this code at > the end of your module: > > if __name__ == "__main__": > import sys > fib(int(sys.argv[1])) > you can make the file u

Re: [Tutor] Opening a Qt .py file from within another python app

2012-03-22 Thread ken brockman
Alan, no need to respond to that last missive of mine. I no sooner had hit the send key and reopened the apps in question then the answer hit me like a small mallet in the back of my head.  Obviously, what makes the additional code at the bottom of the secon

Re: [Tutor] Opening a Qt .py file from within another python app

2012-03-22 Thread ken brockman
On 22/03/12 09:57, ken brockman wrote: >> PS Another odd bit, was on the python docs page. It had said that using >> import File_name, without the .py would import it, but not run it. Seems >> a glaring oversight not to have mentioned, what would have made it

Re: [Tutor] Opening a Qt .py file from within another python app

2012-03-22 Thread Alan Gauld
On 22/03/12 09:57, ken brockman wrote: PS Another odd bit, was on the python docs page. It had said that using import File_name, without the .py would import it, but not run it. Seems a glaring oversight not to have mentioned, what would have made it run. Actually it does run it when you impor

[Tutor] Opening a Qt .py file from within another python app

2012-03-22 Thread ken brockman
M On 22/03/12 03:47, ken brockman wrote: >> None of which had gotten the Qt window to open. >> Yet when I run it directly, on it's own, it open's >> and the Qt window is displayed. >My guess is that there is an if __name__... clause >at the bottom with some code that doesn't get >executed when yo

Re: [Tutor] opening a Qt .py file from within another python app.

2012-03-22 Thread Alan Gauld
On 22/03/12 03:47, ken brockman wrote: None of which had gotten the Qt window to open. > Yet when I run it directly, on it's own, it open's > and the Qt window is displayed. My guess is that there is an if __name__... clause at the bottom with some code that doesn't get executed when you impor

[Tutor] opening a Qt .py file from within another python app.

2012-03-21 Thread ken brockman
Evening all; I am trying to import a Python QT file, that had been generated from a ui file into another python app. I have imported it, without generating an error, but the Qt window isn't opening. I have spent the afternoon googling the issue, have found numerous articles, but none that have