Solved

syntax error

Posted on 2013-01-23
9
380 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
 
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now