当前位置:网站首页>用户交互+格式化输出
用户交互+格式化输出
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模块功能如下图:

边栏推荐
猜你喜欢
![[Map and Set] LeetCode & Niu Ke exercise](/img/66/d812a6ad854cb0993c796760042150.png)
[Map and Set] LeetCode & Niu Ke exercise

Word 表格跨页,仍然显示标题

Shell 脚本循环遍历日志文件中的值进行求和并计算平均值,最大值和最小值

Kyushu cloud as cloud computing standardization excellent member unit

GCC Rust获批将被纳入主线代码库,或将于GCC 13中与大家见面

1782. 统计点对的数目 双指针

加密生活,Web3 项目合伙人的一天

35. Reverse linked list

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

The Meta Metaverse Division lost 2.8 billion in the second quarter, still want to continue to bet?Metaverse development has yet to see a way out
随机推荐
Meta元宇宙部门第二季度亏损28亿 仍要继续押注?元宇宙发展尚未看到出路
SQLserver查询最近三个月的数据,语句该怎么写sqlserver
手把手教你配置Jenkins自动化邮件通知
What are the project management tools like MS Project
Kyushu cloud as cloud computing standardization excellent member unit
Chi-square distribution of digital image steganography
Arbitrum 专访 | L2 Summer, 脱颖而出的 Arbitrum 为开发者带来了什么?
MySql的安装配置超详细教程与简单的建库建表方法
The difference between 4G communication module CAT1 and CAT4
如何在 go 程序中暴露 Prometheus 指标
汉诺塔问题
Installation problem corresponding to tensorflow and GPU version
leetcode-399:除法求值
Distributed. Idempotency
【AcWing 第62场周赛】
rpm install postgresql12
软件测试要达到一个什么水平才能找到一份9K的工作?
【网络安全】文件上传靶场通关(1-11关)
使用docker安装mysql
进程间通信学习笔记