[Idle-dev] non-intuitive file trouble, paths, edit-menu

Guido van Rossum guido@python.org
Mon, 08 May 2000 08:54:41 -0400


> non-intuitive file trouble...
> 
> I am relatively new to Python and Idle, so i might well have missed some 
> point...

Thanks for your feedback!  Which IDLE version did you use?  IDLE 0.6
(which comes with Python 1.6a2) is the latest and may solve some of
your problems.

> Trouble: I write a simple program that reads from a file in the same 
> directory as the source file. When I execute the program (win98) by ctrl-f5 
> the program does not find the file.
> 
> 1) Wouldn't it be natural if the the own directoy, was included as the first 
> item in the search path (I suppose this is an issue of paths).

Without seeing your program it's unclear what the problem was.  Note
that the search path is only used for importing modules, not for
opening files.  Maybe you want the current directory to be the
directory containing the program?  There are various ways around this,
e.g. os.chdir(), or look into sys.argv[0] or __file__.

> 2) I think, generally, that the issue of paths is the most non-intuitive 
> part of a beginners life, learning f ex Python. A worse example: I remember 
> installing jPython on Linux, I would have forgotten how to fix all the 
> different paths, if I hadn't written a doc with screendumps and all:-)

Agreed.

>    I think paths are much less close to normal everyday human logic and 
> thougth, than classes and lists and strings.

Hm, maybe you're right.  It's certainly a recurring theme in the
lamentations of newbies trying to use Python that the various paths
are never right, and it requires wizard knowledge to fix them.

>    Maybe this is an issue for the OS, but I'd love an intuitive Python on 
> top af any OS, giving me full power to interact with my files, data and 
> "capacities".
>    Conclusiuon: I think the human thougth, f ex as represented by normal 
> human language structures, shoud be the design norm of computer systems. 
> Python is a wonderful step in this nice direction.
> 
> 3) Qestion: sometimes I want to try out a program or collection of classes 
> and functions by importing it into the interactive mode, can I easily 
> reimport after editing the program/module.

For now, reload() is your friend.  We're going to change the way IDLE
runs programs to use a separate process -- this should make a lot of
things easier.  But we're not done makinh this change yet.

> 4) I really like the close interaction - "talk to python" of the interactive 
> mode, and would really like some "seamless" integration of interactiv mode 
> and scripting/prototyping.

I like the TeachScheme/DrScheme model: you see two panels; the top
panel contains a module/program and the bottom panel contains the
interaction.  When you execute the code in the top panel, the bottom
panel gets reinitialized; after that you can execute interactive
commands in the bottom panel, playing with the results of the
execution of the top panel code.

> 4b) My nine-year old daughter said "this is fun", when we were playing with 
> strings and lists in interactive mode.

Cool!

> additional IDLE comment: all too many items in the "edit"-menu.

I'm well aware of that :-(

--Guido van Rossum (home page: http://www.python.org/~guido/)