我有一个python脚本,从命令行获取输入.我只是想修改这个脚本,以便我可以在网上运行它.我希望命令行界面被网页中的简单框替换,一旦执行了脚本,我希望结果显示在网页上,就像在命令行中一样.
任何有关从哪里开始的帮助,使用哪些python包以及采取哪些步骤都将非常感激.
到目前为止,我读了一些关于Google App Engine和web.py的webapp2.我不想使用Django.
谢谢!
我有两个列表,包括相同的字典,格式为:
清单1:
[{'url': u'http://www.bloomberg.com/news/articles/2016-08-17/you-can-get-a-50-phone-from-amazon-if-you-don-t-mind-the-ads','title': u'You Can Get a $50 Phone From Amazon, If You Don\u2019t Mind the Ads'}, {'url': u'http://www.bloomberg.com/news/features/2016-08-18/uber-s-first-self-driving-fleet-arrives-in-pittsburgh-this-month-is06r7on', 'title': u'Uber\u2019s First Self-Driving Fleet Arrives in Pittsburgh This Month'}]
Run Code Online (Sandbox Code Playgroud)
清单2:
[{'url': u'http://www.bloomberg.com/news/articles/2016-08-17/you-can-get-a-50-phone-from-amazon-if-you-don-t-mind-the-ads', 'title': u'You Can Get a $50 Phone From Amazon, If You Don\u2019t Mind the Ads'}]
Run Code Online (Sandbox Code Playgroud)
我想做什么:我想删除list2中列表1中的字典(url和title).
我试过以下,
list1[:] = [d for d in list1 if d.get('title') != (fail for fail in list2 if fail.get('title'))]
Run Code Online (Sandbox Code Playgroud)
但无法做到这一点
预期结果:
list1 = [{'url': u'http://www.bloomberg.com/news/features/2016-08-18/uber-s-first-self-driving-fleet-arrives-in-pittsburgh-this-month-is06r7on', 'title': u'Uber\u2019s First Self-Driving Fleet Arrives in …
Run Code Online (Sandbox Code Playgroud) 我正在尝试从此文件名格式中提取日期:
"output_AU1001-BY.20160502.csv"
Run Code Online (Sandbox Code Playgroud)
我想也许我可以做到re.findall()
但不能做到。
python ×4
python-2.7 ×4
date ×1
dictionary ×1
regex ×1
selenium ×1
string ×1
web ×1
webapp2 ×1