From: Gerrat R. <gri...@co...> - 2012-07-17 18:30:31
|
Got it! I haven't completely read the docs - I've just started using VPython. I ran the first example in the tutorial ( http://www.vpython.org/contents/docs/visual/VPython_Intro.pdf), and was curious why the interpreter exited. A slight tweak to the example now: >>>from visual import * >>>scene.exit = False >>>sphere() Now, when I close the display window, the python interpreter stays active. This is all I wanted! Solved. Thanks! Without the "scene.exit", the regular python command prompt exits, whereas VIDLE doesn't (well, it prints a message saying it has restarted, but ends up leaving you in the interpreter). On a related note (sort of), Christoph Gohlke emailed me back about the 64bit binary builds to say that he was aware they were missing some of the modules like Polygon, Fonttools, and ttyfquery, and adding them is on his todo list. He said that VIDLE is already included. There is a vidle directory in my installation - I just can't figure out how to invoke it correctly (There is no shortcut VIdle icon installed when I installed the 64bit python2.7 VPython binary). I've tried: "python run.py" (seems to do nothing) and each of: "python PYShell.py" "python EditorWindow.py" "python idle.py" from the vidle directory all give me a similar traceback: C:\Python27\Lib\site-packages\vidle>python idle.py Traceback (most recent call last): File "idle.py", line 11, in <module> vidle.PyShell.main() File "C:\Python27\Lib\site-packages\vidle\PyShell.py", line 1463, in main flist.new() File "C:\Python27\Lib\site-packages\vidle\FileList.py", line 44, in new return self.EditorWindow(self, filename) File "C:\Python27\Lib\site-packages\vidle\PyShell.py", line 107, in __init__ EditorWindow.__init__(self, *args) File "C:\Python27\Lib\site-packages\vidle\EditorWindow.py", line 306, in __init__ self.askinteger = tkSimpleDialog.askinteger AttributeError: 'module' object has no attribute 'askinteger' Is there a way to invoke VIdle from the command prompt? > -----Original Message----- > From: Bruce Sherwood [mailto:Bru...@nc...] > Sent: July 17, 2012 12:34 PM > To: vis...@li... > Subject: Re: [Visualpython-users] Python Interpreter exits when Display > window is closed > > Sorry, but I don't fully understand the situation. It is standard > procedure for your program to quit if you close a VPython window. From > the help: > > exit If sceneb.exit is False, the program does not quit when the close > box of the sceneb display is clicked. The default is sceneb.exit = > True, in which case clicking the close box does make the program quit. > > Can you give a bit more detail about what is different between IDLE and > VIDLE? I wouldn't expect there to be any difference in this respect. > > I will however mention the following: I very rarely run from the > command prompt on Windows, but in recent days I have been doing so for > testing purposes and I was surprised by the behavior of this simple > program: > > from vis import box > box() > > This program flashes a box and exits. If instead I say "from visual > import *" the program behaves normally. That is, the window stays open > and I can rotate and zoom. I don't know whether this unexpected > behavior is related to the problem you see. > > Bruce Sherwood > > On Tue, Jul 17, 2012 at 7:54 AM, Gerrat Rickert > <gri...@co...> wrote: > > I have a bit more information on this. > > I had a friend install the 64bit python3.2 VPython version, and, like > > my 2.7 version, it did not include the Polygon, ttfquery, or > FontTools module, or VIDLE. > > It's odd that the python 3.1 version seems to have included these (as > > Norm Derby tells you). > > It appears that the 64bit binaries for VPython for both python 2.7 > and > > 3.2 are doing what your 32bit version calls a "Compact" install vs. a > full install. > > I emailed Christoph Gohlke to ask if he'd consider changing to a > 64bit > > full install version (but as these are unofficial/unsupported, I'm > not sure what to expect). > > > > > > I still have a question for you though. It appears that the 32bit > > version of VPython exits the (regular, not VIDLE) interpreter as well > > when the Display window is closed (so my original question has > nothing to do with me using a 64bit version). > > It looks like VIDLE somehow restarts itself when the display window > is closed. > > Is there a reason for this behaviour? > > Is it possible to have the regular interpreter not exit just because > > the display window is closed? > > > > Regards, > > Gerrat > > > > > >> -----Original Message----- > >> From: Bruce Sherwood [mailto:Bru...@nc...] > >> Sent: July 16, 2012 6:16 PM > >> To: vis...@li... > >> Subject: Re: [Visualpython-users] Python Interpreter exits when > >> Display window is closed > >> > >> Oh, now I see. I hadn't read your note sufficiently carefully, and I > >> wasn't aware that someone had gone to the trouble of providing 64- > bit > >> builds of VPython for Windows, which is great. I should add to > >> vpython.org a link to this work. Norm Derby tells me this: > >> > >> ---------------------------------------------- > >> The website referenced by Gerrat Rickert: > >> > >> http://www.lfd.uci.edu/~gohlke/pythonlibs/#vpython > >> > >> is maintained by Christoph Gohlke at UC-Irvine. It is wonderful. He > >> has produced unofficial versions VPython for 64-bit Windows and LOTS > >> of other Python programs that do not yet have official 64-bit > >> versions. I have installed Python 3.1 64-bit and a VPython version > >> that runs under it. Unlike Gerrat, my installation included Vidle > and > >> everything works like a charm. > >> ------------------------------------------------ > >> > >> There remains the question of why this works for Derby but not for > >> you, and I have no idea. > >> > >> General comment: Note that these 64-bit versions are for Windows, > not > >> Mac. A 64-bit Mac version requires major restructuring of VPython to > >> function in the Cocoa framework. As I indicated in an earlier note, > >> I'm working on a possible solution to that problem. > >> > >> Bruce Sherwood > >> > >> On Mon, Jul 16, 2012 at 2:39 PM, Gerrat Rickert > >> <gri...@co...> wrote: > >> > In my question, I included the link where *unofficial* versions of > >> many python 3rd party libraries have been compiled to 64bit. > >> > ...and I mentioned that it was unofficial. > >> > ...not sure why you think its a puzzle that anything works - this > >> > is > >> probably the first 64bit library on this site I've run into issues > >> with (and exiting the interactive python interpreter when the > display > >> window is closed is mostly just an inconvenience). > >> > > >> > I know there is no official version, but like many with 64bit > >> computers, I'd prefer to use 64bit programs. I have over a dozen of > >> other 64bit python 3rd party libs installed, and working correctly, > >> downloaded from the page I linked to (...since there weren't any > >> official 64bit versions of these either). > >> > > >> > > >> > ...so reading into your "answer", I'll surmise that: > >> > 1. The 32bit version doesn't have this issue. > >> > 2. You don't know why it doesn't work for this unofficial 64bit > >> version. > >> > > >> > > >> > Thanks for your time. > > > > [...remainder elided] > > ----------------------------------------------------------------------- > ------- > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. > Discussions will include endpoint security, mobile security and the > latest in malware threats. > http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |