Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #6895 > unrolled thread
| Started by | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| First post | 2011-06-02 16:30 -0700 |
| Last post | 2011-06-02 16:30 -0700 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Problem porting class to python3.2 Ethan Furman <ethan@stoneleaf.us> - 2011-06-02 16:30 -0700
| From | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| Date | 2011-06-02 16:30 -0700 |
| Subject | Re: Problem porting class to python3.2 |
| Message-ID | <mailman.2408.1307056656.9059.python-list@python.org> |
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 top | Article view | comp.lang.python
csiph-web