IDLE & Gadfly frustration

Robert L Hicks bobhicks at adelphia.net
Thu Feb 1 15:45:33 CET 2001


In Python, the forward slash character *can* be used as a separator in file
paths in both *NIX and Windows.

inp = open("C:/myfiles/mydoc.txt","r")


> From: gbell at uclink.berkeley.edu
> Organization: Deja.com
> Newsgroups: comp.lang.python
> Date: Thu, 01 Feb 2001 08:07:50 GMT
> Subject: IDLE & Gadfly frustration
> 
> Two newbie questions:
> 
> 1) I'm trying to write a script which creates, then makes use of, a
> Gadfly database to be stored in my Python20 directory.  When I run the
> script from the (MS-DOS) command line, all is well. When I run the
> script using IDLE, the Gadfly data files are created in my TOOLS/IDLE
> directory.  IDLE seems to have its own ideas about my preferred default
> directory. Is there any way to change this?
> 
> 2) A related frustration:  could someone tell me the proper syntax for
> specifying directory paths in Python (or perhaps I'm asking for the
> proper Gadfly syntax)?  The Gadfly documentation says:
> connection.startup("mydatabase", "mydirectory")
> So far, I've only had luck setting the second variable to "" (perhaps
> because of the problem mentioned in #1).  Should "mydirectory" begin
> with c:?  Use double backward slashes?  forward slashes?
> 
> Many, many thanks.
> 
> Gregory Bell
> gbell at uclink.berkeley.edu
> 
> 
> Sent via Deja.com
> http://www.deja.com/




More information about the Python-list mailing list