Search code examples
pythondictionarypycharmremote-debuggingargparse

passing argparse dict shaped string from pycharm to a remote interperter (local win,remote nix)


I have the following config:

pycharm on a local win7 machine using a remote unix machine as an interpreter.

The code I'm trying to run receives a dict format string from argparse and uses eval to make it into a dict.

this works when running through ssh but fails running from pycharm using script parameters,

I've been able to use \ for escaping both } and " as so:

--input_paths \{\"kk1\":\[\"/sandbox/23\"]\}

but adding more keys:

 --input_paths \{\"kk1\":[\"/sandbox/23\"],\"kk2\":[\"/sandbox/23\"]\}

results in:

 argtest.py: error: unrecognized arguments: "kk2":["/sandbox/23"]}

any ideas?


Solution

  • May be its too late, but i figured out that you need to have parameters like.

        {\"kk1\":\"asd\",\"kk2\":\"asd\"}

    Single quotes and double quotes also matters in my experience.

    Hope this helps someone.