syntax error

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
LVL 7
ayha1999Asked:
Who is Participating?
 
gelonidaConnect With a Mentor Commented:
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
 
ozoCommented:
I don't get that error, but what is torus.stl?
0
 
ayha1999Author Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
gelonidaCommented:
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
 
ayha1999Author Commented:
Please see the error.

Is there any way to run it as web page?

Thanks
Capture.PNG
0
 
gelonidaCommented:
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
 
ayha1999Author Commented:
still error. pls see the image.  How can I run it as webpage or convert to the code to c#?
Capture2.PNG
0
 
ayha1999Author Commented:
can you tell how executed the file?
0
 
ayha1999Author Commented:
Thanks
0
All Courses

From novice to tech pro — start learning today.