IDLE & Gadfly frustration

Greg Jorgensen gregj at pobox.com
Thu Feb 1 10:07:17 CET 2001


The directory you give to gadfly must exist. You can create a new
directory like this:

  import os
  os.mkdir(r"c:\mydirectory")

The r"..." string literal is a raw string; this prevents Python from
interpreting the backslashes as escapes. You can also do this:

  os.mkdir("c:\\mydirectory")

To create a new database from gadfly, after you have created the folder:

  from gadfly import gadfly
  cx = gadfly()
  cx.startup("databasename", r"c:\mydirectory")

  etc.

Hope this helps.

--
Greg Jorgensen
Portland, Oregon, USA
gregj at pobox.com



In article <95b5gk$2gi$1 at nnrp1.deja.com>,
  gbell at uclink.berkeley.edu wrote:
> 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