当前位置:网站首页>季更48/90
季更48/90
2022-04-21 15:36:00 【编程随想曲】
编程随想
Python列表
list=["a","b","c"]
//遍历列表
for item in list:
print(item)
Python字典
dic={"Baotou":"蒙B","Huhehaote":"蒙A"}print(dic["Huhehaote"])
//遍历字典
for key,value in dic.items():
print(key)
print(value)
Python面向对象
//定义对象
class Song():
def __init__(self,lyrics):
self.lyrics=lyrics
def sing(self):
print(self.lyrics)
//实例化
song = Song("you and me")
song.sing()
Bash set命令
1. set -u //遇到不存在的变量就会报错,并停止执行。
2. set -x //用来在运行结果之前,先输出执行的那一行命令。
3. set -e //使得脚本只要发生错误,就终止执行。
4. set -o pipefail //只要一个子命令失败,整个管道命令就失败,脚本就会终止执行。
5. set -v //表示打印 Shell 接收到的每一行输入。
6. set -Eeuxo pipefail //set参数组合使用
7. bash -euxo pipefail script.sh //执行 Bash 脚本的时候,从命令行传入这些参数。
版权声明
本文为[编程随想曲]所创,转载请带上原文链接,感谢
https://cloud.tencent.com/developer/article/1985470
边栏推荐
- JUC learning record
- 返璞归真,多方安全计算要回归到“安全”的本源考虑
- 什么是电子邮箱地址?好用的电子邮箱注册申请
- Universal navigation: a concise and practical comprehensive navigation website
- [unity note] l2unity shader Foundation
- MySQL-IF-THEN-ELSE语句
- Page 92 group informatization planning scheme enterprise application integration solution
- 智慧园区数融通-数字化赋能运营管理平台解决方案
- Acwing 1775 Lost cattle (simulated)
- 易语言CEF3获取请求返回的源码
猜你喜欢
随机推荐
[Unity] error CS0433: The type ‘Task‘ exists in both Unity.Tasks,....
Deltix round, summer 2021 D. take a guess
智慧园区数融通-数字化赋能运营管理平台解决方案
LeetCode 386、字典序排数
Simple explanation of impermanence loss
ABAQUS loads according to coordinates - analytical field load mapping
chapter 7类
商家该如何建立私域流量?
shell 知:awk
MySQL通过Binlog恢复数据
Use konvajs three steps to realize a small ball game
How should businesses establish private domain traffic?
sed命令
MySQL8. 0 correct password change posture
GLASS:用于子图表示学习的 GNN 标签技巧
AcWing 1854. Promotion count (Analog)
SMTP协议解读以及如何使用SMTP协议发送电子邮件
MySQL8.0正确修改密码的姿势
How to apply for corporate email? How to register email with mobile phone number?
Oracle 官宣:腾讯 JDK 18 国内第一!









