Pass complex object to a python script in command line
Question: I am beginner in Python programing, I want to pass a complex object (Python
dictionary or class object) as an argument to a python script using command
line (cmd). I see that **sys.argv** gets only string parameters.

Here is an example of what I 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 is a program which accept to run a python script with the -s
option. Thanks for all!!!


Answer: You could try serialize\deserialize to\from a string using a pickle module.
Look for [dumps](http://docs.python.org/2/library/pickle.html#pickle.dumps)
and [loads](http://docs.python.org/2/library/pickle.html#pickle.loads)

