IDLE

Russ P. Russ.Paielli at gmail.com
Sun Nov 4 22:01:57 EST 2007


Thanks for the information on IDLE.

> As for your question, I couldn't quite understand what you're trying
> to do. In general, you can have the script use os.chdir() to go to the
> relevant directory and then open() the file, or you can use open()
> directly with a relative/full path to it. (This question isn't IDLE
> specific in any way, unless I misunderstood...)

I should have been clearer about what I'm trying to do. I have
approximately 100 directories, each corresponding to an "incident" (I
won't say what type of "incident" here). Each directory has many data
files on the incident, and the structure of all the directories is the
same (i.e., each has files of the same name). One of those files in an
input file that I wish to "replay" through my program, then the
results are recorded in an output data file.

To replay one incident, I would normally go to the directory for that
case and execute my program. I can specify the input and output files
explicitly, but I virtually never need to do so because they default
to the same file name in each directory. I also have a script that can
replay all 100 cases automatically.

I would like to do the same sort of thing with IDLE. I don't want to
have to specify the input and output files explicitly using absolute
pathnames from outside the directory for the incident. That would be
horrendously cumbersome after a few times.

I want to just cd to a directory and execute my program. But in my
first few tries, it seems that I need to be in the directory that
contains the source code -- not the directory that contains the data.
Am I missing something? Thanks.




More information about the Python-list mailing list