8000 Day 097 - Barebones Flask App directory creation script · stephen-codepython/100DaysOfCode@63d653d · GitHub
[go: up one dir, main page]

Skip to content

Commit 63d653d

Browse files
committed
Day 097 - Barebones Flask App directory creation script
1 parent b9e7346 commit 63d653d

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

097/flask_setup.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!python3
2+
#flask_setup.py is a script to create a default Flask dir setup to start work
3+
#on new Flask projects.
4+
5+
import os
6+
7+
project = input("Please specify a new project path. Folder will be created: ")
8+
9+
os.mkdir(project)
10+
os.chdir(project)
11+
os.mkdir("templates")
12+
os.mkdir("static")
13+
open('app.py', 'w').close()
14+
os.chdir(project + "/templates")
15+
open('index.html', 'w').close()
16+
os.chdir(project + "/static")
17+
open('style.css', 'w').close()

LOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
| 094 | Jul 01, 2017 | [Simple Python script to #scp get a file from a remote host](094) | Script uses the Paramiko package and SCP to pull a log file from a remote host. Can be easily modified and expanded. |
9999
| 095 | Jul 02, 2017 | [Class to cache moviedb API responses #shelve #decorator #namedtuple](095) | Part of challenge 25 solution where we query themoviedb API to get upcoming/now-playing movies or airing tv series to send out mail alerts |
100100
| 096 | Jul 03, 2017 | [Script to measure which 100Days tweets were most successful (RTs / Favs)](096) | Using csv module to parse downloaded archive, tweepy to query status for each tweet, parsing out retweet_count and favorite_count. I add those up and sort the result descending on this combined number. Curious to see what our most popular tweets were ... |
101-
| 097 | Jul 04, 2017 | [TITLE](097) | LEARNING |
101+
| 097 | Jul 04, 2017 | [Create a default #Flask App dir structure for new projects](097) | Unpythonic and simple. A rough script I threw together that creates a basic Flask App directory structure (templates and static folder) with required base files. Will refactor this later but for now it works! |
102102
| 098 | Jul 05, 2017 | [TITLE](098) | LEARNING |
103103
| 099 | Jul 06, 2017 | [TITLE](099) | LEARNING |
104104
| 100 | Jul 07, 2017 | [TITLE](100) | LEARNING |

0 commit comments

Comments
 (0)
0