CSDN community Ten Questions ten A (Python Phase I)

Over the past week, from the CSDN Python community, organize a small partners more questions, and requested technical Daren these questions were answered, are summarized as follows. Welcome everyone in the community to ask questions Oh, ask questions of the junior partner will also receive a commemorative gift CSDN mysterious provided Oh!

 

Question 1, there is append method and extend what's the difference?
Append represent the data as a new element is added to the end of the list, its parameters can be any object.
The extend argument must be an iterative object that represents all the elements of the object which is individually appended to the list.

Issue 2, Python Why use Global Interpreter Lock?
Python is due to the use of reason Global Interpreter Lock (GIL), code, and can not run concurrently on multicore, that is to say, not concurrent multi-threaded Python, many people will find uses multiple threads to improve their Python code , operating efficiency has declined. This article on the Python Global Interpreter Lock (GIL) was introduced. Python authors believe this is the most headaches.

Question 3, I wrote a function in another file, and then use the function calls in python console, the above error occurred. Show this mean? TypeError: 'NoneType' object is not callable.
The reason is because there is no compile another file function, simply open the file calls the function, and then click Run, and then re-use the function calls in python console in the error will not.

Issue 4, PyCharm Python Console Chinese garbled output, how to do it?
Solution Please refer to the following article: https: //blog.csdn.net/huiyanshizhu/article/details/78907629

Question 5, the system prompts this error: AttributeError: module 'numpy' has
no attribute 'arange' presence in the working directory files you created a numpy.py

Question 6, talk about your understanding of the zen of python, is there any way you see it?
Python Zen, Python uphold a unique high-line syntax is simple and readable, and highly consistent programming model, in line with the "brain habits of mind "so that Python is easy to learn, to understand and remember. Python while using a minimalist design concept for a complete philosophy of Python, you can type import this command in any Python interactive interpreter, which is a Python hidden eggs: depicts a series of Python design principles. Today it is popular within the Python community jargon "EIBTI", rather than obscure understand this rule referred to in Python's way of thinking, rather than obscure clear, simple is better than complex.

Question 7, python method to debug code What?

IDE has a specific debugging, such as: IDLE, Eclipse + Pydev can set breakpoints. 
pdb module can do debugging.
There PyChecker and pylint
PyChecker is a python code

Question 8, on github can fork over what python library?
http://rogerdudler.github.io/git-guide/index.zh.html # concise guide on git  

http://www.zhihu.com/question/20070065 # BBS on the git  

http://www.techug.com/githug-for-designer # on the github 

Question 9 What is GIL?
GIL (, Ltd. Free Join Interpreter Lock) global interpreter lock it simply is:?
Each interpreter process, while only one thread can only be performed to obtain the relevant locks, access to relevant resources
so it's easy to find, if a process interpreter to execute only one thread, 
multi-thread concurrency is impossible, even in the absence of resources between several threads compete.
in theory, we should as much as possible make the program more parallel, to take full advantage of the multi-core function.

Question 10, what is the metaclass (meta_class)?
Metaclass is used to create a class of "stuff"

Welcome to the scan code into the group to share with you! We will also share technical learning resources weekly + monthly launch activities on technical topics + main group, technical up people online interactive Q & A

Guess you like

Origin blog.csdn.net/CSDNedu/article/details/91984830