This question already has answers here:
How to check if a module/library/package is part of the python standard library?
(3 answers)
Closed 6 years ago.
I am reading PEP 8, and in the imports section it says to put 'standard library imports' in the top of your library import section. My question is: How do I know which libraries are 'standard'? I.e. where can I find a list of what libraries are 'standard'?
Any library that is listed in the Python core documentation for your version is part of the standard library. So anything you don't have to install separately from Python itself.
See https://docs.python.org/3/library/ for the Python 3 list.
Related
This question already has answers here:
Directing Python to look in another folder for modules
(1 answer)
Where should I put my own python module so that it can be imported
(6 answers)
Closed 20 days ago.
This may seem like a dumb question but when you use import on Python to find a specific library or module does it check the whole system for that specific file name and if so how is "from" used with imports?
Thanks in advance
This question already has answers here:
How do I find out all previous versions of python with which my code is compatible
(4 answers)
How to detect minimum version of python that a script required
(2 answers)
Closed 1 year ago.
I am developing a Python package. It occurred to me that as my codebase changes that it would be useful to be able to automatically check what versions of Python are compatible. In general I could see this being a hard problem, but it seems to me like a naive approach that only looks at core syntax (f-formatting of strings, type hints, etc) to give an estimate of the earliest compatible version would still be useful.
Is there an automatic way to do this?
write tests that use your code from the package
Decide what versions of python you to support
set up continuous integration (CI) that runs your tests on the the those versions of python you support.
This question already has answers here:
Where do I find the python standard library code?
(6 answers)
Closed 3 years ago.
I wish to see the code of the modules in C of python, but it isn't in "Lib," which has every module. Where are these modules? I know that this question has been repeatedly asked, but that was before version 3.7.3.
I have Python 3.7.3, and I have checked most of the Python Folder that has the program itself.
I think you're looking for Modules/ files https://github.com/python/cpython/tree/master/Modules
This question already has answers here:
Why does node.js need python
(2 answers)
Closed 4 years ago.
.. such as the ones in following screenshot (Node 8 on Ubuntu):
As far as I know a Node package does not only have to consist of only JavaScript. It could require python or contain C.
CasperJS even contains C#:
https://github.com/casperjs/casperjs/blob/master/src/casperjs.cs
NodeJS itself uses gyp so naturally I would assume it also requires python if it is not already present on your machine:
https://nodejs.org/en/docs/meta/topics/dependencies/#gyp
This question already has answers here:
Why do you have to 'import' Python Standard Library functions? [closed]
(3 answers)
Closed 5 years ago.
I get that you need to import modules into Python for additional functionality. But, if you've already downloaded all of Python's modules when you first installed Python, why do you need to import specific modules in order to use them? Or does Python import modules from the Internet? Where do the imported modules come from exactly?
Example: if you type datetime.datetime.now(), why doesn't Python know that datetime is a module that will be need to be accessed, without having to "import" it?
the short answer is speed. Why access any information if you dont have to? Especially that much information.
Dictating what information (library) youd like to access is a very intuitive design.