In terms of platform-specific functionality
PythonCE is of course most similar to Windows NT/2000/XP, but due to the many differences between Windows CE and other operating systems (including other versions of Windows),
PythonCE has some differences and limitations. Some of these differences are fundamental while others may be eliminated in future.
If your Python scripts need to detect whether they are running on Windows CE, check whether os.name is
'ce'. The value of sys.platform is 'win32' (as of
PythonCE 2.5) just like desktop versions of Windows, so you can use this fact if you are writing Windows-specific code that works on all versions of Windows.
Basic Operating System Differences
- Windows CE has no drive letters; all file systems are accessed from a single root (like Unix systems)
Python Standard Library
In the
PythonCE 2.4.3 release, the following standard modules are missing:
- bsddb: has not been ported yet
- compiler: not needed so far, but may be added in future
- curses: Pocket PC lacks native console support
- idlelib
- msvcrt: most of the functionality in this module (e.g. console I/O) is inapplicable, so it has not been ported yet
- distutils: has not been ported yet
- popen2 is not functional: Windows CE does not support pipes
- signal: Windows CE has no support for signals
- subprocess: has not been ported yet
- test: this large module is only useful for development of Python itself
Some of the modules that are present lack some functionality:
- os
- os.system(): not implemented yet because Windows CE lacks a C system() function
- os.environ, os.getenv(), os.putenv(), os.unsetenv(): do nothing because Windows CE doesn't support environment variables
- os.popen(), os.pipe(): Windows CE does not support pipes
- os.isatty(): always returns False
- os.open(): files are always opened in binary mode
- os.exec*(), os.spawn*(): not implemented yet
Current Directory Support
The Windows CE operating system does not support the concept of a "current directory", so
PythonCE must emulate this functionality. When
PythonCE is started in interactive mode, the emulated current directory is initially set to "\Temp". When
PythonCE is started with a script filename on the command line, the emulated current directory is set the the directory containing the script. The current directory may be accessed using the usual functions os.getcwd() and os.chdir().
Most Python file I/O functions will use this emulated current directory when passed a relative path, but to ensure that your program behaves exactly as you expect, it is better to use absolute paths as often as possible.
There are no comments on this page. [Add comment]