Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

syntax error

Posted on 2013-01-23
9
Medium Priority
?
403 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 17

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 17

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 17

Accepted Solution

by:
gelonida earned 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

636 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