2 followers Follow

Setting a workspace for python scripting

I am new to using python in PCI, but am wondering is there a command to set the script work space, like you can when using python in Arcmap, so the entire file paths do not need to be copied when setting up variables?


margie massier

Official comment


Hi Margie,

In Geomatica there is no concept of a workspace, like in ArcPy. However, there are several ways of doing something similar in python:
1) You can change the current working directory using os.chdir() -
2) You can set a variable that represents the working directory, and then use this to create other variables that represent files using os.path.join -
for example:
root_dir = 'path/to/root'
my_file = os.path.join(root_dir, 'mytestfile.pix')

You may wish to take a look at the online python documentation ( to learn about the os module, and some of the other python standard library modules, as these are very useful. One of the best features of python is its community. There are many great resources available on the web. For example, here is a good quick tutorial on the python standard library-

Hope this helps,


PCI Geomatics
Comment actions Permalink

Please sign in to leave a comment.

1 comment