RoboDK Forum
Python API reference: command line arguments as list- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+ - - -论坛:RoboDK错误(//www.sinclairbody.com/forum/Forum-RoboDK-bugs)
+--- Thread: Python API reference: command line arguments as list (/Thread-Python-API-reference-command-line-arguments-as-list)



Python API reference: command line arguments as list-DavidG-02-06-2019

Hi,
I would like to make a suggestion for an improvement of the Python API reference. What I tried is starting
RoboDK using explicit input values (although these are the default values):


Code:
robodk_ip='localhost'
port=None
args=''
robodk_path='C:\\RoboDK\\bin\\RoboDK.exe'

RDK = Robolink(robodk_ip, port, args, robodk_path)

它提出了一个类型错误tating that a concatenation of list and string is not possible (see attachment). Looking into robolink.py it becomes clear that the inputs ofrobodk_pathandargsare being concatenated. Whererobodk_pathis transformed to a list automatically,argsis handed over as it is declared in the first place (see attachment), in this case as a string.

The correct version of the code above would be:

Code:
robodk_ip='localhost'
port=None
args=[]
robodk_path='C:\\RoboDK\\bin\\RoboDK.exe'

RDK = Robolink(robodk_ip, port, args, robodk_path)


It is really not a big deal but it might be worth mentioning that command line arguments should be given as list:
//www.sinclairbody.com/doc/en/PythonAPI/robolink.html

Best Regards
David


RE: Python API reference: command line arguments as list-Albert-02-07-2019

Hi David,

Thank you for letting us know. We just updated the documentation.

We also improved this function to accept strings with the latest version (Windows 64 bit only, for now). Providing a string will behave as one argument (even if you have one or more spaces).

Albert