Re: [Tutor] bug or feature

2007-06-01 Thread Andreas Kostyrka
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Just the way IDLE works. Unexpected, but certainly not a bug, I'd say.

Andreas

Grant Hagstrom wrote:
> A bug or feature in the IDLE of python 2.5?
> 
> pre-step: save the following file to your computer:
> # file mylist.py
> jobs = [
> 'Lions',
> 'SysTest',
> 'trainDD',
> 'Cats',
> 'train',
> 'sharks',
> 'whale',
> ]
> 
> Step 1.
> 
> copy, paste this script into the idle window. hit f5 to run.
> 
> thefile = open(" mylist.py")
> read_thefile = file.read(thefile)
> 
> string_thefile = str(read_thefile)
> 
> splitlist_thefile = string_thefile.split()
> 
> it_starts = splitlist_thefile.index('jobs')
> 
> Step 2.
> 
> open a new window. close the window from step one. close the shell from
> the previous f5 execution.
> 
> Step 3.
> 
> paste and run this code.
> 
> thefile = open("/home/banter/Desktop/mylist.py")
> read_thefile = file.read(thefile)
> 
> #string_thefile = str(read_thefile)
> 
> splitlist_thefile = string_thefile.split()
> 
> it_starts = splitlist_thefile.index('jobs')
> 
> Result: python remembers "string_thefile" even after both the shell and
> the original scripting window have been closed!
> bug or feature?
> 
> Best,
> 
> Grant
> 
> 
> 
> 
> ___
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGX+PnHJdudm4KnO0RAsdhAKCBUU9HxXqHPZXo0BXqDEtQ+kBc1wCfS/kc
Tk1icM3HgifChP7wxKShM2k=
=fig0
-END PGP SIGNATURE-
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] bug or feature

2007-06-01 Thread Grant Hagstrom

A bug or feature in the IDLE of python 2.5?

pre-step: save the following file to your computer:
# file mylist.py
jobs = [
   'Lions',
   'SysTest',
   'trainDD',
   'Cats',
   'train',
   'sharks',
   'whale',
   ]

Step 1.

copy, paste this script into the idle window. hit f5 to run.

thefile = open("mylist.py")
read_thefile = file.read(thefile)

string_thefile = str(read_thefile)

splitlist_thefile = string_thefile.split()

it_starts = splitlist_thefile.index('jobs')

Step 2.

open a new window. close the window from step one. close the shell from the
previous f5 execution.

Step 3.

paste and run this code.

thefile = open("/home/banter/Desktop/mylist.py")
read_thefile = file.read(thefile)

#string_thefile = str(read_thefile)

splitlist_thefile = string_thefile.split()

it_starts = splitlist_thefile.index('jobs')

Result: python remembers "string_thefile" even after both the shell and the
original scripting window have been closed!
bug or feature?

Best,

Grant
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor