I get import error for _socket. Why?
If you are using PockePC? Python for PPC downloaded from murkworks ftp, check the timestamp of pythonce22.dll in \windows directory (default instllation). Update the pnthon22.dll if it's older than 2002-5-22.
Can I install PythonCE in CF (CompactFlash?) card?
PythonCE for HPC has no problem with that. Basically it is same for PPC version.
Create a directory (Python22) in CF card. Copy all .exe .dll .pyd there. Copy Lib and other directory in it. Rename the Python (Python directory, PocketPCPython.exe, and .dll in you main memory for testing. Try the Python in CF card.
If "import site failed" error occurs, copy site.py or site.pyc from Lib directory to Python22 directory.
If it doesn't go, you may want to try site.py I have uploaded to StartingPython page.
http://www.murkworks.com/Research/Python/PythonCE/PythonCEWiki/uploads/site.py.mbcs_and_getcwd
To associate .py and .pyc to newly located Python, use PocketTweak? or SmallTweak?.
HPC: http://tillanosoft.com/ce/stweak.html , PPC: http://tillanosoft.com/ce/ptweak.html
Tell me if you experience problems.
Why "import somemodule" fails?
The error message should tell you what is wrong.
Maybe you typed wrong name. Python is Case Sensitive. Check the module (script) name.
Check your sys.path setting.
>>> import sys
>>> sys.path
If your module is not in the direcotry list of sys.path, you can append the module's directory to sys.path
>>> sys.path.append(r'\yourDirectory\subdirectroy')
You may move your module into sys.path directroy
Maybe the module ( or scrript ) has some errors.
That module could be missing.
Did you delete something?
PythonCE you are using may not support that module. Contact us via PythonCEMailintList?.
If you tried something like this
>>> import "\\prgram files\\someModule.py"
It does not work. Rather, use execfile( )
>>> execfile("\\prgram files\\someModule.py")
If the module is inside subdirectory (eg. "Myscript") of the directory that is included in sys.path list, you may create blank __init__.py in that direcotry, then import with :
eg. \storage card\Python22\lib\Myscript\scripton1.py
sys.path includes "\\storage card\\Python22\\lib
>>> import Myscript.scripton1
How can I associate .py and .pyc with Python?
Using SmallTweak?, Pocket Tweak (or similar utility) is the easy and safe way to do.
HPC: http://tillanosoft.com/ce/stweak.html , PPC: http://tillanosoft.com/ce/ptweak.html
You will find instruction for how to set file types in above download pages.
Note: in some cases, these utility may fail to change registry. If they don't work for you, try regedit from MS, or Tascal regedit, or other registry editor. Take a fullbackup befkore to start, just in case...
Sample Registry entry:
For HKCR/.pyThe last line would appear in the registry editor like this:REGEDIT4
[HKEY_CLASSES_ROOT\.py] @="pyfile"
For HKCR/pyfile
REGEDIT4
[HKEY_CLASSES_ROOT\pyfile] @="pyfile"
[HKEY_CLASSES_ROOT\pyfile\DefaultIcon] @="\\MemCard2\\Python22\\PythonCE22.exe,0"
[HKEY_CLASSES_ROOT\pyfile\Shell]
[HKEY_CLASSES_ROOT\pyfile\Shell\Open]
[HKEY_CLASSES_ROOT\pyfile\Shell\Open\Command] @="\"\\MemCard2\\Python22\\PythonCE22.exe\" \"%1 %2 %3 %4 %5 %6 %7 %8 %9\""
"\MemCard2?\Python22\PythonCE22?.exe" "%1"
Where is the nice and easy GUI kit for PythonCE?
Python for Win9x/NT/2K/XP/XXX has nice and easy GUI stuff, except CE.
It's simply because NOBODY ported them to CE, yet.
And to port them, you have to know about Win32 API, the difference between other win32 and winCE, and maybe python internal.
Nice GUI on CE will not come unless someone invests his/her time and/or money.
So if you really want to use nice and easy GUI, please contribute something toward it.
Trying systematically GUI elements written for win32 could be a good starting point. We will know what is already usable and what we need to work on.
Also, there are numbers of other GUI alternatives I can think of.
You can run Python as a http server (easy things to do), and use PIE or other Browser or UserInterface?. (Similar to Jeff has demonstrated in IPC)
Advantage of this approach is evident. You can use this for local, as well as remote solution. Designing UI is as easy as making a web page.
You should think about security stuff, though. (eg. Don't allow connection from other than 127.0.0.1, etc...)
Similar to Number One, but use Telenet Interface. In DEMO section of Pyrhon distribution for BIG computers, there is a script called PySvr?.
Compared to Number one, it's not really GUI, (other than VTxxx? compatible escape sequences..) but this script may run right now, without any effort. (I didn't have time to test it, yet)
Using GUI components that is already ported to CE. Calling MFC functions or other external DLL functions from Python is relatively easy.
You can use many common dialogs or IE components, too
If you use IE components, writing GUI is pretty much similar to making a web page with forms. (XML, javascript can be used, if you like) If there is a GUI stuff made for PocketScheme? or other software, maybe Python can just make a call to the DLL.
THere? are a few Game Libraries out there, too. Most probably, Python can call their functions. Searching Google with "Game library WindowsCE?" shows lots of things. http://www.google.com/search?num=100&safe=off&q=Game+library+WindowsCE&btnG=Google+%8C%9F%8D%F5&lr=
http://www.pocketpcdn.com/libraries/ (STHtmlDialog? looks interesting)
Someone may start porting tkinter, soon. I don't know his time table, though...
Anyway, if you want easy GUI, please make a effort and share it with us.
When will you make PythonCE2.2+ for SH3/4 and/or CE2.xx, Other platforms?
Maybe within a couple of month, maybe next year.
It all depends on work load of volunteers.
Currently, other than myself (Telion), one person is trying to setup his eVC for SH3/4. And things are rather slow in this area because I'm busy with other issues and I'm not talented in porting.
If someone can take a look at source code, and suggest what to do, or better send patch, I can apply and try to build rather easily.
Generally speaking, we need more people to follow the new releases of Main Python distribution.
Every tiny bit of work takes our time.
porting and/or testing of modules and distributions
maintaining this Wiki (some art works would be nice)
producing and correcting documents
providing hints and scripts
FAQ form is coming soon.(maybe not so soon)
Meanwhile, if you have questions, please use the form below.
(If Add comment does not work, please send E-mail to PythonCEMailingList: mailto:pythonce@python.org )