当前位置:网站首页>用户交互+格式化输出
用户交互+格式化输出
2022-07-31 01:46:00 【51CTO】
用户交互
1 2 3 4 5 6 7 |
|
输入密码时,如果想要不可见,需要利用getpass 模块中的 getpass方法,即:
1 2 3 4 5 6 7 8 9 10 |
|

使用控制台可以展示getpass模块功能如下图:

chmod 755 hello.py(加入权限755:7-->4:读取+2:写+1:执行,也就是所属用户可读可写可执行。5:4+1)
755 :所属用户、所属组、其他用户
查看数据是如何传递的:

实现:
username = input("username:")
password = input("password:")
print(username,password)
注意:shell中单引号和双引号是有区别的
实现:
username:123
password:123
123 123
注意:能不使用“+”加号拼接就不使用,太占内存了。
name:lnx
age:23
job:工程师
salary:34000
------info of lnx
Name: lnx
Age:23
Job:工程师
Salary:34000.00
用户交互
1 2 3 4 5 6 7 |
|
输入密码时,如果想要不可见,需要利用getpass 模块中的 getpass方法,即:
1 2 3 4 5 6 7 8 9 10 |
|

使用控制台可以展示getpass模块功能如下图:

边栏推荐
猜你喜欢

手把手教你配置Jenkins自动化邮件通知

Analyze the capabilities and scenarios of the cloud native message flow system Apache Pulsar

MySQL的存储过程

16、注册中心-consul

What have I experienced when I won the offer of BAT and TMD technical experts?

"Real" emotions dictionary based on the text sentiment analysis and LDA theme analysis

VSCode Plugin: Nested Comments

GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13

CV-Model【3】:MobileNet v2

Shell 脚本循环遍历日志文件中的值进行求和并计算平均值,最大值和最小值
随机推荐
GCC Rust获批将被纳入主线代码库,或将于GCC 13中与大家见面
有没有可以做副业可以日入300元方法?
GCC Rust is approved to be included in the mainline code base, or will meet you in GCC 13
Interprocess communication study notes
Xiaohei's leetcode journey: 104. The maximum depth of a binary tree
第一学年课程期末考试
一个无经验的大学毕业生,可以转行做软件测试吗?我的真实案例
coldfusion文件读取漏洞(CVE-2010-2861)
How to expose Prometheus metrics in go programs
Arbitrum Interview | L2 Summer, what does the standout Arbitrum bring to developers?
Basic Parameters of RF Devices 1
充电效果模拟
Maximum monthly salary of 20K?The average salary is nearly 10,000... What is the experience of working in a Huawei subsidiary?
"Actual Combat" based on part-of-speech extraction in the field of e-commerce and its decision tree model modeling
CV-Model【3】:MobileNet v2
如何在 go 程序中暴露 Prometheus 指标
leetcode-128: longest continuous sequence
MySql installation and configuration super detailed tutorial and simple method of building database and table
rpm install postgresql12
What does a software test report contain?