About 50 results
Open links in new tab
  1. python - Importing files from different folder - Stack Overflow

    I have this folder structure: application ├── app │ └── folder │ └── file.py └── app2 └── some_folder └── some_file.py How can I import a function from file.py, from within som...

  2. What does Python's dir () function stand for? - Stack Overflow

    Jun 28, 2014 · What does Python's dir () function stand for? [duplicate] Asked 14 years, 6 months ago Modified 11 years, 9 months ago Viewed 32k times

  3. the dir function in python - Stack Overflow

    Jan 25, 2013 · dir([object]) -> list of strings If called without an argument, return the names in the current scope. Else, return an alphabetized list of names comprising (some of) the attributes of the given …

  4. Python dir () function with variable arguments - Stack Overflow

    Feb 18, 2017 · For fun/to practice python, I am trying to create a program that displays the contents of a module. Looks like this: import sys print "Here are all the functions in the sys module: " print dir(sys)

  5. python - What's the difference between dir () and __dir__ ... - Stack ...

    Jul 12, 2018 · 4 dir calls __dir__ method if it is present, from python documentation : dir ( [object])¶ Without arguments, return the list of names in the current local scope. With an argument, attempt to …

  6. Why is 'dir ()' named 'dir' in python? - Stack Overflow

    Dec 3, 2009 · 85 In Python there is a built-in function called dir. This is used to get a list of all the attributes for an object. I understand what it does, but I am confused about why it is called dir. How is …

  7. python - How to list all functions in a module? - Stack Overflow

    The Python documentation provides the perfect solution for this which uses the built-in function dir. You can just use dir (module_name) and then it will return a list of the functions within that module.

  8. How is __dir__ implemented exactly, and how should I know it?

    Feb 4, 2018 · The __dir__ method is implemented on the object type and inherited by the function type, so the implementation is in the object_dir() function. For Python 2, the dir() implementation is more …

  9. Why Python Built-in Functions not showing on dir ()

    Aug 2, 2017 · In the same way Python falls back onto global variables if it doesn't find the variable's local definition, inside a class or function or whatever, if it doesn't find a global variable with the name …

  10. How do I check if a directory exists in Python? - Stack Overflow

    133 Python 3.4 introduced the pathlib module into the standard library, which provides an object oriented approach to handle filesystem paths. The is_dir() and exists() methods of a Path object can be used …