程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python FAQ summary

編輯:Python

python common problem FAQ summary

  1. python In the use of *args,**kwargs To represent the function dynamic length parameter .
  2. py And pyc The difference between

original Python In the program , Is to put the original program code in .py In the document , and Python Will be in execution .py When you file . take .py Form of the program compiled into intermediate files (byte-compiled) Of .pyc file , The purpose of this is to speed up the next file execution .
therefore , Before we run python When you file , It will automatically check whether there is .pyc file , If any , and .py Date of revision and .pyc The modification time is the same , It will read .pyc file , otherwise ,Python I'll read the original .py file .
In fact, not all .py Files will be generated during and operation .pyc file , Only in import Corresponding .py When you file , Will generate the corresponding .pyc file

  1. _init_.py The role of ?

The function of this file is equivalent to managing its entire folder as a package , Whenever there is an external import When , Will automatically execute the functions inside .

  1. pip Configure domestic image ?

windows Under the system :
C:\Users\Administrator Next new :pip Folder pip.ini file
Content
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple

  1. python Use in pydoc Generate project help documents .

  2. Python Standard library

  3. Python Standard module multiprocessing Concurrent multiprocesses

from multiprocessing import Pool
import time
def ssh (ip):
print ("login in %s "%ip)
print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))
time.sleep(10)
if __name__ == '__main__':
with Pool(50) as p:
p.map(ssh,["192.168.1."+ str(i) for i in range(100)])
  1. Python Medium generator (generator)、Iterator( iterator ) and Iterable( Iteration objects ) The difference between

  2. It may be the most complete in the whole network Python operation Excel Library summary !

  3. Horse brother Linux Operation and maintenance - After watching 100 piece Python Technical essence article , Average salary increase 30%!

  4. python Medium encode() and decode() function

  5. Python A complete collection of commonly used modules ( Arrangement )

  6. python journal logging modular ( Detailed analysis )

  7. Tens of thousands of lines of code 22 individual Python Universal formula , Recommended collection !

  8. python call cmd The method of command

  9. Python Standard library ( Very classic introduction of various modules )

  10. Python Detailed knowledge system summary (2021 edition )

  11. pycharm Activate


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved