Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6895

Re: Problem porting class to python3.2

Date 2011-06-02 16:30 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: Problem porting class to python3.2
References <web-74580125@email.noao.edu> <web-74583517@email.noao.edu>
Newsgroups comp.lang.python
Message-ID <mailman.2408.1307056656.9059.python-list@python.org> (permalink)

Show all headers | View raw


Nick Buchholz wrote:
> First thanks to all who replied. FYI the classes in the file have been working in various 
> environments since I wrote them in python1.3 and updated them to python 2.x in 2005.
> 
> I think I solved the problem, well not solved in that I don't know why the technique I used failed.
> but at least the code works when used as an import.
> 
> Under my 2.5 system I had a startup file that included the line
> ld = execfile
> 
> mostly because I got tired of typing execfile('filename') to load in a file I was testing
> 
> 2to3 complained it couldn't parse this line so I changed to
> 
> def ld(filename):
>     exec(compile(open(file).read(), file, 'exec'))
> 
> when I tried 
> ld('starDate.py') at the python3.2 prompt I got the indicated errors

Don't know if this helps at all, but when I tried your ld command (after 
changing 'file' to 'filename' ;) it worked just fine.

~Ethan~

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Problem porting class to python3.2 Ethan Furman <ethan@stoneleaf.us> - 2011-06-02 16:30 -0700

csiph-web