Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python API reference: command line arguments as list
#1
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)

It raises a type error stating 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,args是移交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


Attached Files Thumbnail(s)



Messages In This Thread
Python API reference: command line arguments as list - byDavidG- 02-06-2019, 05:43 PM



Users browsing this thread:
1 Guest(s)