Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39127
| Date | 2013-02-18 12:25 -0800 |
|---|---|
| From | Gary Herron <gary.herron@islandtraining.com> |
| Subject | Re: request for help |
| References | <B7C01624-32AB-49CE-AAB4-064A5B8E54CB@icloud.com> <D78B804B-92F0-48EF-818B-F233B439AF60@vectorfabrics.com> <BEF6F54A-CCFB-4014-B57B-28BD8A82C02E@libero.it> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1970.1361219111.2939.python-list@python.org> (permalink) |
On 02/18/2013 12:14 PM, leonardo wrote: > thanks guys and sorry for my incomplete datas, here is the error message: > > Traceback (most recent call last): > File "<pyshell#0>", line 1, in <module> > import circle > File "circle.py", line 1 > Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) > ^ > SyntaxError: invalid syntax If I read this error message correctly, I don't think the contents of circle.py are at all what you claim. It looks like the first line of circle.py contains the text "Python 2.7.3 ..." which is certainly not what you intended or claimed. Please examine the contents of circle.py very carefully. > > > thanks for any help! > > > > > > > Il giorno 18/feb/2013, alle ore 20:59, Stefan Holdermans <stefan@vectorfabrics.com> ha scritto: > >> Leonardi, >> >>> i saved the above program from python shell into a file as "circle.py" . when i type "import circle" i get error.. >> >> Next time, please mention what kind of error you're getting. >> >> Was it an indentation error? Because, as you pasted it, your code would lead to one. >> >> If I fix the indentation, as in >> >> import math >> >> def area(radius): >> return math.pi * radius**2 >> >> def circumference(radius): >> return 2 * math.pi * radius >> >> it works fine for me. >> >> HTH, >> >> Stefan >> -- >> http://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: request for help Gary Herron <gary.herron@islandtraining.com> - 2013-02-18 12:25 -0800
csiph-web