?
Solved

syntax error

Posted on 2013-01-23
9
Medium Priority
?
394 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
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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 …
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 …

765 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