Python module implementing common pathname manipulations
Questions tagged [os.path]
502 questions
-2
votes
2 answers
Python - glob.glob with grep?
I am fairly new to the Python environment and gradually working my way forward.
We got about 10,000 files in a folder containing similar information, but with one major difference. Some files contain a string 'string1' and the other set contains…

Max
- 185
- 1
- 11
-2
votes
2 answers
How to do auto file naming in python?
There is a list named 'links' and I want to write as many files as the number of links inside this list (I'm doing web scraping). For example if the list contains 100 links, I would like to write data of each link to a separate text file like…

Talha Yousuf
- 301
- 2
- 12
-2
votes
1 answer
how to use os.popen, os.path.join for command line ls in python
I have the following directories and subdirectories with txfiles in it. I want to access them for reading the lines. But this does not work. can you help me out here?
main directory: 2009
sub directory: movies, albums, songs
each of these directory…

brain storm
- 30,124
- 69
- 225
- 393
-3
votes
2 answers
Is there a way to improve this CODE? (python os.walk os.pathbase)
The code can run normally, but I feel the "output_file" is too long, so any way improve it?
#load input files from input_dir(include child folders)
#and create output files to output_dir(include SAME child folders)
for root,dirs,files in…

Junior
- 27
- 7
-3
votes
2 answers
Why I am not getting into the path file " the system cannot find the path specified "
So I am using a function in python which is being called in Robotframework to copy a file from a source to destination
I have used os.path.join() and os.listdir() and os.path.normpath() to get access to the folder and copy using shutil
But…

Raja_Viki
- 13
- 2
-4
votes
1 answer
Check if a file already exists in a particular folder
I want, before uploading a file in image folder, to check if the file in the folder already exists or not. If the file already exists it should show a message.
from flask import Flask, render_template, request
from werkzeug import…

Neeraj Upadhyay
- 85
- 4
- 8