script for get today's files is exist or not if not get and move yesterday file [closed]
Title - File checking python script
In python how i can know the today's files is exist or not in folder, if file is not present then get yesterday's file
python python-3.x
closed as unclear what you're asking by tripleee, petezurich, bummi, Matthias, jpp Nov 17 '18 at 20:12
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
Title - File checking python script
In python how i can know the today's files is exist or not in folder, if file is not present then get yesterday's file
python python-3.x
closed as unclear what you're asking by tripleee, petezurich, bummi, Matthias, jpp Nov 17 '18 at 20:12
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
2
Possible duplicate of How do I check whether a file exists without exceptions?
– Christian König
Nov 16 '18 at 7:48
Your question is probably going to get closed as it is unclear what you're asking. Learn how to ask a good question. stackoverflow.com/help/how-to-ask
– Infected Drake
Nov 16 '18 at 7:52
add a comment |
Title - File checking python script
In python how i can know the today's files is exist or not in folder, if file is not present then get yesterday's file
python python-3.x
Title - File checking python script
In python how i can know the today's files is exist or not in folder, if file is not present then get yesterday's file
python python-3.x
python python-3.x
edited Nov 16 '18 at 7:58
petezurich
3,73581936
3,73581936
asked Nov 16 '18 at 7:46
Er AnjumEr Anjum
116
116
closed as unclear what you're asking by tripleee, petezurich, bummi, Matthias, jpp Nov 17 '18 at 20:12
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by tripleee, petezurich, bummi, Matthias, jpp Nov 17 '18 at 20:12
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
2
Possible duplicate of How do I check whether a file exists without exceptions?
– Christian König
Nov 16 '18 at 7:48
Your question is probably going to get closed as it is unclear what you're asking. Learn how to ask a good question. stackoverflow.com/help/how-to-ask
– Infected Drake
Nov 16 '18 at 7:52
add a comment |
2
Possible duplicate of How do I check whether a file exists without exceptions?
– Christian König
Nov 16 '18 at 7:48
Your question is probably going to get closed as it is unclear what you're asking. Learn how to ask a good question. stackoverflow.com/help/how-to-ask
– Infected Drake
Nov 16 '18 at 7:52
2
2
Possible duplicate of How do I check whether a file exists without exceptions?
– Christian König
Nov 16 '18 at 7:48
Possible duplicate of How do I check whether a file exists without exceptions?
– Christian König
Nov 16 '18 at 7:48
Your question is probably going to get closed as it is unclear what you're asking. Learn how to ask a good question. stackoverflow.com/help/how-to-ask
– Infected Drake
Nov 16 '18 at 7:52
Your question is probably going to get closed as it is unclear what you're asking. Learn how to ask a good question. stackoverflow.com/help/how-to-ask
– Infected Drake
Nov 16 '18 at 7:52
add a comment |
1 Answer
1
active
oldest
votes
You can do this with Python's simple error handling:
try:
open('directory/name_of_todays_file', 'r')
print('todays file exists')
except:
open('directory/name_of_yesterdays_file', 'r')
print('todays file does not exist')
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can do this with Python's simple error handling:
try:
open('directory/name_of_todays_file', 'r')
print('todays file exists')
except:
open('directory/name_of_yesterdays_file', 'r')
print('todays file does not exist')
add a comment |
You can do this with Python's simple error handling:
try:
open('directory/name_of_todays_file', 'r')
print('todays file exists')
except:
open('directory/name_of_yesterdays_file', 'r')
print('todays file does not exist')
add a comment |
You can do this with Python's simple error handling:
try:
open('directory/name_of_todays_file', 'r')
print('todays file exists')
except:
open('directory/name_of_yesterdays_file', 'r')
print('todays file does not exist')
You can do this with Python's simple error handling:
try:
open('directory/name_of_todays_file', 'r')
print('todays file exists')
except:
open('directory/name_of_yesterdays_file', 'r')
print('todays file does not exist')
edited Nov 16 '18 at 7:54
Pang
6,9891666105
6,9891666105
answered Nov 16 '18 at 7:52
hhaefligerhhaefliger
29712
29712
add a comment |
add a comment |
2
Possible duplicate of How do I check whether a file exists without exceptions?
– Christian König
Nov 16 '18 at 7:48
Your question is probably going to get closed as it is unclear what you're asking. Learn how to ask a good question. stackoverflow.com/help/how-to-ask
– Infected Drake
Nov 16 '18 at 7:52