首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >APT命令行接口-比如是/否输入?

APT命令行接口-比如是/否输入?
EN

Stack Overflow用户
提问于 2018-03-27 01:15:10
回答 2查看 0关注 0票数 0

有什么捷径可以达到APT的目的吗?(Advanced Package Tool)命令行接口在Python中做什么?

EN

Stack Overflow用户

发布于 2018-03-27 11:11:00

我会这样做:

代码语言:txt
复制
# raw_input returns the empty string for "enter"
yes = {'yes','y', 'ye', ''}
no = {'no','n'}

choice = raw_input().lower()
if choice in yes:
   return True
elif choice in no:
   return False
else:
   sys.stdout.write("Please respond with 'yes' or 'no'")
票数 0
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100007800

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档