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
Related
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:
How to run/execute exe file in python?
(3 answers)
Closed 3 years ago.
I can't seem to figure out how to launch a program on Windows (utorrent.exe) with python
I am not sure how to go about it
any advice would be appreciated
Thanks,
import subprocess
subprocess.run(['<path-to-executable>/utorrent.exe'])
Refer to the subprocess documentation or this question.
This question already has answers here:
Clear terminal in Python [duplicate]
(27 answers)
Closed 5 years ago.
Python is lovely to me because of short line code.
Is there any other way to clear Python shell without using:
import os
os.system('clear')
Can I suggest you to use ipython-notebook.
It is very friendly and also supports the shell commands directly.
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.
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.