Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #62984
| References | <CAN5p5FV7=RKK0cmE_=n+te07CEt678OX1Wwj+96T9eAuDujpfA@mail.gmail.com> <CAPM-O+wAZFmde2bVhqqs4==a-jy3AXfv3f9JNQwcNmTJHCak+Q@mail.gmail.com> |
|---|---|
| From | Rustom Mody <rustompmody@gmail.com> |
| Date | 2014-01-02 22:35 +0530 |
| Subject | Re: About some problem |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4793.1388682356.18130.python-list@python.org> (permalink) |
On Thu, Jan 2, 2014 at 10:23 PM, Joel Goldstick <joel.goldstick@gmail.com> wrote: > > > > On Thu, Jan 2, 2014 at 11:31 AM, raj kumar <rajkumar84730@gmail.com> wrote: >> >> Hello, I am beginner to python and i am writing following code >> >> from pytesser import * >> >> and i am getting an error as follow >> >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> File "C:\Python33\lib\site-packages\pytesser.py", line 61 >> print text >> ^ >> SyntaxError: invalid syntax >> >> >> How to resolve it ? Give me all steps to resolve it. >> >> -- >> https://mail.python.org/mailman/listinfo/python-list >> > First, you should give version and os when you ask a question. However it > is clear you are using python 3.3 and Windows. > > Your print statement implies that pytesser.py is written in the 2.x dialect > of python. In version 3.x print became a function and requires parenthesis > around the arguments. > > So, you need to find a version of pytesser.py that is compatible with python > 3, or if you can't do that, and you need pytesser.py, you have to install > python 2.7 > > Also, this is usually a bad idea: > > from pytesser import * > > Probably better not to muddle the namespace with a chance of naming > collisions and do: > > import pytesser > > > Good luck. Come back after you've had a go with those ideas i'm not sure about this but isnt it normally the case that different version modules dont get mixed up like that? IOW if pytesser was a properly packaged 2.7 module would python 3 be able to get at it ??
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: About some problem Rustom Mody <rustompmody@gmail.com> - 2014-01-02 22:35 +0530
csiph-web