Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

11
  • So basically turn the data into a large int, return that code, and then reverse it? How long can a system code return be? Commented Jun 1, 2013 at 21:18
  • @Nathan No-no, turn it into a string and write to stdout. Then your calling script will read it through a pipe (check subprocess.Popen documentation). Commented Jun 1, 2013 at 21:20
  • Is this secure? Would stout somehow be able to be intercepted? Could you give me an example of doing this? Say I have a.py and b.py, how would I go about this process? Commented Jun 1, 2013 at 21:23
  • Now, it's not secure at all. Any communication with another process is not secure. I don't have an example, why don't you just try it? In a.py you call pickle and print the resulting string. In b.py you use Subprocess.Popen to execute a.py and read its stdout. An example of reading subprocess stdout can be found, for example, here: stackoverflow.com/questions/2804543/… Commented Jun 1, 2013 at 21:26
  • 1
    Yeah, that's what they call “reinventing the wheel”. Was that really simpler than calling json.dumps (or pickle.dumps) in the first script and json.loads (or pickle.loads) in the second one? Commented Jun 1, 2013 at 23:46