Using Python 3.73 and IDLE on Win7 pro SP 1, I’m having no luck with the Pololu-suggested Python motor status and test commands (section 12.3 of the TIC manual), or the example given on github using Pytic.
Even trying only the simplest call to test, edting the example down to just ’ ticcmd --list’ does not generate the errors, but no response seen at all… Where would the output go generally? I should get the same result as with a DOS command window:
002680374, Tic Stepper Motor Controller
When it prints, it is in blue, and only simple print statement appear-- I was hoping the output would be the same as a print out.
YAML installed OK with PIP, but it also seems to give an error when the test is run. The program is building a command string and sending it to Ticcmd, but It is not clear that the correct string is actually going to the system- do spaces matter? I have tried a lot of variations.
.
The command that we are trying to send works on a DOS shell as do all the other commands, but it is rejected by Python:
RESTART: C:/Users/Razbo/AppData/Local/Programs/Python/Python37-32/TiccmdExample.py
Traceback (most recent call last):
File "C:/Users/Razbo/AppData/Local/Programs/Python/Python37-32/TiccmdExample.py", line 12, in status = yaml.load(ticcmd('-s', '--full'))
File "C:/Users/Razbo/AppData/Local/Programs/Python/Python37-32/TiccmdExample.py", line 10, in ticcmd
return subprocess.check_output(['ticcmd'] + list(args))
File "C:\Users\Razbo\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 395, in check_output
**kwargs).stdout
File "C:\Users\Razbo\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 487, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['ticcmd', '-s', '--full']' returned non-zero exit status 4.
>>>
The PyTIC program generates other errors:
RESTART: C:/Users/Razbo/AppData/Local/Programs/Python/Python37-32/PyTIC TICCMD Test.py
Traceback (most recent call last):
File "C:/Users/Razbo/AppData/Local/Programs/Python/Python37-32/PyTIC TICCMD Test.py", line 6, in tic = pytic.PyTic()
File "C:\Users\Razbo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pytic\pytic.py", line 27, in __init__
self._load_drivers()
File "C:\Users\Razbo\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pytic\pytic.py", line 80, in _load_drivers
self.usblib = windll.LoadLibrary(file_path+"\\drivers\\x64\\libusbp-1.dll")
File "C:\Users\Razbo\AppData\Local\Programs\Python\Python37-32\lib\ctypes\__init__.py", line 434, in LoadLibrary
return self._dlltype(name)
File "C:\Users\Razbo\AppData\Local\Programs\Python\Python37-32\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
So I have something fundamentally wrong with my Python setup.