5 The gclib Python wrapper assumes the default gclib \link installation \endlink location.
9 * See https://www.python.org/ if Python is not already installed on the system. The gclib Python wrapper supports Python versions 2 and 3.
10 * On Windows, choose to add Python to the environment variable during installation. This allows Python to be invoked from the command line.
12 ## Install the gclib Python module
16 * Type the following commands into a command prompt.
19 C:\Users\username>cd Desktop
20 C:\Users\username\Desktop>mkdir python_temp
21 C:\Users\username\Desktop>cd python_temp
22 C:\Users\username\Desktop\python_temp>copy "c:\Program Files (x86)\Galil\gclib\source\wrappers\python\*" .
23 C:\Users\username\Desktop\python_temp>copy "c:\Program Files (x86)\Galil\gclib\examples\python\*" .
24 C:\Users\username\Desktop\python_temp>python setup.py install
30 copying gclib.py -> build\lib
32 copying build\lib\gclib.py -> C:\Python34\Lib\site-packages
33 byte-compiling C:\Python34\Lib\site-packages\gclib.py to gclib.cpython-34.pyc
34 running install_egg_info
35 Writing C:\Python34\Lib\site-packages\gclib-1.0-py3.4.egg-info
38 * The gclib Python wrapper is now installed. Go to the next section, **Using gclib from the Python Interpreter**.
43 * Type the following commands into a Terminal prompt.
48 $ tar -xvf /usr/share/doc/gclib/src/gclib_python.tar.gz
51 $ tar -xvf /usr/share/doc/gclib/src/gclib_python_examples.tar.gz
53 $ sudo python setup.py install
54 [sudo] password for user:
60 copying gclib.py -> build/lib
62 copying build/lib/gclib.py -> /usr/lib/python2.7/site-packages
63 byte-compiling /usr/lib/python2.7/site-packages/gclib.py to gclib.pyc
64 running install_egg_info
65 Writing /usr/lib/python2.7/site-packages/gclib-1.0-py2.7.egg-info
68 * The gclib Python wrapper is now installed. Go to the next section, **Using gclib from the Python Interpreter**.
73 * Be sure that the *Create Environment Variable* step has been followed in the \link osx OS X\endlink installation instructions.
74 * Type the following commands into a Terminal prompt.
79 $ tar -xvf /Applications/gclib/source/gclib_python.tar.gz
82 $ tar -xvf /Applications/gclib/examples/gclib_python_examples.tar.gz
84 $ sudo python setup.py install
90 copying gclib.py -> build/lib
92 copying build/lib/gclib.py -> /Library/Python/2.7/site-packages
93 byte-compiling /Library/Python/2.7/site-packages/gclib.py to gclib.pyc
94 running install_egg_info
95 Writing /Library/Python/2.7/site-packages/gclib-1.0-py2.7.egg-info
97 * The gclib Python wrapper is now installed. Go to the next section, **Using gclib from the Python Interpreter**.
100 ## Using gclib from the Python Interpreter
102 * Invoke the <a href="https://docs.python.org/2/tutorial/interpreter.html" target="_blank">Python Interpreter</a>.
103 * Type the following into the Python prompt.
109 >>> g.GOpen('192.168.0.42 --direct')
111 192.168.0.42, DMC4080 Rev 1.2c, 783
113 ## Running Python scripts
115 * Navigate the terminal to the location from **Install the gclib Python module** where example.py was copied.
116 * Open *example.py* in a text editor.
117 * Set the address in the g.GOpen() call to match an avaiable connection.
118 * Execute the following command at the Terminal.
122 gclib version: py.127.110.250
123 192.168.0.42, DMC4080 Rev 1.2c, 783
125 * Experiment with the example by uncommenting sections, between the triple quotes, '''.
129 gclib version: py.127.110.250
130 192.168.0.42, DMC4080 Rev 1.2c, 783
131 GProgramDownload() correctly errored. Can't fit with level 3 compression
133 #A;i=0;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1
134 i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;i=i+1;EN
135 Downloaded program verified
136 Array element verified
146 Help on method GOpen in module gclib:
148 GOpen(address) method of gclib.py instance
149 Opens a connection a galil controller.
150 See the gclib docs for address string formatting.
151 See Link GOpen() <http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h_aef4aec8a85630eed029b7a46aea7db54.html#aef4aec8a85630eed029b7a46aea7db54>
154 Help on method GCommand in module gclib:
156 GCommand(command) method of gclib.py instance
157 Performs a command-and-response transaction on the connection.
159 See Link GCommand() <http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h_a5ac031e76efc965affdd73a1bec084a8.html#a5ac031e76efc965affdd73a1bec084a8>
161 >>> 'for a full listing, try help(g)'