Solved

syntax error

Posted on 2013-01-23
9
385 Views
Last Modified: 2013-01-26
How can I solve the syntax error in the follwoing python code?

error line : 58
invalid file name

please help.

Thanks

ayha
mesure-volume.py
0
Comment
Question by:ayha1999
  • 5
  • 3
9 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 38813321
I don't get that error, but what is torus.stl?
0
 
LVL 7

Author Comment

by:ayha1999
ID: 38813330
I tried to run it with Run -> Run Module in IDLE and got the mentioned error. Im new to python. How can I run it properly and provide torus.stl file it is asking for?

Thanks
0
 
LVL 16

Expert Comment

by:gelonida
ID: 38813368
you rpython script requires parameters.

One way to run it is to drag ond drop the stl file on the python script.
This works at least under windows

ANother way os to open a shell window (terminal / cmd)
and call the script by hand,

python measure-volume.py path_to_your_st_file.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 7

Author Comment

by:ayha1999
ID: 38813397
Please see the error.

Is there any way to run it as web page?

Thanks
Capture.PNG
0
 
LVL 16

Expert Comment

by:gelonida
ID: 38813423
you did not run the script  from a console, but from a console, where you started python already.


The 'old-fashioned' complicated way to test a python script is from the cmd-shell
Just

press WIndows-r
type then 'c' 'm' 'd' and enter

or start cmd.exe from the start menu (it's somewhere in Programmes / Accessories)


Now in the cmd window go to the directory where you have your python Program


Let's imagine, that your Python program is in C:\mycode
then you would type following lines

C:
cd \mycode
measure-volume.py path_to_your_st_file.

if this doesn't work
python measure-volume.py path_to_your_st_file

if this doesn't work

C:\Python33\python measure-volume.py path_to_your_st_file
0
 
LVL 7

Author Comment

by:ayha1999
ID: 38813479
still error. pls see the image.  How can I run it as webpage or convert to the code to c#?
Capture2.PNG
0
 
LVL 7

Author Comment

by:ayha1999
ID: 38813626
can you tell how executed the file?
0
 
LVL 16

Accepted Solution

by:
gelonida earned 250 total points
ID: 38813820
You seem to have multiple versions of python installed.

It's probably best to stick with one of them:

The first screenshot was done with python3.3

now you try to run Ironpython
I don't have any experrience with the particularities of ironpython, but if you really wanted to run the script with it, then you had to type:

C:\Programfiles\....\IP64.exe c:\measure_volume.py

I would however recommend to run it with CPython 2.7 or 3.3 which are normally (if you didn't choose a custom location) in

Python 2.7 is located in
C:\Python27\python.exe

I don't have python 3.3 but probably it will be located in
C:\Python33\python.exe
0
 
LVL 7

Author Closing Comment

by:ayha1999
ID: 38823439
Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question