[Tutor] Python on T-Mobile Wing???
Hey all, I just got a brand new T-Mobile Wing, and, as you might guess, I want to install python on it. Well, I tried both the pythonce main build (with the .exe), and the build for the smartphone (also used .exe), but once I downloaded them, when I tried to run them, a dialog comes up saying that this is not a valid pocket pc app. Any ideas? Note- the wing uses windows mobile 6. The specs can be found at- http://www.t-mobile.com/shop/phones/Detail.aspx?device=acc8102d-4506-4eaa-bc2f-9c7b8ec1b1e0 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Fw: Wrong version of Python being executed
Tiger12506 wrote: > I have not found that the PYTHONPATH environment variable has any effect No, it wouldn't. Windows doesn't know about PYTHONPATH; it is used internally by the Python interpreter when searching for imported modules and packages. Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Fw: Wrong version of Python being executed
I haven't seen anybody write down the full picture so that we are not misled. Windows chooses which python to use in this manner. 1) If you double click on a .py file in windows, it looks in the registry for the command string that pertains to "open". The .py extension has a default value that tells which type of file it is, this 'type' has it's own seperate command for "open" (So 'txtfile' will have a different open command than 'mp3file', for example.) If in the command interpreter (sometimes inaccurately called a dos box) you type the name of the .py file (WITHOUT typing python), then windows will open it with whatever value is in the registry, just as if you had double clicked it in explorer. 2) However, if you type python before the script name, then windows checks first a) in the directory that the prompt is at b) checks in each directory in the PATH environment variable for an executable named python.exe and uses that I have not found that the PYTHONPATH environment variable has any effect (which i doubt it would, as windows does not make a special case to check it before hand, and I doubt that python.exe will check that environ var and spawn the proper version before it runs the script) I am absolutely certain that the #! at the beginning of the python file does NOT work in windows, it is strictly a *nix thing. There are many solutions to this, my favorite being where one adds an extra entry to the sub menu of the .py file. Effectively what happens is that another key and value is added to the registry, providing an alternate command string for "open" If you go to control panel->folder options->file associations and choose py file and click advanced, there should be an option to add another "verb" i believe they call it. So add one and call it open w/23 or something to distinguish it from regular "open" and put in the command box the full path of the python exe, followed by "%1" with quotes, so that when you choose that menu option it will run that particular python and send the name of the file through %1 so it is passed in as the argument. Then, when you want to run it with your default python, you right-click->open. When you want to run it with the different version, right-click->open w/23 or whatever you called it. hope this helps JS ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Tutor Digest, Vol 45, Issue 58
- Forwarded Message From: Doug Glenn <[EMAIL PROTECTED]> To: Alan Gauld <[EMAIL PROTECTED]> Sent: Tuesday, 20 November, 2007 4:08:12 AM Subject: Re: [Tutor] Wrong version of Python being executed >>It is a bit odd since normally Pythons installation mechinism only >>does it for the PY file on install. You may have clicked on it >>sometime in the past and then selected "run with" and it remembered >>the association. I'm pretty sure every time I've installed Python that the associations get changed. However, since the executable is the same name for all versions of python (but the path is different), this doesn't help when you want to use one version instead of another. File associations are checked first, then it will check the path if there is no association. This is default windows behavior. >>Glad you got it sussed out! I know the reason of the strange behaviour, but not a solution at this point. I have a library which only works for Python2.3. When I start working on that project again, I 'll have to re-associate .py with 2.3. This isn't convenient (and it's likely I will have forgotten all about this by then) :-) ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] [wxPython-users] How to save file name of file openedfromwx.FileDialog ?
Hello Alan, What i want is i just need a file picker to chooose the file and display the file name in the text box. I need to open about 4 files like that. That is the front end work. In the back end i am making a list variable to which i have to send the information about the selected files. And that list is read and files are opened in another script. So, i guess i need to improve the code more to choose the file, display just the file information and may be send whole file path to the list. I need to work more on that i guess.Thanks for reminding me... -Varsha On Nov 18, 2007 1:03 AM, Alan Gauld <[EMAIL PROTECTED]> wrote: > > "Varsha Purohit" <[EMAIL PROTECTED]> wrote > > I note that you got it wotking but just to clarify... > > >I am actually calling the binding function and then writing it > > into the text value... > > > class ScrolledWindow(wx.Frame): > >def __init__(self, parent, id, title): > >txt1 = wx.TextCtrl(panel, -1, pos=(30, 100), size=(150, 20)) > >name = self.Bind(wx.EVT_BUTTON, self.OnOpen, button11) > >txt1.write(name) > > The Bind function does not execute the handler method > it simply registers it within wxPython for future use when > the button event is triggered. The return value from Bind > is not the return value of the method being bound. > > The method only gets called when the button is pressed, > thats why you have to put the write() call in the event > handler itself. > > HTH, > > -- > Alan Gauld > Author of the Learn to Program web site > http://www.freenetpages.co.uk/hp/alan.gauld > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Fw: Wrong version of Python being executed
Darn, I thought I sent this to Tony. I had seen about 20 odd exchanges about it and had not seen anyone ask about File associations. For some reasons my messages bounce, probably because I had used my alias mail addressing from gmail. Thanks Alan. On Nov 20, 2007 3:26 AM, ALAN GAULD <[EMAIL PROTECTED]> wrote: > Forwarding to the list... > > - Forwarded Message > From: Doug Glenn <[EMAIL PROTECTED]> > To: Alan Gauld <[EMAIL PROTECTED]> > Sent: Tuesday, 20 November, 2007 4:08:12 AM > Subject: Re: [Tutor] Wrong version of Python being executed > > > Hrrrm, I thought you did that last week when I asked you about it. > > It is a bit odd since normally Pythons installation mechinism only > does it for the PY file on install. You may have clicked on it > sometime in the past and then selected "run with" and it remembered > the association. > > File associations are checked first, then it will check the path if > there is no association. This is default windows behavior. > > Glad you got it sussed out! > > -- > Doug Glenn > FORUM Information Systems, LLC > http://foruminfosystems.com > > > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- Doug Glenn FORUM Information Systems, LLC http://foruminfosystems.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Fw: Wrong version of Python being executed
Forwarding to the list... - Forwarded Message From: Doug Glenn <[EMAIL PROTECTED]> To: Alan Gauld <[EMAIL PROTECTED]> Sent: Tuesday, 20 November, 2007 4:08:12 AM Subject: Re: [Tutor] Wrong version of Python being executed Hrrrm, I thought you did that last week when I asked you about it. It is a bit odd since normally Pythons installation mechinism only does it for the PY file on install. You may have clicked on it sometime in the past and then selected "run with" and it remembered the association. File associations are checked first, then it will check the path if there is no association. This is default windows behavior. Glad you got it sussed out! -- Doug Glenn FORUM Information Systems, LLC http://foruminfosystems.com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor