We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a97c8f5 commit dbcbfd0Copy full SHA for dbcbfd0
2 files changed
json/test_json.py
@@ -0,0 +1,7 @@
1
+
2
+import json
3
4
+a = json.dumps({'a':1, 'b':2})
5
+print(type(a))
6
+b = json.load("{'a':1, 'b':2}")
7
+print(type(b))
subprocess32/test_popen.py
@@ -0,0 +1,26 @@
+import subprocess
+import string
+# child = subprocess.Popen(['ping', '-c', '4', 'www.baidu.com'], stdout=subprocess.PIPE)
+# child = subprocess.Popen(['python', 'cerepos_umspay_cmd.py', 'func:sign_on'], stdout=subprocess.PIPE)
8
+amount = 1.0
9
+cmd = ["python", "/home/mm/kiosk/ckcerepos/ckcerepos/cerepos_umspay_cmd.py", "func:consume", "amount:"+str(amount)]
10
+print("umspay sale: %s" % cmd)
11
+child = subprocess.Popen(cmd, stdout=subprocess.PIPE)
12
+child.wait()
13
+print("umspay child.returncode: %s" % child.returncode)
14
+if child.returncode == 0:
15
+ res = child.stdout.read()
16
+else:
17
+ res = {"resp_code":"crash"}
18
19
20
+print('parent process')
21
+print("child.returncode: %s" % child.returncode)
22
+print("child.stdout: %s" % res)
23
+print("child.stdout type: %s" % type(res))
24
+b = eval(res)
25
+print("type(b): %s" % type(b))
26
+# print("child.stdout json: %s" % json.loads(res))
0 commit comments