From alan at goatpunch.com Mon Apr 3 18:11:31 2006 From: alan at goatpunch.com (Alan Davies) Date: Mon, 03 Apr 2006 12:11:31 -0400 Subject: [PythonCE] Python CE on Windows Mobile 5 Smartphone In-Reply-To: <85d9ccbb0603220206u581af064te8aa9d7372dd7ede@mail.gmail.com> References: <000601c64d14$3c0011c0$3900a8c0@jsihome.com> <1143006381.3405.257221969@webmail.messagingengine.com> <85d9ccbb0603220206u581af064te8aa9d7372dd7ede@mail.gmail.com> Message-ID: <1144080691.11828.258191786@webmail.messagingengine.com> Sorry, I should have been more specific- I was trying to install on a WM5 Smartphone, and I get the 'not intended for this device' message. Is there any reason why PythonCE wouldn't be able to run on a WM5 Smartphone- it's basically the same OS as WM5 PPC? Thanks, --Alan On Wed, 22 Mar 2006 10:06:07 +0000, "Andy Baker" said: > Works for me. > > Haven't used it much yet but the basics are working. > > > On 3/22/06, Alan Davies wrote: > > > > Hi, > > > > Has anyone managed to succesfully run Python CE on Windows Mobile 5? I > > checked in the archives but couldn't find any references to WM5. If a > > WM5-compatible build doesn't exist, how could I go about creating one > > myself? > > > > thanks, > > > > --Alan > > _______________________________________________ > > PythonCE mailing list > > PythonCE at python.org > > http://mail.python.org/mailman/listinfo/pythonce > > > > > > -- > ---------------------------------- > http://www.andybak.net From coder_infidel at hotmail.com Wed Apr 5 14:34:11 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Wed, 5 Apr 2006 20:34:11 +0800 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM Message-ID: A new release of Python for Windows CE is available. Download it here: http://sourceforge.net/project/showfiles.php?group_id=104228 The release notes are linked from this page, but a direct link is: http://sourceforge.net/project/shownotes.php?release_id=407232&group_id=104228 Luke From bkc at murkworks.com Wed Apr 5 15:50:07 2006 From: bkc at murkworks.com (Brad Clements) Date: Wed, 05 Apr 2006 09:50:07 -0400 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM In-Reply-To: Message-ID: <443392CF.13162.32F1D673@bkc.murkworks.com> On 5 Apr 2006 at 20:34, Luke Dunstan wrote: > A new release of Python for Windows CE is available. Download it here: > > http://sourceforge.net/project/showfiles.php?group_id=104228 That's great, thanks a lot Luke! -- Brad Clements, bkc at murkworks.com (315)268-1000 http://www.murkworks.com AOL-IM or SKYPE: BKClements From alan at goatpunch.com Wed Apr 5 18:18:54 2006 From: alan at goatpunch.com (Davies, Alan) Date: Wed, 5 Apr 2006 12:18:54 -0400 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM Message-ID: <032c01c658cc$a4b4aa68$038117ac@exchange.xchg> Does this build install on WM5 Smartphone? --Alan -----Original Message----- On 5 Apr 2006 at 20:34, Luke Dunstan wrote: > A new release of Python for Windows CE is available. Download it here: > > http://sourceforge.net/project/showfiles.php?group_id=104228 That's great, thanks a lot Luke! -- Brad Clements, bkc at murkworks.com (315)268-1000 http://www.murkworks.com AOL-IM or SKYPE: BKClements _______________________________________________ PythonCE mailing list PythonCE at python.org http://mail.python.org/mailman [truncated by sender] From coder_infidel at hotmail.com Thu Apr 6 17:01:28 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Thu, 6 Apr 2006 23:01:28 +0800 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM References: <032c01c658cc$a4b4aa68$038117ac@exchange.xchg> Message-ID: ----- Original Message ----- From: "Davies, Alan" To: Sent: Thursday, April 06, 2006 12:18 AM Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM > Does this build install on WM5 Smartphone? > > --Alan If the previous version didn't work then I doubt this one will. I don't have a WM5 Smartphone though so I can't really debug and fix it. I did a search and it should be possible to build applications for Smartphone 2003 using Microsoft eMbedded Visual C++ 4.0 and then run them on WM5 Smartphone (http://www.codecomments.com/archive329-2006-3-825354.html). Have you actually tried building PythonCE for Smartphone? Luke > > -----Original Message----- > On 5 Apr 2006 at 20:34, Luke Dunstan wrote: > >> A new release of Python for Windows CE is available. Download it here: >> >> http://sourceforge.net/project/showfiles.php?group_id=104228 > > That's great, thanks a lot Luke! > > > > > -- > Brad Clements, bkc at murkworks.com (315)268-1000 > http://www.murkworks.com > AOL-IM or SKYPE: BKClements From alan at goatpunch.com Fri Apr 7 01:52:35 2006 From: alan at goatpunch.com (Davies, Alan) Date: Thu, 6 Apr 2006 19:52:35 -0400 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM Message-ID: <034501c659d5$3143a8a8$038117ac@exchange.xchg> No I haven't, I'll try building the 20060404 Sources. --Alan -- Sent from my cel: +1 (514) 839 9279 -----Original Message----- From: "Luke Dunstan" To: "pythonce at python.org" Cc: "Davies, Alan" Sent: 2006-04-06 11:01 Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM ----- Original Message ----- From: "Davies, Alan" To: Sent: Thursday, April 06, 2006 12:18 AM Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM > Does this build install on WM5 Smartphone? > > --Alan If the previous version didn't work then I doubt this one will. I don't have a WM5 Smartphone though so I can't really debug and fix it. I did a search and it should be possible to build applications for Smartphone 2003 using Microsoft eMbedded Visual C++ 4.0 and then run them on WM5 Smartphone (http://www.codecomments.com/archive329-2006-3-825354.html). Have you actually tried building PythonCE for Smartphone? Luke > > -----Original Message----- > On 5 Apr 2006 at 20:34, Luke Dunstan wrote: > >> A new release of Python for Windows CE is available. Download it here: >> >> http://sourceforge.net/project/showfiles.php?group_id=104228 > > That's great, thanks a lot Luke! > > > > > -- > Brad Clements, bkc at murkworks.com (315)268-1000 > http://www.murkworks.com > AOL-IM or SKYPE: BKClements From javirosa at eden.rutgers.edu Fri Apr 7 02:12:25 2006 From: javirosa at eden.rutgers.edu (javirosa at eden.rutgers.edu) Date: Thu, 6 Apr 2006 20:12:25 -0400 (EDT) Subject: [PythonCE] new build In-Reply-To: References: Message-ID: <1152.128.6.83.44.1144368745.squirrel@webmail.eden.rutgers.edu> Awesome. Thank you for all the time you've put into this. From mail at jan-ischebeck.de Fri Apr 7 10:46:20 2006 From: mail at jan-ischebeck.de (Jan Ischebeck) Date: Fri, 07 Apr 2006 17:46:20 +0900 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM In-Reply-To: References: Message-ID: <443626DC.1080606@jan-ischebeck.de> Dear Luke, thanks for the great work. I found a small regression: float("2.2") works on win32 and linux python 2.4, but raises an error using the new build. Jan Luke Dunstan schrieb: > A new release of Python for Windows CE is available. Download it here: > > http://sourceforge.net/project/showfiles.php?group_id=104228 > > The release notes are linked from this page, but a direct link is: > > http://sourceforge.net/project/shownotes.php?release_id=407232&group_id=104228 > > > Luke > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > > > From kashtan at Validus.Com Fri Apr 7 10:39:19 2006 From: kashtan at Validus.Com (David L. Kashtan) Date: Fri, 07 Apr 2006 01:39:19 -0700 Subject: [PythonCE] new build Message-ID: <44362537.5040404@validus.com> I have updated the CVS repository on sourceforge with the 2.4.3 pythonce source. David Kashtan Validus Medical Systems From coder_infidel at hotmail.com Fri Apr 7 14:25:42 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Fri, 7 Apr 2006 20:25:42 +0800 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM References: <443626DC.1080606@jan-ischebeck.de> Message-ID: ----- Original Message ----- From: "Jan Ischebeck" To: "Luke Dunstan" ; Sent: Friday, April 07, 2006 4:46 PM Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM > Dear Luke, > > thanks for the great work. > > I found a small regression: > > float("2.2") > > works on win32 and linux python 2.4, but raises an error using the new > build. > > Jan It works for me: Python 2.4.3 (#0, Apr 4 2006, 23:48:52) [MSC v.1201 32 bit (Unknown)] on Pocket PC >>> float("2.2") 2.2000000000000002 What error do you get? Luke > > Luke Dunstan schrieb: >> A new release of Python for Windows CE is available. Download it here: >> >> http://sourceforge.net/project/showfiles.php?group_id=104228 >> >> The release notes are linked from this page, but a direct link is: >> >> http://sourceforge.net/project/shownotes.php?release_id=407232&group_id=104228 >> >> >> Luke >> _______________________________________________ >> PythonCE mailing list >> PythonCE at python.org >> http://mail.python.org/mailman/listinfo/pythonce >> >> >> > > From coder_infidel at hotmail.com Fri Apr 7 19:19:31 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Sat, 8 Apr 2006 01:19:31 +0800 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM References: Message-ID: Interesting. What happens if you try float("2,2")? If that works then I guess PythonCE must be using your user default locale instead of the "C" locale. It looks like this locale-based float conversion feature was added in Python 2.4 but I am guessing that on the PC the default locale is "C" unless you explicitly change it? The output of this should confirm it: import locale locale.setlocale(locale.LC_ALL) locale.localeconv() I'm not very familiar with locale programming so I'm not sure how to fix it yet. Luke ----- Original Message ----- From: To: "coder_infidel" Sent: Friday, April 07, 2006 9:12 PM Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM Dear Luke, I've the same problem of Jan: >>>float("2.2") ValueError: invalid literal for float():2.2 bye ivom italy > > ----- Original Message ----- > From: "Jan Ischebeck" > To: "Luke Dunstan" ; > Sent: Friday, April 07, 2006 4:46 PM > Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM > > > > Dear Luke, > > > > thanks for the great work. > > > > I found a small regression: > > > > float("2.2") > > > > works on win32 and linux python 2.4, but raises an error using the new > > build. > > > > Jan > > It works for me: > > Python 2.4.3 (#0, Apr 4 2006, 23:48:52) [MSC v.1201 32 bit (Unknown)] on > Pocket PC > >>> float("2.2") > 2.2000000000000002 > > What error do you get? > > Luke > > > > > Luke Dunstan schrieb: > >> A new release of Python for Windows CE is available. Download it here: > >> > >> http://sourceforge.net/project/showfiles.php?group_id=104228 > >> > >> The release notes are linked from this page, but a direct link is: > >> > >> http://sourceforge.net/project/shownotes.php?release_id=407232&group_id=104228 > >> > >> > >> Luke > >> _______________________________________________ > >> PythonCE mailing list > >> PythonCE at python.org > >> http://mail.python.org/mailman/listinfo/pythonce > >> > >> > >> > > > > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > From mail at jan-ischebeck.de Sat Apr 8 13:14:37 2006 From: mail at jan-ischebeck.de (Jan Ischebeck) Date: Sat, 08 Apr 2006 20:14:37 +0900 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM In-Reply-To: References: Message-ID: <44379B1D.50102@jan-ischebeck.de> Dear Luke, both float("2,2") and float("2.2") don't work. They raise an "ValueError: invalid literal for float(): 2.2". Current locale is "Deutsch" (german word for "german"). After setting the locale to LC_ALL it is still "Deutsch". According to localeconv| 'decimal_point' is "," but this should not have any influence on float(), as there is a specific locale depend function for this conversion. When I call locale.atof("2,2") I get the following error: Traceback(most recent call last): File "binaries\lib\locale.py", line 173, in atof ValueError: invalid literal for float():2.2 Although the locale stuff seems to be somehow mixed up, could it be that float("") is calling a locale depend wince function in python 2.4 ? Jan | Luke Dunstan schrieb: > Interesting. What happens if you try float("2,2")? If that works then I > guess PythonCE must be using your user default locale instead of the "C" > locale. It looks like this locale-based float conversion feature was added > in Python 2.4 but I am guessing that on the PC the default locale is "C" > unless you explicitly change it? The output of this should confirm it: > > import locale > locale.setlocale(locale.LC_ALL) > locale.localeconv() > > I'm not very familiar with locale programming so I'm not sure how to fix it > yet. > > Luke > > ----- Original Message ----- > From: > To: "coder_infidel" > Sent: Friday, April 07, 2006 9:12 PM > Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM > > > Dear Luke, > I've the same problem of Jan: > >>>> float("2.2") >>>> > ValueError: invalid literal for float():2.2 > > bye > > ivom > italy > > > >> ----- Original Message ----- >> From: "Jan Ischebeck" >> To: "Luke Dunstan" ; >> Sent: Friday, April 07, 2006 4:46 PM >> Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM >> >> >> >>> Dear Luke, >>> >>> thanks for the great work. >>> >>> I found a small regression: >>> >>> float("2.2") >>> >>> works on win32 and linux python 2.4, but raises an error using the new >>> build. >>> >>> Jan >>> >> It works for me: >> >> Python 2.4.3 (#0, Apr 4 2006, 23:48:52) [MSC v.1201 32 bit (Unknown)] on >> Pocket PC >> >>>>> float("2.2") >>>>> >> 2.2000000000000002 >> >> What error do you get? >> >> Luke >> >> >>> Luke Dunstan schrieb: >>> >>>> A new release of Python for Windows CE is available. Download it here: >>>> >>>> http://sourceforge.net/project/showfiles.php?group_id=104228 >>>> >>>> The release notes are linked from this page, but a direct link is: >>>> >>>> http://sourceforge.net/project/shownotes.php?release_id=407232&group_id=104228 >>>> >>>> >>>> Luke >>>> _______________________________________________ >>>> PythonCE mailing list >>>> PythonCE at python.org >>>> http://mail.python.org/mailman/listinfo/pythonce >>>> >>>> >>>> >>>> >>> >> _______________________________________________ >> PythonCE mailing list >> PythonCE at python.org >> http://mail.python.org/mailman/listinfo/pythonce >> >> > > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > > > From gpetruc at gmail.com Sat Apr 8 15:32:40 2006 From: gpetruc at gmail.com (Giovanni Petrucciani) Date: Sat, 08 Apr 2006 15:32:40 +0200 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM In-Reply-To: <44379B1D.50102@jan-ischebeck.de> References: <44379B1D.50102@jan-ischebeck.de> Message-ID: <4437BB78.1020806@gmail.com> Jan Ischebeck wrote: > Dear Luke, > > both float("2,2") and float("2.2") don't work. They raise an > "ValueError: invalid literal for float(): 2.2". > Current locale is "Deutsch" (german word for "german"). After setting > the locale to LC_ALL it is still > "Deutsch". > > According to localeconv| 'decimal_point' is "," but this should not have > any influence on float(), > as there is a specific locale depend function for this conversion. > > When I call locale.atof("2,2") I get the following error: > Traceback(most recent call last): > File "binaries\lib\locale.py", line 173, in atof > ValueError: invalid literal for float():2.2 > > Although the locale stuff seems to be somehow mixed up, could it be that > float("") is > calling a locale depend wince function in python 2.4 ? > I experience the same problem with an italian version of Windows CE. I didn't suppose float was localized (and, as it happens for you too) float("2,2") does not work eiher This has also bad consequences, as float() is used everywhere; for example now you cannot load Tkinter (which does float('8.4') ...) IMHO float(x) shoud not use the localized version (otherwise float(str(x)) != x even for simple x like 0.5 .... this is really bad) Except for this Python 2.4 rocks, and it loads even faster. really good job. (There is also one other minor addition that I would appreciate: adding Cut/Copy/Paste on the menu near Beak/Exit/..., with the stilus it's a log way around to get to Ctrl+C/X/V ...) I'll try to recompile it this weekend, so that I can port sqlite (and maybe even wxPython, 4Suite and IPython) to pyce 2.4.3 Giovanni From coder_infidel at hotmail.com Sat Apr 8 18:37:06 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Sun, 9 Apr 2006 00:37:06 +0800 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM References: <44379B1D.50102@jan-ischebeck.de> <4437BB78.1020806@gmail.com> Message-ID: ----- Original Message ----- From: "Giovanni Petrucciani" To: "Jan Ischebeck" Cc: Sent: Saturday, April 08, 2006 9:32 PM Subject: Re: [PythonCE] Python 2.4.3 for Windows CE / ARM > Jan Ischebeck wrote: >> Dear Luke, >> >> both float("2,2") and float("2.2") don't work. They raise an >> "ValueError: invalid literal for float(): 2.2". >> Current locale is "Deutsch" (german word for "german"). After setting >> the locale to LC_ALL it is still >> "Deutsch". >> >> According to localeconv| 'decimal_point' is "," but this should not have >> any influence on float(), >> as there is a specific locale depend function for this conversion. >> >> When I call locale.atof("2,2") I get the following error: >> Traceback(most recent call last): >> File "binaries\lib\locale.py", line 173, in atof >> ValueError: invalid literal for float():2.2 >> >> Although the locale stuff seems to be somehow mixed up, could it be that >> float("") is >> calling a locale depend wince function in python 2.4 ? >> > > I experience the same problem with an italian version of Windows CE. > > I didn't suppose float was localized (and, as it happens for you too) > float("2,2") does not work eiher > This has also bad consequences, as float() is used everywhere; for > example now you cannot load Tkinter (which does float('8.4') ...) > > IMHO float(x) shoud not use the localized version (otherwise > float(str(x)) != x even for simple x like 0.5 .... this is really bad) Looking at the source code for float() in floatobject.c, it calls PyOS_ascii_strtod() in pystrtod.c. This function then calls localeconv() to find the decimal point character for the current locale and if it is not '.' then the function translates any '.' in the input string to the locale decimal point. After this conversion it calls the C library strtod() function. This means that float() should work with either '.' or ',' for Italian/German locales and you can test this on the PC (as opposed to WinCE): >>> locale.setlocale(locale.LC_NUMERIC, 'Italian') 'Italian_Italy.1252' >>> float('2,2') 2.2000000000000002 >>> float('2.2') 2.2000000000000002 I tried setting my PDA to the Italian locale and I can see the problem that you describe. The bug is that Windows CE (or at least Pocket PC 2003) does not provide a setlocale() function (so of course strtod() doesn't support locales), but in the PythonCE code we are providing a fake setlocale() and localeconv() which default to returning the user default locale settings. The only solution I can see is to change localeconv() and setlocale() to always return the "C" locale settings. Do you agree? To get working locales we would need to rewrite strtod() and many other functions to take into account the current locale, so that is not really feasible. > Except for this Python 2.4 rocks, and it loads even faster. really good > job. > > (There is also one other minor addition that I would appreciate: adding > Cut/Copy/Paste on the menu near Beak/Exit/..., with the stilus it's a > log way around to get to Ctrl+C/X/V ...) Could you please submit this to the SourceForge feature request tracker so that it isn't forgotten? http://sourceforge.net/tracker/?group_id=104228&atid=637343 Luke > > I'll try to recompile it this weekend, so that I can port sqlite (and > maybe even wxPython, 4Suite and IPython) to pyce 2.4.3 > > Giovanni From gpetruc at gmail.com Sat Apr 8 19:57:40 2006 From: gpetruc at gmail.com (Giovanni Petrucciani) Date: Sat, 08 Apr 2006 19:57:40 +0200 Subject: [PythonCE] Python 2.4.3 for Windows CE / ARM In-Reply-To: References: <44379B1D.50102@jan-ischebeck.de> <4437BB78.1020806@gmail.com> Message-ID: <4437F994.6010807@gmail.com> Luke Dunstan wrote: > Looking at the source code for float() in floatobject.c, it calls > PyOS_ascii_strtod() in pystrtod.c. This function then calls localeconv() to > find the decimal point character for the current locale and if it is not '.' > then the function translates any '.' in the input string to the locale > decimal point. After this conversion it calls the C library strtod() > function. This means that float() should work with either '.' or ',' for > Italian/German locales and you can test this on the PC (as opposed to > WinCE): > Yes, I found that disabling the "de-localization" code in pystrtod.c, and in fact now I just replaced "if (decimalseparator[0] != '.' ...)" with "if (0)" and everything works fine (using '.' and not ',') > I tried setting my PDA to the Italian locale and I can see the problem that > you describe. The bug is that Windows CE (or at least Pocket PC 2003) does > not provide a setlocale() function (so of course strtod() doesn't support > locales), but in the PythonCE code we are providing a fake setlocale() and > localeconv() which default to returning the user default locale settings. > > The only solution I can see is to change localeconv() and setlocale() to > always return the "C" locale settings. Do you agree? To get working locales > we would need to rewrite strtod() and many other functions to take into > account the current locale, so that is not really feasible. > I think it's fine, most of the people won't be surprized to see that float('8.4') is ok and float('8,4') is not even if in their locale the "," is used instead of the "." ... Giovanni From hybrid at tuxfamily.org Mon Apr 10 20:54:41 2006 From: hybrid at tuxfamily.org (Ali Sabil) Date: Mon, 10 Apr 2006 20:54:41 +0200 Subject: [PythonCE] Problem calling python Message-ID: <443AA9F1.4080100@tuxfamily.org> Hi all, I have some trouble running python files. If i open a shell (or whatever you call it) and type: python hello.py it starts python then says : Traceback(innermost last) NULL:NULL If i edit the registry thingies, and associate .py with python with something like this : [HKEY_CLASSES_ROOT\pyfile\Shell\Open\Command] @="\"\\Program Files\\Python24\\python.exe\" \"%1 %2 %3 %4 %5 %6 %7 %8 %9\"" I get the same exact effect when clicking on hello.py ... now if i use [HKEY_CLASSES_ROOT\pyfile\Shell\Open\Command] @="\"\\Program Files\\Python24\\python.exe\" \"%1\"" It works, or at least almost, since it complains about import failure for some modules. The problem now is that i cannot run python from a shell, and i need this to build a .bat that setup the environment. Concerning the import failure, i don't know, but it's weird since the same code works perfectly on my linux box. Thank you for your help -- Ali -------------- next part -------------- A non-text attachment was scrubbed... Name: hybrid.vcf Type: text/x-vcard Size: 124 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20060410/e7750ec4/attachment.vcf From coder_infidel at hotmail.com Tue Apr 11 17:10:28 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Tue, 11 Apr 2006 23:10:28 +0800 Subject: [PythonCE] Problem calling python References: <443AA9F1.4080100@tuxfamily.org> Message-ID: ----- Original Message ----- From: "Ali Sabil" To: Sent: Tuesday, April 11, 2006 2:54 AM Subject: [PythonCE] Problem calling python > Hi all, > > I have some trouble running python files. > > If i open a shell (or whatever you call it) and type: python hello.py > it starts python then says : > > Traceback(innermost last) > NULL:NULL Running python from the command prompt works for me. Did you type the full path to hello.py? If so what is the exact command you used and what was the "current directory" in the command prompt? > > If i edit the registry thingies, and associate .py with python with > something like this : > > [HKEY_CLASSES_ROOT\pyfile\Shell\Open\Command] > @="\"\\Program Files\\Python24\\python.exe\" \"%1 %2 %3 %4 %5 %6 %7 %8 > %9\"" > Try quoting the individual arguments instead of all of them as a group: @="\"\\Program Files\\Python24\\python.exe\" \"%1\" \"%2\" \"%3\" \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\"" I haven't tried it yet though... > I get the same exact effect when clicking on hello.py ... now if i use > > [HKEY_CLASSES_ROOT\pyfile\Shell\Open\Command] > @="\"\\Program Files\\Python24\\python.exe\" \"%1\"" > > It works, or at least almost, since it complains about import failure > for some modules. > The problem now is that i cannot run python from a shell, and i need > this to build a .bat that setup the environment. > > Concerning the import failure, i don't know, but it's weird since the > same code works perfectly on my linux box. What modules? Where are they located, etc? Luke > > Thank you for your help > > -- > Ali > From hybrid at tuxfamily.org Wed Apr 12 13:06:13 2006 From: hybrid at tuxfamily.org (Ali Sabil) Date: Wed, 12 Apr 2006 13:06:13 +0200 Subject: [PythonCE] Problem calling python In-Reply-To: References: <443AA9F1.4080100@tuxfamily.org> Message-ID: <443CDF25.8030400@tuxfamily.org> Hi again > > Running python from the command prompt works for me. Did you type the > full path to hello.py? If so what is the exact command you used and > what was the "current directory" in the command prompt? i didn't use a full path, hello.py was in the current directory, when run with an absolute path it works. The command i used before is python hello.py , hello.py being in the cwd using python \XMPPD\hello.py works > > Try quoting the individual arguments instead of all of them as a group: > > @="\"\\Program Files\\Python24\\python.exe\" \"%1\" \"%2\" \"%3\" > \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\"" > > I haven't tried it yet though... It's working, thank you > >> I get the same exact effect when clicking on hello.py ... now if i use >> >> [HKEY_CLASSES_ROOT\pyfile\Shell\Open\Command] >> @="\"\\Program Files\\Python24\\python.exe\" \"%1\"" >> >> It works, or at least almost, since it complains about import failure >> for some modules. >> The problem now is that i cannot run python from a shell, and i need >> this to build a .bat that setup the environment. >> >> Concerning the import failure, i don't know, but it's weird since the >> same code works perfectly on my linux box. > > What modules? Where are they located, etc I am trying to get xmppd (http://nuweb.org/index) to run under winCE, i managed to build the only dependency to xmppd (which is tlslite), now i have problems with python itself :/ (btw i built python from sources for winCE 5.0 under an x86 platform) I found out that the module package in xmppd filter files using .py extension, so i modified it quite a bit to be able to use .pyc, the remaining problems, is that os.listdir('.') for example doesn't return the correct file listing (it returns only one file) ... which is somewhat weird, i am suspecting this KITL thingies (i am just discovering microsoft technologies) and the virtual directory stuff. Thank you very much -- Ali -------------- next part -------------- A non-text attachment was scrubbed... Name: hybrid.vcf Type: text/x-vcard Size: 124 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonce/attachments/20060412/5da88fcb/attachment.vcf From coder_infidel at hotmail.com Wed Apr 12 17:13:19 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Wed, 12 Apr 2006 23:13:19 +0800 Subject: [PythonCE] Problem calling python References: <443AA9F1.4080100@tuxfamily.org> <443BE3A8.2030504@tuxfamily.org> Message-ID: While you are debugging this, please be aware that unlike most operating systems, Windows CE has no concept of a "current directory" at all. The command prompt gives the illusion of a current directory for convenience but once you start another program it will have no way of knowing what the command prompt current directory was. PythonCE also emulates a current directory for compatibility with other Python platforms but it is always "\Temp" when you start PythonCE. You can see what the current (emulated) directory is using os.getcwd(). Luke ----- Original Message ----- From: "Ali Sabil" To: "Luke Dunstan" Sent: Wednesday, April 12, 2006 1:13 AM Subject: Re: [PythonCE] Problem calling python > Hi again >> >> Running python from the command prompt works for me. Did you type the >> full path to hello.py? If so what is the exact command you used and >> what was the "current directory" in the command prompt? > i didn't use a full path, hello.py was in the current directory, i > didn't try to run it with an absolute path. i'll try now and report. > > The command i used before is python hello.py , hello.py being in the cwd > >> >> Try quoting the individual arguments instead of all of them as a group: >> >> @="\"\\Program Files\\Python24\\python.exe\" \"%1\" \"%2\" \"%3\" >> \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\"" >> >> I haven't tried it yet though... > Okey i'll give it a try ... i will also try to use %* or whatever it is >> >>> I get the same exact effect when clicking on hello.py ... now if i use >>> >>> [HKEY_CLASSES_ROOT\pyfile\Shell\Open\Command] >>> @="\"\\Program Files\\Python24\\python.exe\" \"%1\"" >>> >>> It works, or at least almost, since it complains about import failure >>> for some modules. >>> The problem now is that i cannot run python from a shell, and i need >>> this to build a .bat that setup the environment. >>> >>> Concerning the import failure, i don't know, but it's weird since the >>> same code works perfectly on my linux box. >> >> What modules? Where are they located, etc? > I am trying to get xmppd (http://nuweb.org/index) to run under winCE, i > managed to build the only dependency to xmppd (which is tlslite), now i > have problems with python itself :/ (btw i built python from sources for > winCE 5.0 under an x86 platform) > > Thank you very much > > -- > Ali > From kitsune_e at yahoo.com Wed Apr 12 18:19:01 2006 From: kitsune_e at yahoo.com (Ed Blake) Date: Wed, 12 Apr 2006 09:19:01 -0700 (PDT) Subject: [PythonCE] Problem calling python In-Reply-To: Message-ID: <20060412161901.83983.qmail@web50209.mail.yahoo.com> I've been wondering about that. Don't you get the full path to a script when it is run? Otherwise how would Python know where to find the file it's supposed to execute? How can you open a file without knowing where it is? And if you do know where a script is being run from - shouldn't that be the scripts initial working directory? --- Luke Dunstan wrote: > > While you are debugging this, please be aware that unlike most operating > systems, Windows CE has no concept of a "current directory" at all. The > command prompt gives the illusion of a current directory for convenience > but > once you start another program it will have no way of knowing what the > command prompt current directory was. PythonCE also emulates a current > directory for compatibility with other Python platforms but it is always > "\Temp" when you start PythonCE. You can see what the current (emulated) > directory is using os.getcwd(). > > Luke > From johna at johnaherne.co.uk Thu Apr 20 08:37:27 2006 From: johna at johnaherne.co.uk (John Aherne) Date: Thu, 20 Apr 2006 07:37:27 +0100 Subject: [PythonCE] wxpython for ce Message-ID: <44472C27.5040307@johnaherne.co.uk> It is sometime since I last checked but I have not seen any reference to any more developments for the wxpython port to pocket pc. There was a mention sometime back that the sources would be handed to Robin Dunn. But since then I have found it almost impossible to trace a copy of the original package from Brian Retford. I am wondering whether this has all stalled or not. Does anyone know if Brian Retford did release his efforts to Robin. Does anyone know exactly what the score is on wxpyce. Thanks for any info. Regards John Aherne From jeff_barish at earthlink.net Thu Apr 20 13:26:13 2006 From: jeff_barish at earthlink.net (jeffbarish) Date: Thu, 20 Apr 2006 04:26:13 -0700 (PDT) Subject: [PythonCE] wxpython for ce In-Reply-To: <44472C27.5040307@johnaherne.co.uk> References: <44472C27.5040307@johnaherne.co.uk> Message-ID: <4005376.post@talk.nabble.com> Here is some relevant information that I exchanged with Robin on 23 March about the source diffs provided by Brian Retford: >Jeffrey Barish wrote: >> Were you able to get this posted on starship? ?Will you post directions >> on how >> to access it at starship? > >I haven't done it yet, I'd like to get it integrated into the current >CVS source tree, and make the current sources buildable for WinCE. ?It >looks like the patch will only apply cleanly to a rather old version of >the sources, so I need to reconcile a few things with the current source >and build methods, etc. I am hoping that Robin will provide an update in response to your query, but I don't know whether he reads this mail list. You might be better off posting on comp.python.wxpython. Clearly, what Robin is doing is the ideal solution and will result in a version of wxPython for winCE consistent with versions for other platforms. The old version from Brian Retford runs but has at least one whopper bug. I'm sure that many of us are waiting breathlessly for the new version that Robin is working on. -- View this message in context: http://www.nabble.com/wxpython-for-ce-t1478742.html#a4005376 Sent from the Python - pythonce forum at Nabble.com. From roman.bischoff at googlemail.com Thu Apr 20 17:04:55 2006 From: roman.bischoff at googlemail.com (Roman Bischoff) Date: Thu, 20 Apr 2006 17:04:55 +0200 Subject: [PythonCE] Fwd: IdleCE problem: No module named Tkconstants In-Reply-To: <29c1bc340604190739n43edb08di3c5b3818c94c237a@mail.gmail.com> References: <29c1bc340604190739n43edb08di3c5b3818c94c237a@mail.gmail.com> Message-ID: <29c1bc340604200804g7d24eb3cu539d7145cd6f5404@mail.gmail.com> After a hard reset I lost my whole Python installation on the iPaq. Now I'm re-installing it, and migrating to the newer versions. PocketPC 4.20.0 on Intel(R) PXA255 with 56MB. Python 2.4.3 (#0, Apr 4 2006, 23:48:52) [MSC v.1201 32 bit (Unknown)] on PocketPC My Device tk8.4 library Windows tk84.dll tcl84.dll celib.dll Programm Files Python24 Lib Editor.py Tkinter.py Working with the normal Python prompt is ok, but When clicking on Editor.pyor IdleCe.py, I get this error: Traceback (innermost last): File "\Program Files\Python24\Lib\Editor.py", line 10, in ? from Tkinter import * File "\Program Files\Python24\Lib\Tkinter.py", line 42, in ? from Tkconstants import * exceptions.ImportError: No module named Tkconstants ... what's wrong? Any idea? Roman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20060420/19885a67/attachment.htm From kitsune_e at yahoo.com Thu Apr 20 18:45:50 2006 From: kitsune_e at yahoo.com (Ed Blake) Date: Thu, 20 Apr 2006 09:45:50 -0700 (PDT) Subject: [PythonCE] Fwd: IdleCE problem: No module named Tkconstants In-Reply-To: <29c1bc340604200804g7d24eb3cu539d7145cd6f5404@mail.gmail.com> Message-ID: <20060420164550.36443.qmail@web50210.mail.yahoo.com> Yeah, I was going to post about what I did to get IdleCE working when I moved to Python 2.4, but I was lazy and didn't want to say anything stupid. Basically paths are setup correctly on PythonCE 2.4, but none of the Tkinter .py files are included. Just copy everything from /lib/Tkinter on your pc to /lib/Tkinter on your winCE - then edit/replace Tkinter.py using the instructions in the readme. At least I think that was all that was needed to get it running... Maybe I should fix the bugs and do a new release? Also somebody should put the Tkinter pyc files into the zip for the next release of PythonCE, What good is it to include it in the path but not the distro? --- Roman Bischoff wrote: > After a hard reset I lost my whole Python installation on the iPaq. > Now I'm re-installing it, and migrating to the newer versions. > > ... > I get this error: > > Traceback (innermost last): > File "\Program Files\Python24\Lib\Editor.py", line 10, in ? > from Tkinter import * > File "\Program Files\Python24\Lib\Tkinter.py", line 42, in ? > from Tkconstants import * > exceptions.ImportError: No module named Tkconstants > > ... > > Roman From johna at johnaherne.co.uk Thu Apr 20 20:49:01 2006 From: johna at johnaherne.co.uk (John Aherne) Date: Thu, 20 Apr 2006 19:49:01 +0100 Subject: [PythonCE] wxpython for ce In-Reply-To: <4005376.post@talk.nabble.com> References: <44472C27.5040307@johnaherne.co.uk> <4005376.post@talk.nabble.com> Message-ID: <4447D79D.1050306@johnaherne.co.uk> <> Thanks for the update. Makes me happy that it's being looked at. I'll wait and see. Regards John Aherne From spambox at kruszewski.name Wed Apr 26 19:16:52 2006 From: spambox at kruszewski.name (Adam Kruszewski) Date: Wed, 26 Apr 2006 19:16:52 +0200 Subject: [PythonCE] Calldll.pydfor newer python? Message-ID: <444FAB04.5060306@kruszewski.name> Hi, I wonder if someone with pythonce 2.4.3 build tree could compile calldll.c for it and upload the resulting .pyd file to the yahoo group? (or just email it to me) Personally I don't have microsoft windows on my desktop so it is quite difficult for me to build it by myself. Thanks in advance, a. From eyecreate at gmail.com Thu Apr 27 15:41:41 2006 From: eyecreate at gmail.com (The Head Guy) Date: Thu, 27 Apr 2006 09:41:41 -0400 Subject: [PythonCE] PythonCE IDE and Form Designer in Development Message-ID: <8f654c1e0604270641t5508a737uc15b643b79e46392@mail.gmail.com> I am in the middle of creating a IDE and Form Designer to run on Windows CE. It is about 75% finished. Is there any interest in me releasing it?(unlike IDLE, it is not written in Python, but .NET CF v2.0) If there is more than just a few wanting it, I may even make it open source. It should output tkinter code. I am working on making the form designer more user friendly right now. Anyone else interested or have questions? Should I just get to it and make a sourceforge page for it, or do you think it would be better put elsewhere? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20060427/bc6bcef3/attachment.html From klek at hotmail.ru Thu Apr 27 18:06:03 2006 From: klek at hotmail.ru (Eugene Klepikov) Date: Thu, 27 Apr 2006 20:06:03 +0400 Subject: [PythonCE] PythonCE IDE and Form Designer in Development In-Reply-To: <8f654c1e0604270641t5508a737uc15b643b79e46392@mail.gmail.com> References: <8f654c1e0604270641t5508a737uc15b643b79e46392@mail.gmail.com> Message-ID: <200604272006.03769.klek@hotmail.ru> On Thursday 27 April 2006 17:41, The Head Guy wrote: > I am in the middle of creating a IDE and Form Designer to run on Windows > CE. It is about 75% finished. Is there any interest in me releasing > it?(unlike IDLE, it is not written in Python, but .NET CF v2.0) If there is > more than just a few wanting it, I may even make it open source. It should > output tkinter code. I am working on making the form designer more user > friendly right now. Anyone else interested or have questions? Should I just > get to it and make a sourceforge page for it, or do you think it would be > better put elsewhere? Very, very interesting. Sourceforge nice place. > > __________ > http://www.newhost.ru - ?????? ??? ??? ?????? ?????! -- Best regards, Eugene Klepikov, Web Administrator, IT Departament, RusSlavBank. From eyecreate at gmail.com Thu Apr 27 21:42:36 2006 From: eyecreate at gmail.com (The Head Guy) Date: Thu, 27 Apr 2006 15:42:36 -0400 Subject: [PythonCE] Status on IDE Message-ID: <8f654c1e0604271242v5ba554cdv92cbc8e66acc0cac@mail.gmail.com> It seems there is enough people out there that want this that I will release it open source.(on sourceforge of course) I, too, hope there will be enough people wanting this that I will not be the only one making updates. Projects like these are better when people collaborate. I am in the process of finishing/releasing the first beta. I will not release the source, though, until I clean it up. (I am a very messy coder.) Remember to give feedback! ;) RevolvEvolutioN -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonce/attachments/20060427/91dd0581/attachment.html From fuzzyman at voidspace.org.uk Thu Apr 27 21:31:01 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Thu, 27 Apr 2006 20:31:01 +0100 Subject: [PythonCE] PythonCE IDE and Form Designer in Development In-Reply-To: <200604272006.03769.klek@hotmail.ru> References: <8f654c1e0604270641t5508a737uc15b643b79e46392@mail.gmail.com> <200604272006.03769.klek@hotmail.ru> Message-ID: <44511BF5.7080806@voidspace.org.uk> Eugene Klepikov wrote: > On Thursday 27 April 2006 17:41, The Head Guy wrote: > >> I am in the middle of creating a IDE and Form Designer to run on Windows >> CE. It is about 75% finished. Is there any interest in me releasing >> it?(unlike IDLE, it is not written in Python, but .NET CF v2.0) If there is >> more than just a few wanting it, I may even make it open source. It should >> output tkinter code. I am working on making the form designer more user >> friendly right now. Anyone else interested or have questions? Should I just >> get to it and make a sourceforge page for it, or do you think it would be >> better put elsewhere? >> I'm definitely interested. :-) Fuzzyman http://www.voidspace.org.uk/python/shareware.shtml > Very, very interesting. Sourceforge nice place. > > >> __________ >> http://www.newhost.ru - ?????? ??? ??? ?????? ?????! >> > > From pkramer at meton.net Fri Apr 28 09:30:19 2006 From: pkramer at meton.net (Patrick Kramer) Date: Fri, 28 Apr 2006 03:30:19 -0400 (EDT) Subject: [PythonCE] Tkinter PhotoImage, no such file or directory Message-ID: <60236.68.113.0.156.1146209419.squirrel@www.meton.net> I have two files which are both in the PyGlucoCE directory off of root. Tkintertest.py BtnGluco.gif Here is my code: import sys sys.path.append('\\Program Files\\Python24\\python24.zip\\lib-tk') sys.path.append('\\PyGlucoCE') from Tkinter import * root = Tk() ImgGlucose = PhotoImage(file = 'BtnGluco.gif') print ImgGlucose.height() b = Button(root, image=ImgGlucose) b.image = ImgGlucose b.pack() root.mainloop() Now I get this error: _tkinter.TclError: couldn't open "BtnGluco.gif": no such file or directory The weird part is I get the same error within Pydev, but if I run the script straight through commandline, it works and shows the image as a button. My guess is I screwed up the path append, but it looks correct to me :/ From coder_infidel at hotmail.com Fri Apr 28 12:58:12 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Fri, 28 Apr 2006 18:58:12 +0800 Subject: [PythonCE] Tkinter PhotoImage, no such file or directory References: <60236.68.113.0.156.1146209419.squirrel@www.meton.net> Message-ID: ----- Original Message ----- From: "Patrick Kramer" To: Sent: Friday, April 28, 2006 3:30 PM Subject: [PythonCE] Tkinter PhotoImage, no such file or directory >I have two files which are both in the PyGlucoCE directory off of root. > > Tkintertest.py > BtnGluco.gif > > > > Here is my code: > > import sys > > sys.path.append('\\Program Files\\Python24\\python24.zip\\lib-tk') This looks OK. > sys.path.append('\\PyGlucoCE') What is the purpose of the above line? I don't think you are importing any modules from that directory. > from Tkinter import * > > root = Tk() > > ImgGlucose = PhotoImage(file = 'BtnGluco.gif') I think that should be: ImgGlucose = PhotoImage(file = '\\PyGlucoCE\\BtnGluco.gif') On the other hand, I don't know Tkinter so I may be wrong. Does Tkinter search sys.path for image files? > > print ImgGlucose.height() > > b = Button(root, image=ImgGlucose) > b.image = ImgGlucose > b.pack() > > root.mainloop() > > > > Now I get this error: > > _tkinter.TclError: couldn't open "BtnGluco.gif": no such file or directory > > > > > The weird part is I get the same error within Pydev, but if I run the > script straight through commandline, it works and shows the image as a > button. What is Pydev, and which command line are you talking about? Windows CE or Windows XP? Luke > > My guess is I screwed up the path append, but it looks correct to me :/ From fuzzyman at voidspace.org.uk Fri Apr 28 14:35:36 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Fri, 28 Apr 2006 13:35:36 +0100 Subject: [PythonCE] Tkinter PhotoImage, no such file or directory In-Reply-To: <60236.68.113.0.156.1146209419.squirrel@www.meton.net> References: <60236.68.113.0.156.1146209419.squirrel@www.meton.net> Message-ID: <44520C18.6010301@voidspace.org.uk> Patrick Kramer wrote: > I have two files which are both in the PyGlucoCE directory off of root. > > Tkintertest.py > BtnGluco.gif > > > > Here is my code: > > import sys > > sys.path.append('\\Program Files\\Python24\\python24.zip\\lib-tk') > sys.path.append('\\PyGlucoCE') > This appends the PyGluoCE directory to sys.path. > from Tkinter import * > > root = Tk() > > ImgGlucose = PhotoImage(file = 'BtnGluco.gif') > This tells PhotoImage to fetch the file 'BtnGluco.gif' from the current directory. This is your problem I believe. Pass an absolute path here and it should go away. > print ImgGlucose.height() > > b = Button(root, image=ImgGlucose) > b.image = ImgGlucose > b.pack() > > root.mainloop() > > > > Now I get this error: > > _tkinter.TclError: couldn't open "BtnGluco.gif": no such file or directory > > > > > The weird part is I get the same error within Pydev, but if I run the script straight through commandline, it works and shows the image as a button. > > Probably because you run the script from inside that directory on your desktop. PythonCE starts with the current directory somewhere else. > My guess is I screwed up the path append, but it looks correct to me :/ > I'm pretty sure that Tkinter *doesn't* search sys.path for image files. HTH Fuzzyman http://www.voidspace.org.uk/python/index.shtml > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > > From pkramer at meton.net Sat Apr 29 04:28:16 2006 From: pkramer at meton.net (Patrick Kramer) Date: Fri, 28 Apr 2006 22:28:16 -0400 (EDT) Subject: [PythonCE] Tkinter PhotoImage, no such file or directory In-Reply-To: <44520C18.6010301@voidspace.org.uk> References: <60236.68.113.0.156.1146209419.squirrel@www.meton.net> <44520C18.6010301@voidspace.org.uk> Message-ID: <61674.68.113.0.156.1146277696.squirrel@www.meton.net> > Patrick Kramer wrote: >> I have two files which are both in the PyGlucoCE directory off of root. >> >> Tkintertest.py >> BtnGluco.gif >> >> >> >> Here is my code: >> >> import sys >> >> sys.path.append('\\Program Files\\Python24\\python24.zip\\lib-tk') >> sys.path.append('\\PyGlucoCE') >> > > This appends the PyGluoCE directory to sys.path. >> from Tkinter import * >> >> root = Tk() >> >> ImgGlucose = PhotoImage(file = 'BtnGluco.gif') >> > This tells PhotoImage to fetch the file 'BtnGluco.gif' from the current > directory. This is your problem I believe. Pass an absolute path here > and it should go away. > > > >> print ImgGlucose.height() >> >> b = Button(root, image=ImgGlucose) >> b.image = ImgGlucose >> b.pack() >> >> root.mainloop() >> >> >> >> Now I get this error: >> >> _tkinter.TclError: couldn't open "BtnGluco.gif": no such file or directory >> >> >> >> >> The weird part is I get the same error within Pydev, but if I run the script straight through commandline, it works and shows the image as a >> button. >> >> > Probably because you run the script from inside that directory on your > desktop. > > PythonCE starts with the current directory somewhere else. > >> My guess is I screwed up the path append, but it looks correct to me :/ >> > I'm pretty sure that Tkinter *doesn't* search sys.path for image files. > > HTH > > Fuzzyman > http://www.voidspace.org.uk/python/index.shtml That worked, thanks... So is there a way to tell pythonce were the current directory is? Another problem, which I think I read about earlier, is how photoimage screws up how images are displayed on windows CE. Is there a workaround for this, or am I doing something wrong. From coder_infidel at hotmail.com Sat Apr 29 10:19:15 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Sat, 29 Apr 2006 16:19:15 +0800 Subject: [PythonCE] Tkinter PhotoImage, no such file or directory References: <60236.68.113.0.156.1146209419.squirrel@www.meton.net><44520C18.6010301@voidspace.org.uk> <61674.68.113.0.156.1146277696.squirrel@www.meton.net> Message-ID: ----- Original Message ----- From: "Patrick Kramer" To: Sent: Saturday, April 29, 2006 10:28 AM Subject: Re: [PythonCE] Tkinter PhotoImage, no such file or directory > That worked, thanks... So is there a way to tell pythonce were the current > directory is? You can tell Python using os.chdir(), but that will not necessarily have any effect on Tkinter because the operating system has no concept of a "current directory", so it depends on whether the image file is opened in the Python code or the C code. Luke From pkramer at meton.net Sun Apr 30 11:25:53 2006 From: pkramer at meton.net (Patrick Kramer) Date: Sun, 30 Apr 2006 05:25:53 -0400 (EDT) Subject: [PythonCE] Tkinter PhotoImage, no such file or directory In-Reply-To: References: <60236.68.113.0.156.1146209419.squirrel@www.meton.net><44520C18.6010301@voidspace.org.uk> <61674.68.113.0.156.1146277696.squirrel@www.meton.net> Message-ID: <60636.68.113.0.156.1146389153.squirrel@www.meton.net> > > You can tell Python using os.chdir(), but that will not necessarily have any > effect on Tkinter because the operating system has no concept of a "current > directory", so it depends on whether the image file is opened in the Python > code or the C code. > > Luke > So there is no way for python to return the current directory it is in? say something like: dir = return_dir() image_loc = dir + "//BtnGluco.gif" Or: image_loc = dir + "//assets//img//BtnGluco.gif" #This is how I would like to orgnize it From fuzzyman at voidspace.org.uk Sun Apr 30 11:57:33 2006 From: fuzzyman at voidspace.org.uk (Michael Foord) Date: Sun, 30 Apr 2006 10:57:33 +0100 Subject: [PythonCE] Tkinter PhotoImage, no such file or directory In-Reply-To: <60636.68.113.0.156.1146389153.squirrel@www.meton.net> References: <60236.68.113.0.156.1146209419.squirrel@www.meton.net><44520C18.6010301@voidspace.org.uk> <61674.68.113.0.156.1146277696.squirrel@www.meton.net> <60636.68.113.0.156.1146389153.squirrel@www.meton.net> Message-ID: <44548A0D.6010300@voidspace.org.uk> Patrick Kramer wrote: > > >> You can tell Python using os.chdir(), but that will not necessarily have any >> effect on Tkinter because the operating system has no concept of a "current >> directory", so it depends on whether the image file is opened in the Python >> code or the C code. >> >> Luke >> >> > > So there is no way for python to return the current directory it is in? > > say something like: > > dir = return_dir() > > image_loc = dir + "//BtnGluco.gif" > > Or: > > image_loc = dir + "//assets//img//BtnGluco.gif" #This is how I would like to orgnize it > I think the situation is (perhaps Luke can correct me if I'm wrong) : The underlying Windows CE platform has no concept of a current directory. PythonCE *simulates* a current directory on the python level This means that calls that use only Python code will work as normal - except the current directory will always start in a fixed location ('//Temp' I think). Calls to use files from C code will not have access to this information. So you can experiment with the image_loc and see if it works using the current directory or not, but it may not do. To get the current directory you use the normal functions provided by the ``os`` and ``os.path`` module : cur_dir = os.getcwd() print cur_dir os.chdir(""//assets") print os.getcwd() image_path = os.path.join(os.getcwd(), "img//BtnGluco.gif") You can also test whether you are running on windows CE or not with either : sys.platform or sys.getwindowsversion() They should return different things on windows CE and normal windows. That means you can make your code behave appropriately depending on which system it is on. HTH Fuzzyman http://www.voidspace.org.uk/python/shareware.shtml > _______________________________________________ > PythonCE mailing list > PythonCE at python.org > http://mail.python.org/mailman/listinfo/pythonce > > From gmc at serveisw3.net Sun Apr 30 11:40:11 2006 From: gmc at serveisw3.net (=?ISO-8859-1?Q?Gonzalo_Monz=F3n?=) Date: Sun, 30 Apr 2006 11:40:11 +0200 Subject: [PythonCE] Tkinter PhotoImage, no such file or directory In-Reply-To: <60636.68.113.0.156.1146389153.squirrel@www.meton.net> References: <60236.68.113.0.156.1146209419.squirrel@www.meton.net><44520C18.6010301@voidspace.org.uk> <61674.68.113.0.156.1146277696.squirrel@www.meton.net> <60636.68.113.0.156.1146389153.squirrel@www.meton.net> Message-ID: <445485FB.9080408@serveisw3.net> Patrick Kramer escribi?: > > > >>You can tell Python using os.chdir(), but that will not necessarily have any >>effect on Tkinter because the operating system has no concept of a "current >>directory", so it depends on whether the image file is opened in the Python >>code or the C code. >> >>Luke >> >> >> > >So there is no way for python to return the current directory it is in? > >say something like: > >dir = return_dir() > >image_loc = dir + "//BtnGluco.gif" > >Or: > >image_loc = dir + "//assets//img//BtnGluco.gif" #This is how I would like to orgnize it >_______________________________________________ >PythonCE mailing list >PythonCE at python.org >http://mail.python.org/mailman/listinfo/pythonce > > > Hi, I use this: if (OS == "ce"): path = sys.path[0] else: path = os.curdir It works right for me. Gonzalo Monz?n. From coder_infidel at hotmail.com Sun Apr 30 18:20:44 2006 From: coder_infidel at hotmail.com (Luke Dunstan) Date: Mon, 1 May 2006 00:20:44 +0800 Subject: [PythonCE] Tkinter PhotoImage, no such file or directory References: <60236.68.113.0.156.1146209419.squirrel@www.meton.net><44520C18.6010301@voidspace.org.uk> <61674.68.113.0.156.1146277696.squirrel@www.meton.net> <60636.68.113.0.156.1146389153.squirrel@www.meton.net> <44548A0D.6010300@voidspace.org.uk> Message-ID: ----- Original Message ----- From: "Michael Foord" To: "Patrick Kramer" Cc: Sent: Sunday, April 30, 2006 5:57 PM Subject: Re: [PythonCE] Tkinter PhotoImage, no such file or directory > Patrick Kramer wrote: >> >> >>> You can tell Python using os.chdir(), but that will not necessarily have >>> any >>> effect on Tkinter because the operating system has no concept of a >>> "current >>> directory", so it depends on whether the image file is opened in the >>> Python >>> code or the C code. >>> >>> Luke >>> >>> >> >> So there is no way for python to return the current directory it is in? >> >> say something like: >> >> dir = return_dir() >> >> image_loc = dir + "//BtnGluco.gif" >> >> Or: >> >> image_loc = dir + "//assets//img//BtnGluco.gif" #This is how I would like >> to orgnize it >> > I think the situation is (perhaps Luke can correct me if I'm wrong) : > > The underlying Windows CE platform has no concept of a current directory. > PythonCE *simulates* a current directory on the python level Correct. > This means that calls that use only Python code will work as normal - > except the current directory will always start in a fixed location > ('//Temp' I think). That is true at the moment, but in the next release I will change it so that if you run a script using the command line then the current directory will initially be set to the directory containing the script, for convenience. > Calls to use files from C code will not have access to this information. > So you can experiment with the image_loc and see if it works using the > current directory or not, but it may not do. > > To get the current directory you use the normal functions provided by > the ``os`` and ``os.path`` module : > > cur_dir = os.getcwd() > print cur_dir > os.chdir(""//assets") > print os.getcwd() Correct, except that the path separator is \ (or \\ in a string literal) not //. > image_path = os.path.join(os.getcwd(), "img//BtnGluco.gif") or continuing with that pattern: image_path = os.path.join(os.getcwd(), "img", "BtnGluco.gif") > You can also test whether you are running on windows CE or not with either > : > > sys.platform or sys.getwindowsversion() > > They should return different things on windows CE and normal windows. > That means you can make your code behave appropriately depending on > which system it is on. > > HTH > > Fuzzyman > http://www.voidspace.org.uk/python/shareware.shtml That will work, but like Gonzalo I prefer using os.name. Luke