Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: Python doesnt seem to work on my PC >:/
|
Posted: Oct 7, 2004 5:11 PM
|
|
> aaah thanks :) silly python...
You mean silly Windows. This is not behavior of Python, it is the behavior of Windows. The same will happen with any script or console application, whether it is Python, Perl, Ruby, or a batch file, etc. If you are doing console stuff in Python (which is probably the case, if you are learning it), it will probably be easier if you work from a "Command Prompt" window that is open all the time for running scripts and seeing their output. Of course, as suggested above IDLE is great for interactive learning. There is also PythonWin which also has an editor; that comes with the Python Win32 extensions (which you'll need if you plan on doing serious Windows-specific work).
> ... I can't figure out how to include other modules > which are in subdirectories... > > On Unix... > > So how should I tell my program where to find modules > in subdirectories that will work in both Linux and Windows
You can set this up to work in both environments. Why don't you post what you already have and we'll figure out why it isn't doing what you want on windows. I haven't tested this, but I'd try something like this:
sys.path += [os.path.abspath(p) for p in os.listdir(os.curdir)] If I wanted to get every sub-directory one level deep into the python path. If you want to go deeper, then use os.walk()...
|
|