Comments (4)
如果这个模块本身不被其他模块调用,而是自己运行的,有没有if __name__=='__main__',执行效果应该都是一样的,这时__name__的值就等于'__main__';
如果这个模块有被其他模块调用,就需要if __name__=='__main__'告诉调用这个模块的模块,if __name__=='__main__'中的代码在调用时不要被执行哦,因为这个时候__name__等于的是模块名并不等于__main__,执行if __name__=='__main__'之外的代码就可以啦。
from fresh-qa.
*args代表任何多个无名参数,返回的是 元组();
**kwargs表示关键字参数,所有传入的key=value,返回字典{};
from fresh-qa.
super().init()
super().init()继承父类的__init__()方法
from fresh-qa.
strip()用于移除字符串头尾指定的字符
upper() 方法将字符串中的小写字母转为大写字母
from fresh-qa.
Related Issues (7)
- Selenium Learning HOT 1
- git基本命令总结 HOT 1
- CSS Selector HOT 1
- Xpath
- Linux: >/dev/null 2>&1
- Jenkins HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fresh-qa.