Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Added creation of downloads dir if it doesn't exist for chapter17 flags. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 2 17-futures/countries/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@


def save_flag(img, filename): # <5>
if not os.path.exists(DEST_DIR):
os.makedirs(DEST_DIR)
path = os.path.join(DEST_DIR, filename)
with open(path, 'wb') as fp:
fp.write(img)
Expand Down
2 changes: 2 additions & 0 deletions 2 17-futures/countries/flags2_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@


def save_flag(img, filename):
if not os.path.exists(DEST_DIR):
os.makedirs(DEST_DIR)
path = os.path.join(DEST_DIR, filename)
with open(path, 'wb') as fp:
fp.write(img)
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.