Pass complex object to a python script in command line -


i beginner in python programing, want pass complex object (python dictionary or class object) argument python script using command line (cmd). see sys.argv gets string parameters.

here example of want:

class point(object):      def __init__(self,x,y):          self.__x=x          self.__y=y p=point(4,8) import os os.system('""xxxxxx.exe" "-s" "../create_scenario.py" "'+ p +'""') 

the xxxxxx.exe program accept run python script -s option. all!!!

you try serialize\deserialize to\from string using pickle module. dumps , loads


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -