About 1,030,000 results
Open links in new tab
  1. Find a file in python - Stack Overflow

    Nov 12, 2009 · I have a file that may be in a different place on each user's machine. Is there a way to implement a search for the file? A way that I can pass the file's name and the directory tree to search …

  2. 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?

  3. Find all files in a directory with extension .txt in Python

    Oct 19, 2010 · How can I find all the files in a directory having the extension .txt in python?

  4. python - How do I get the full path of the current file's directory ...

    The above answer assumes the most common scenario of running a python script that is in a file. References pathlib in the python documentation. os.path - Python 2.7, os.path - Python 3 os.getcwd …

  5. Find files in a directory containing desired string in Python

    Dec 30, 2015 · 12 I'm trying to find a string in files contained within a directory. I have a string like banana that I know that exists in a few of the files.

  6. python - How to use to find files recursively? - Stack Overflow

    print(filename) For cases where matching files beginning with a dot (.); like files in the current directory or hidden files on Unix based system, use the os.walk() solution below. os.walk () For older Python …

  7. Browse files and subfolders in Python - Stack Overflow

    Apr 28, 2011 · The first parameter is the directory pathname. This will change for each subdirectory. This answer is based on the 3.1.1 version documentation of the Python Library. There is a good …

  8. 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?

  9. python - Get a filtered list of files in a directory - Stack Overflow

    Feb 9, 2010 · I am trying to get a list of files in a directory using Python, but I do not want a list of ALL the files. What I essentially want is the ability to do something like the following but using Pytho...

  10. Python can't find module in the same folder - Stack Overflow

    Jul 13, 2014 · My python somehow can't find any modules in the same directory. What am I doing wrong? (python2.7) So I have one directory '2014_07_13_test', with two files in it: test.py hello.py …