python14 Prompting and Passing
看到这个标题真不知道怎么翻译,就不翻译。
在这个示例里面,把 argv 和 raw_input 一起使用,来达到一些特定的效果
代码ex14.py
from sys import argvscript, user_name = argv
prompt = '> 'print "Hi %s, I'm the %s script." % (user_name, script)
print "I'd like to ask you a few questions."
print "Do you like me %s?" % user_name
likes = raw_input(prompt)print "Where do you live %s?" % user_name
lives = raw_input(prompt)print "What kind of computer do you have?"
computer = raw_input(prompt)print """
Alright, so you said %r about liking me.
You live in %r. Not sure where that is.
And you have a %r computer. Nice.
""" % (likes, lives, computer)
看下运行效果
python14 Prompting and Passing相关推荐
- 《Learn python3 the hard way》ex14 Prompting and Passing
今天是使用提示语>以及运用argv 和 input进行交互. from sys import argvscript, user_name = argv prompt = ">&q ...
- Prompt工程师指南[高阶篇]:对抗性Prompting、主动prompt、ReAct、GraphPrompts、Multimodal CoT Prompting等
Prompt工程师指南[高阶篇]:对抗性Prompting.主动prompt.ReAct.GraphPrompts.Multimodal CoT Prompting等 1.对抗性 Prompting ...
- python中使用zip函数基于两个列表数据list创建字典dict数据(Create a dictionary by passing the output of zip to dict)
python中使用zip函数基于两个列表数据list创建字典dict数据(Create a dictionary by passing the output of zip to dict) 目录
- FutureWarning: Passing (type, 1) or ‘1type‘ it will be understood as (type, (1,)) / ‘(1,)type‘
FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version ...
- [转]Passing data between pages in JQuery Mobile mobile.changePage
本文转自:http://ramkulkarni.com/blog/passing-data-between-pages-in-jquery-mobile/ I am working on a JQue ...
- python编程django遇到问题Passing a 3-tuple to include() is not supported.解决方案
文章目录 遇到的问题 解决方法 参考 遇到的问题 (ll_env) PS D:\user\文档\python\python_work\learning_log> python manage.py ...
- toch_geometric 笔记:message passing GCNConv
1 message passing介绍 将卷积算子推广到不规则域通常表示为一个邻域聚合(neighborhood aggregation)或消息传递(message passing )方案 ...
- 成功解决KeyError: “Passing list-likes to .loc or [] with any missing labels is no longer supported. The
成功解决KeyError: "Passing list-likes to .loc or [] with any missing labels is no longer supported. ...
- 成功解决matplotlib\cbook\deprecation.py:107: MatplotlibDeprecationWarning: Passing one of 'on', 'true',
成功解决matplotlib\cbook\deprecation.py:107: MatplotlibDeprecationWarning: Passing one of 'on', 'true', ...
最新文章
- date时区 es logstash_es-日志存储-Logstash 介绍
- linux安装comfast网卡驱动,电脑如何通过usb共享手机网络 Linux安装wifi 无线网络 811AC usb网卡驱动...
- MVC 之 Partial View 用法
- 阿里面试题BIO和NIO数量问题附答案和代码
- pytest+allure之测试报告本地运行
- 计算机第二章基础知识习题,计算机基础知识习题.docx
- Online Judge for ACM-ICPC etc.
- 通俗易懂理解JAVA虚拟机
- 【搬运】 Cadence orcad常用库olb介绍
- mpaaS的kylin框架-项目结构(脚手架)
- unity 转向和角度
- 在线文档查看器GroupDocs.Viewer 9月新版V17.9发布 | 附下载
- 假设检验中的P 值 (P value)
- 小红书竞品分析_小红书与网易考拉 竞品分析报告
- 孙子兵法与三十六计 复盘短记
- 4.Python数据容器之字符串(str)
- 搜狐新闻如何玩?张朝阳演讲透露玄机
- 肖风:区块链是驱动社会数字化迁徙的重要工具
- c语言中找不到EXE,windows找不到文件c:\windows\system32\msdt.exe如何解决
- 公司突然断网解决方案