About 444,000 results
Open links in new tab
  1. python - How to install the os module? - Stack Overflow

    os is a standard Python module, there's no need install it. So import os should always work inside Python, and if it doesn't, the cause is your PYTHONPATH or IDE settings, look at them; don't start …

  2. python - Should I use `import os.path` or `import os`? - Stack Overflow

    According to the official documentation, os.path is a module. Thus, what is the preferred way of importing it? Should I always import it explicitly? import os.path Or is importing os enough? impor...

  3. How do I import other Python files? - Stack Overflow

    How do I import files in Python? I want to import: a file (e.g. file.py) a folder a file dynamically at runtime, based on user input one specific part of a file (e.g. a single function)

  4. Clear the terminal in Python - Stack Overflow

    Does any standard method exist to clear the terminal screen programmatically from a Python script, or do I have to use curses library ?

  5. How can I access environment variables in Python?

    I haven’t set it (PYTHONPATH) before; what I am doing just go with command prompt and type CMD anywhere (since python.exe is in my shell PATH). If I try to access Window ENVIRONMENT …

  6. Python: Does importing "sys" module also import "os" module?

    Jun 28, 2023 · It requires the os module, and as part of my getting familiar with Python, I decided to test whether os was already imported. Testing the presence of a module requires the sys module (as …

  7. python - How do I list all files of a directory? - Stack Overflow

    Jul 9, 2010 · How can I list all files of a directory in Python and add them to a list?

  8. python - How can I clear the interpreter console? - Stack Overflow

    514 Like most Python developers, I typically keep a console window open with the Python interpreter running to test commands, dir() stuff, help() stuff, etc. Like any console, after a while the visible …

  9. python - Find the current directory and file's directory - Stack Overflow

    How do I determine: the current directory (where I was in the shell when I ran the Python script), and where the Python file I am executing is?

  10. Can't import os in python - Stack Overflow

    Aug 24, 2020 · I get this message when trying to import os while using Pyzo 4.10.2 : ValueError: source code string cannot contain null bytes Here is the code I tried : from os import * …