#๐ I need help extracting the right date from my file name
15 messages ยท Page 1 of 1 (latest)
@viral hinge
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
!e
from datetime import datetime
filename = "vso_health_check_20230911_1948.csv"
date_str = filename.split('_')[3][:8]
check_date = datetime.strptime(date_str, '%Y%m%d').date()
print(check_date)
:white_check_mark: Your 3.12 eval job has completed with return code 0.
2023-09-11
looks fine
could I show you my entire codez?
That's what I did?
That's an example showing that your code works
I was wondering If I could show you how my entire code looks like its 58 lines in total
Yeah I missread that, sorry.
Sure.
Hey @viral hinge!
It looks like you are trying to paste code into this channel.
You seem to be using the wrong symbols to indicate where the code block should start. The correct symbols would be ```, not '''.
Here is an example of how it should look:
```
Hello, world!
```
This will result in the following:
Hello, world!```
You can **edit your original message** to correct your code block.
got you
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.