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.
22 >copy "c:\Program Files (x86)\Galil\gclib\source\wrappers\python\*" .
23 c:\Program Files (x86)\Galil\gclib\source\wrappers\python\gclib.py
24 c:\Program Files (x86)\Galil\gclib\source\wrappers\python\setup.py
26 >copy "c:\Program Files (x86)\Galil\gclib\examples\python\*" .
27 c:\Program Files (x86)\Galil\gclib\examples\python\example.py
29 >python setup.py install
35 copying gclib.py -> build\lib
37 running install_egg_info
38 Removing C:\Users\user\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\gclib-1.0-py3.7.egg-info
39 Writing C:\Users\user\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\gclib-1.0-py3.7.egg-info
42 * The gclib Python wrapper is now installed. Go to the next section, **Using gclib from the Python Interpreter**.
47 * Type the following commands into a terminal prompt.
52 $ tar -xvf /usr/share/doc/gclib/src/gclib_python.tar.gz
55 $ tar -xvf /usr/share/doc/gclib/src/gclib_python_examples.tar.gz
57 $ sudo python setup.py install
58 [sudo] password for user:
64 copying gclib.py -> build/lib
66 copying build/lib/gclib.py -> /usr/lib/python2.7/site-packages
67 byte-compiling /usr/lib/python2.7/site-packages/gclib.py to gclib.pyc
68 running install_egg_info
69 Writing /usr/lib/python2.7/site-packages/gclib-1.0-py2.7.egg-info
72 * The gclib Python wrapper is now installed. Go to the next section, **Using gclib from the Python Interpreter**.
77 * Be sure that the *Create Environment Variable* step has been followed in the \link osx OS X\endlink installation instructions.
78 * Type the following commands into a Terminal prompt.
83 $ tar -xvf /Applications/gclib/source/gclib_python.tar.gz
86 $ tar -xvf /Applications/gclib/examples/gclib_python_examples.tar.gz
88 $ sudo python setup.py install
94 copying gclib.py -> build/lib
96 copying build/lib/gclib.py -> /Library/Python/2.7/site-packages
97 byte-compiling /Library/Python/2.7/site-packages/gclib.py to gclib.pyc
98 running install_egg_info
99 Writing /Library/Python/2.7/site-packages/gclib-1.0-py2.7.egg-info
101 * The gclib Python wrapper is now installed. Go to the next section, **Using gclib from the Python Interpreter**.
104 ## Using gclib from the Python Interpreter
106 * Invoke the <a href="https://docs.python.org/2/tutorial/interpreter.html" target="_blank">Python Interpreter</a>.
107 * Type the following into the Python prompt.
113 >>> g.GOpen('192.168.0.42 --direct')
115 192.168.0.42, DMC4080 Rev 1.2c, 783
117 ## Running Python scripts
119 * Navigate the terminal to the location from **Install the gclib Python module** where example.py was copied.
120 * Open *example.py* in a text editor.
121 * Set the address in the g.GOpen() call to match an avaiable connection.
122 * Execute the following command at the Terminal.
126 gclib version: py.127.110.250
127 192.168.0.42, DMC4080 Rev 1.2c, 783
129 * Experiment with the example by uncommenting sections, between the triple quotes, '''.
133 gclib version: py.127.110.250
134 192.168.0.42, DMC4080 Rev 1.2c, 783
135 GProgramDownload() correctly errored. Can't fit with level 3 compression
137 #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
138 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
139 Downloaded program verified
140 Array element verified
150 Help on method GOpen in module gclib:
152 GOpen(address) method of gclib.py instance
153 Opens a connection a galil controller.
154 See the gclib docs for address string formatting.
155 See Link GOpen() <http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h_aef4aec8a85630eed029b7a46aea7db54.html#aef4aec8a85630eed029b7a46aea7db54>
158 Help on method GCommand in module gclib:
160 GCommand(command) method of gclib.py instance
161 Performs a command-and-response transaction on the connection.
163 See Link GCommand() <http://www.galil.com/sw/pub/all/doc/gclib/html/gclib_8h_a5ac031e76efc965affdd73a1bec084a8.html#a5ac031e76efc965affdd73a1bec084a8>
165 >>> 'for a full listing, try help(g)'