看到这个标题真不知道怎么翻译,就不翻译。

在这个示例里面,把 argvraw_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相关推荐

  1. 《Learn python3 the hard way》ex14 Prompting and Passing

    今天是使用提示语>以及运用argv 和 input进行交互. from sys import argvscript, user_name = argv prompt = ">&q ...

  2. Prompt工程师指南[高阶篇]:对抗性Prompting、主动prompt、ReAct、GraphPrompts、Multimodal CoT Prompting等

    Prompt工程师指南[高阶篇]:对抗性Prompting.主动prompt.ReAct.GraphPrompts.Multimodal CoT Prompting等 1.对抗性 Prompting ...

  3. 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) 目录

  4. 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 ...

  5. [转]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 ...

  6. python编程django遇到问题Passing a 3-tuple to include() is not supported.解决方案

    文章目录 遇到的问题 解决方法 参考 遇到的问题 (ll_env) PS D:\user\文档\python\python_work\learning_log> python manage.py ...

  7. toch_geometric 笔记:message passing GCNConv

    1 message passing介绍 将卷积算子推广到不规则域通常表示为一个邻域聚合(neighborhood aggregation)或消息传递(message passing )方案       ...

  8. 成功解决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. ...

  9. 成功解决matplotlib\cbook\deprecation.py:107: MatplotlibDeprecationWarning: Passing one of 'on', 'true',

    成功解决matplotlib\cbook\deprecation.py:107: MatplotlibDeprecationWarning: Passing one of 'on', 'true', ...

最新文章

  1. date时区 es logstash_es-日志存储-Logstash 介绍
  2. linux安装comfast网卡驱动,电脑如何通过usb共享手机网络 Linux安装wifi 无线网络 811AC usb网卡驱动...
  3. MVC 之 Partial View 用法
  4. 阿里面试题BIO和NIO数量问题附答案和代码
  5. pytest+allure之测试报告本地运行
  6. 计算机第二章基础知识习题,计算机基础知识习题.docx
  7. Online Judge for ACM-ICPC etc.
  8. 通俗易懂理解JAVA虚拟机
  9. 【搬运】 Cadence orcad常用库olb介绍
  10. mpaaS的kylin框架-项目结构(脚手架)
  11. unity 转向和角度
  12. 在线文档查看器GroupDocs.Viewer 9月新版V17.9发布 | 附下载
  13. 假设检验中的P 值 (P value)
  14. 小红书竞品分析_小红书与网易考拉 竞品分析报告
  15. 孙子兵法与三十六计 复盘短记
  16. 4.Python数据容器之字符串(str)
  17. 搜狐新闻如何玩?张朝阳演讲透露玄机
  18. 肖风:区块链是驱动社会数字化迁徙的重要工具
  19. c语言中找不到EXE,windows找不到文件c:\windows\system32\msdt.exe如何解决
  20. 公司突然断网解决方案

热门文章

  1. 操作系统的内核到底是什么?
  2. win10找不到文件无法卸载的解决方法
  3. 用ffmpeg进行音频格式转换、剪切、合并、音量调整等
  4. 3.4.11nbsp;拉里·埃里森
  5. 移动手机用户目录下的证书至根目录下
  6. openGL贝塞尔曲面细分
  7. 项目OA之资源结构图
  8. 三极管与mos管通俗讲解
  9. python比赛积分类算法题_python常用算法题
  10. 硬件开发笔记(一):高速电路设计Cadence Aleegro软件介绍和安装过程