Skip to content

get sender name and mailing address when downloading attachments #1144

Answered by ecederstrand
bamper197801 asked this question in Q&A
Discussion options

You must be logged in to vote

It's a lot easier to use the stored datetime value if you convert it to a datetime when you read it, instead of using it as a string in your condition:

with open("somefile.txt", "w") as f:
    f.write(some_date.isoformat())

with open("somefile.txt", "r") as f:
    some_date = datetime.fromisoformat(f.read())

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ecederstrand
Comment options

Comment options

You must be logged in to vote
2 replies
@ecederstrand
Comment options

Answer selected by ecederstrand
@bamper197801
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants