How to read an excel file name User defined from a path using python

0 votes
How to read an excel file (name User defined) from a path using python

script that only reads an  excel file present inside a path.

pd.read_excel(filename.xlsx) is usefull to read a file with stable name . heree file names changes and i dont want to run the code every time by changing file name .
Aug 13, 2020 in Python by anonymous
• 120 points
4,659 views

1 answer to this question.

0 votes

Hi @There,

As the path is fixed, use the Python OS module to find all the files inside the path.

Filter all excel file (probably there will be one on very first time) and read that.

You probably delete the excel file after reading otherwise next time this may create confusion.

Also, you need to pass that filename to

pd.read_excel()
answered Aug 13, 2020 by Gitika
• 65,910 points

Related Questions In Python

0 votes
1 answer

How to use read a WSDL file from the file system using Python suds?

Hi, good question. It is a very simple ...READ MORE

answered Jan 21, 2019 in Python by Nymeria
• 3,560 points
7,672 views
0 votes
1 answer

How to read data from a text file using Python?

Refer to the below example where the ...READ MORE

answered May 13, 2019 in Python by Sushma
1,251 views
0 votes
1 answer

How to create and read from a temporary file in Python?

Hi, there is a very simple solution ...READ MORE

answered Jan 29, 2019 in Python by Nymeria
• 3,560 points
1,754 views
0 votes
2 answers

How do you read from a file using file handling in python?

for write, read,append data in file check ...READ MORE

answered Jun 21, 2020 in Python by sahil
• 580 points
894 views
0 votes
3 answers

Python Selenium best tutorials for beginners

Hope this will help you...Python Tutorial READ MORE

answered Feb 11, 2019 in Python by aldrinjohn
• 140 points
3,441 views
0 votes
1 answer

I want to download a file from the website by web scraping. Can anyone explain how to do this in jupyter lab (python) with an example?

Hey, Web scraping is a technique to automatically ...READ MORE

answered Apr 7, 2020 in Python by Gitika
• 65,910 points
2,075 views
0 votes
3 answers

How to get the return value from a thread using python?

FWIW, the multiprocessing module has a nice interface for ...READ MORE

answered Dec 15, 2020 in Python by Roshni
• 10,520 points
105,137 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP