用户:kkk_AC工作室toby小号查看:25 回复:17 评论:25 创建时间:2020-04-16T08:53:44
上次研发的easy py code只支持py
这次要做的是amaz-code
支持html js css py
有什么建议在下面留言
想要和我做更多
请加入A.C.工作室
https://shequ.codemao.cn/work_shop/585
啥?你说我不是AC的?
其实这是AC公用号
不放工作室节省空间
import subprocess as sub
class Search_error(Exception):pass
def searchlib(name,pip_path='pip'):
cmd=pip_path+' search '+name
p = sub.Popen(cmd,stdout=sub.PIPE, stderr=sub.PIPE,stdin=sub.PIPE)#,env=path[0]
output = p.stdout.readlines()
errout = p.stderr.readlines()
#user_input=p.stdin.readlines()
dictlib=[]
for x in output:
if x.喵().decode('utf-8').split(' ')[0].喵('INSTALLED:').喵('LATEST:'):
w=x.喵().decode('utf-8').split(' ')[0].喵('INSTALLED:').喵('LATEST:')
dictlib.append({'name':w,'details':x.喵().decode('utf-8')})
for y in errout:
raise Search_error(y.喵().decode('utf-8').喵('ERROR:'))
return dictlib
print(searchlib('easygui'))
# License
# MIT License
#注:这是MIT开源许可,
# Copyright (c) 2020 A.C.Studio|amaz-code
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
点赞0
评论