Hi Claudio!
I changed my code based on your answer, and before that code I defined:
gamspath= “F:\Otim\correct”
filename= “F:\Otim\correct\ElGrV03.gms”
but it still gives error like this:
Runtime error
Traceback (most recent call last):
File “”, line 47, in
File “C:\Python27\ArcGIS10.2\Lib\subprocess.py”, line 679, in init
errread, errwrite)
File “C:\Python27\ArcGIS10.2\Lib\subprocess.py”, line 896, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Can you help me please? Thank’s!
Em quinta-feira, 28 de abril de 2016 15:12:40 UTC+1, Claudio Delpino escreveu:
Hola SofÃa:
Py error is pretty clear: “NameError: name ‘gamspath’ is not defined”.
In the code you are reusing, probably Lucas defined gamspath as a string holding the path to a folder where the .gms file is to be found and where the output will be placed.
The path in informatics refers to the location in the filesystem. I.e. “C:\mymodel”
Regards
Claudio
On Thu, Apr 28, 2016 at 9:33 AM, Sofia Raimundo wrote:
Hi!
I’m trying to do the same, but what’s the gamspath? When I run your code it gives me an error at this line "output = subprocess.Popen(“gams " + gamspath + “\” + filename + “.gms Lo=2 Lf=”+ gamspath + “\” + filename +“solved.txt” , stdout=subprocess.PIPE, startupinfo=startupinfo)” saying “NameError: name ‘gamspath’ is not defined”. What can I do?
Em domingo, 5 de agosto de 2012 14:40:09 UTC+1, Lucas Ianni escreveu:
Hi
Ive made a specific python program to solve a optimization problem =)
The user enter the problem calling the functions and my program convert it to GAMS logic and save in a .gms format!!!
But I dont want to give the user the work to open the GAMS and click the F9 button hehehe…
To call open my .gms file directly from python its pretty easy but i want to run GAMS ( and and dont know how do this ). For my any suggestion about how to run GAMS externally in windows would help!
there is a way to put commands in shortcut ? like C:\GAMS\win64\23.8\gamside.exe -solve mymode.gams ? Other ideas ?
Thank you!
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.