run a python script

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
zramdane
Regular
Posts: 56
Joined: Sun Feb 09, 2014 6:40 pm

run a python script

Post by zramdane »

Hello, how to run a file in python code using texgen and to visualise the weaving. Thank you
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: run a python script

Post by louisepb »

Hi,

Just select the Python->Run Script option.

Hope that helps,
Louise
zramdane
Regular
Posts: 56
Joined: Sun Feb 09, 2014 6:40 pm

Re: run a python script

Post by zramdane »

Hello, Thank you very much, I downloaded a python examples, when running I get the message :errors: Traceback (most recent call last):
File "gui", line 1, in <module>
File "D:\3dOrthogonalRefined.py", line 7
<!DOCTYPE html>
Thank you
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: run a python script

Post by louisepb »

Hi,

I don't understand this. Line 7 in 3dOrthogonalRefined.py is a comment line so shouldn't give an error. I don't see why anything should be looking for an html file. Could you clarify how you're running this. You should be selecting the Python menu option in TexGen, choosing the Run Script option and then selecting the Python file.

Best wishes,
Louise
zramdane
Regular
Posts: 56
Joined: Sun Feb 09, 2014 6:40 pm

Re: run a python script

Post by zramdane »

Hello, in texgen menu I run python script, should I have a python language installed?, the file was directly downloaded from the link that you provide me,
Attachments
3dOrthogonalRefined.rar
(13.14 KiB) Downloaded 138 times
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: run a python script

Post by louisepb »

Hi,

I'm not sure how you downloaded the file but you seem to have got the html for the webpage rather than the Python file. The most straightforward thing to do is to use the green 'Clone or Download' button at the top right of the file list on the GitHub page. Select 'Download Zip' and this should give you a zip file containing all the example files. It would be a good idea to look at the contents of the file you're trying to run to make sure that it is what you're expecting and that it is actually Python code.

Best regards,
Louise
Post Reply