擅长:python、mysql、java
<p>尝试使用换行符传递参数,并使用原始字符串文字更正缩进:</p>
<pre><code>cmd := exec.Command("python", "-c", `import csv,json;
a=list();
for i in csv.DictReader(open('/Users/Astra/data_in/Data.csv', 'r')):
a.append(json.dumps(i));
b=dict(enumerate(a));
c=json.dumps(b, sort_keys=True, indent=4);
print(c)
`)
</code></pre>