# No subject

**URL:** <https://forum.gidsimulation.com/t/no-subject/291>\
**Category:** 2013 - 2005\
**Created:** [July 18, 2013, 8:23am UTC](https://forum.gidsimulation.com/t/no-subject/291 "2013-07-18T08:23:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forum.gidsimulation.com/uploads/default/original/2X/8/80b4e62dc7e7e652d9d29df9e6fc3e58b2b821ac.png) [@system](https://forum.gidsimulation.com/u/system)\
**Post date:** [July 18, 2013, 8:23am UTC](https://forum.gidsimulation.com/t/no-subject/291/1 "2013-07-18T08:23:52Z")

</div>

‘forward slash’ and this the good way because it is cross-platform,

but this is because Python handle it internally. In case of use  
os.sytem(command) you are lefting Python an the ‘command’ is interpreted by  
the operating system, not by Python,

then this ‘command’ is not cross-platform and you can only use valid shell  
commands and with its valid syntax: appropriated slash separator, Linux is  
case sensitive for filenames, etc.  
  
  
  
In my Python test for example this start GiD:

Import os

os.system(“"C:\Program Files\GiD\GiD 11.1.5d\gid.exe"”)  
  
  
  
but this not:

os.system(“"C:/Program Files/GiD/GiD 11.1.5d/gid.exe"”)

it raise your related error about ‘Error setting environment variables’  
  
  
  
About working in folders without spaces, I recommend you as developer to  
work in a folder with spaces (and also with NON-latin names like Japanese  
characters) to know and fix all problems and create a more robust code.

GiD itself can work without problem if the folder has spaces (by default it  
is installed on Windows in ‘Program files’ that has an space).  
  
  
  
Enrique  
  
  
  
De: [gidlist-bounces at listas.cimne.upc.edu](http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist)  
[mailto:[gidlist-bounces at listas.cimne.upc.edu](http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist)] En nombre de Simon Bance  
Enviado el: martes, 6 de agosto de 2013 16:13  
Para: [gidlist at listas.cimne.upc.edu](http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist)  
Asunto: [GiDlist] SOLVED: GiD 11.0.4 cannot set environment variables in  
batch mode (Win7x64) (Enrique Escolano)  
  
  
  
Dear Enrique,  
Thank you very much for your thoughtful response. I think I have fixed the  
problem with your help but I would like to discuss it further in order to  
help other people who may have similar problems in the future. I disagree  
with some of the things you said.

GiD for Windows doesn?t require any environment variable.  
  
  
OK thanks… I’m glad I no longer have to worry about that.

The error is that you are trying to use as folder separator the character  
?/? , but this is for Linux!! for Windows this character must be ??  
  
  
You are correct that the forward slash is used by Linux and the backward  
slash by Windows but actually Windows has no trouble interpreting both  
correctly!  
I always use the forward slash in such scripts because it means my scripts  
will also work cross-platform including on my Linux machines.  
If you don’t believe me, try replacing some of your backslashes with forward  
slashes on the Windows command line! 🙂  
Also, having to use the backslash when defining paths in Python would be  
hassle because, like you said, every single one must be escaped using a  
double slash and could not be simply copied from Windows Explorer, for  
example.

note that gid.exe is enclosed with quotes, required in case its path has  
spaces
