我的python cmd脚本有问题.我不知道为什么它不起作用.我的代码可能有问题.我试图通过我的python脚本在cmdline中运行该程序.
我在bash中得到错误"sh:1:语法错误:重定向意外"
请帮助我只是生物学家:)
我使用spyder(anaconda)/ Ubuntu
#!/usr/bin/python
import sys
import os
input_ = sys.argv[1]
output_file = open(sys.argv[2],'a+')
names = input_.rsplit('.')
for name in names:
os.system("esearch -db pubmed -query %s | efetch -format xml | xtract -pattern PubmedArticle -element AbstractText >> %s" % (name, output_file))
print("------------------------------------------")
Run Code Online (Sandbox Code Playgroud) 我有连接词典的问题.有这么多代码,所以我在示例中显示我的问题是什么.
d1 = {'the':3, 'fine':4, 'word':2}
+
d2 = {'the':2, 'fine':4, 'word':1, 'knight':1, 'orange':1}
+
d3 = {'the':5, 'fine':8, 'word':3, 'sequel':1, 'jimbo':1}
=
finald = {'the':10, 'fine':16, 'word':6, 'knight':1, 'orange':1, 'sequel':1, 'jimbo':1}
Run Code Online (Sandbox Code Playgroud)
它是wordcloud的字数.我不知道如何连接键的值,这对我来说很困惑.请帮忙.最好的祝福