Click here to Skip to main content
15,029,162 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have been struggling to write some code that prompts the user to choose whether they would like to read/import some data from an excel file or not. I don't want to use Pandas or external packages. I need to be able to have a prompt that asks the user if they would like to read data from excel, and based on their response ask them to input the excel file they would like to read from etc. Does anyone have any clues on how to go about this? Bit of a newby. Much appreciated! Thanks.

What I have tried:

I have been struggling to write some code that prompts the user to choose whether they would like to read/import some data from an excel file or not. I don't want to use Pandas or external packages. I need to be able to have a prompt that asks the user if they would like to read data from excel, and based on their response ask them to input the excel file they would like to read from etc. Does anyone have any clues on how to go about this? Bit of a newby. Much appreciated! Thanks.
Posted
Updated 18-Jun-21 4:17am
Comments
SeeSharp2 18-Jun-21 10:07am
   
If you are a newbie then you have a lot of learning to do. However, you can do a simple jquery dialog for the popup to ask a user and then use a file upload control to allow them to select the file. But then there is a lot of code to make this all work.

1 solution

Python
file_name = input('Please enter the file name: ')
if len(file_name) == 0:
    print('OK, you don\'t want to play')
    return
print('Processing the excel file')
# your code goes here


And I also suggest you go to The Python Tutorial — Python 3.7.10 documentation[^].
   
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900