Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Practicum Lecture Notes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Saleh Aghajani
Practicum Lecture Notes
Commits
f357ef74
Commit
f357ef74
authored
5 years ago
by
Gary Steele
Browse files
Options
Downloads
Patches
Plain Diff
tidy up
parent
6f667bfa
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
create zipfile.ipynb
+1
-22
1 addition, 22 deletions
create zipfile.ipynb
create zipfile.md
+0
-3
0 additions, 3 deletions
create zipfile.md
with
1 addition
and
25 deletions
create zipfile.ipynb
+
1
−
22
View file @
f357ef74
...
...
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count":
43
,
"execution_count":
2
,
"metadata": {},
"outputs": [
{
...
...
@@ -10,40 +10,22 @@
"output_type": "stream",
"text": [
"Notebook 3/Notebook 3 Program Flow Control.ipynb\n",
"Notebook 3 Program Flow Control.ipynb\n",
"Notebook 4/Notebook 4 Scientific Computing with Numpy.ipynb\n",
"Notebook 4 Scientific Computing with Numpy.ipynb\n",
"Notebook 5/Notebook 5 Data in Python.ipynb\n",
"Notebook 5 Data in Python.ipynb\n",
"Notebook 2/Notebook 2 Functions.ipynb\n",
"Notebook 2 Functions.ipynb\n",
"Notebook 1/Notebook 1 Python Basics.ipynb\n",
"Notebook 1 Python Basics.ipynb\n",
"Course_Information/Frequently Asked Questions.ipynb\n",
"Frequently Asked Questions.ipynb\n",
"Course_Information/Python in the practicum.md\n",
"Python in the practicum.md\n",
"Course_Information/cell_type.png\n",
"cell_type.png\n",
"Course_Information/Installation Instructions.md\n",
"Installation Instructions.md\n",
"Course_Information/Python in the practicum.ipynb\n",
"Python in the practicum.ipynb\n",
"Course_Information/Installation Instructions.ipynb\n",
"Installation Instructions.ipynb\n",
"Course_Information/Frequently Asked Questions.md\n",
"Frequently Asked Questions.md\n",
"Notebook 1/anatomy_of_an_error.png\n",
"anatomy_of_an_error.png\n",
"Notebook 1/behind_the_scenes.png\n",
"behind_the_scenes.png\n",
"Notebook 1/stop_button.png\n",
"stop_button.png\n",
"Notebook 5/exercise_data.dat\n",
"exercise_data.dat\n",
"Notebook 5/v_vs_time.dat\n",
"v_vs_time.dat\n",
"Outline of notebooks.ipynb\n",
"Outline of notebooks.ipynb\n"
]
}
...
...
@@ -51,7 +33,6 @@
"source": [
"# https://stackoverflow.com/questions/458436/adding-folders-to-a-zip-file-using-python\n",
"import zipfile\n",
"import os\n",
"from glob import glob\n",
"from datetime import datetime\n",
"\n",
...
...
@@ -67,9 +48,7 @@
"files += glob(\"Outline of notebooks.ipynb\")\n",
"\n",
"for f in files:\n",
" fname = os.path.basename(f)\n",
" print(f)\n",
" print(fname)\n",
" outfile.write(f,f,zipfile.ZIP_DEFLATED)\n",
"\n",
"outfile.close()"
...
...
%% Cell type:code id: tags:
```
python
# https://stackoverflow.com/questions/458436/adding-folders-to-a-zip-file-using-python
import
zipfile
import
os
from
glob
import
glob
from
datetime
import
datetime
outname
=
"
Lecture_Notebooks_
"
+
datetime
.
now
().
strftime
(
"
%Y-%m-%d
"
)
+
"
.zip
"
outfile
=
zipfile
.
ZipFile
(
outname
,
"
w
"
)
files
=
[]
files
+=
glob
(
"
*/Notebook*ipynb
"
)
files
+=
glob
(
"
Course_Information/*
"
)
files
+=
glob
(
"
Notebook*/*png
"
)
files
+=
glob
(
"
Notebook 5/exercise_data.dat
"
)
files
+=
glob
(
"
Notebook 5/v_vs_time.dat
"
)
files
+=
glob
(
"
Outline of notebooks.ipynb
"
)
for
f
in
files
:
fname
=
os
.
path
.
basename
(
f
)
print
(
f
)
print
(
fname
)
outfile
.
write
(
f
,
f
,
zipfile
.
ZIP_DEFLATED
)
outfile
.
close
()
```
%% Output
Notebook 3/Notebook 3 Program Flow Control.ipynb
Notebook 3 Program Flow Control.ipynb
Notebook 4/Notebook 4 Scientific Computing with Numpy.ipynb
Notebook 4 Scientific Computing with Numpy.ipynb
Notebook 5/Notebook 5 Data in Python.ipynb
Notebook 5 Data in Python.ipynb
Notebook 2/Notebook 2 Functions.ipynb
Notebook 2 Functions.ipynb
Notebook 1/Notebook 1 Python Basics.ipynb
Notebook 1 Python Basics.ipynb
Course_Information/Frequently Asked Questions.ipynb
Frequently Asked Questions.ipynb
Course_Information/Python in the practicum.md
Python in the practicum.md
Course_Information/cell_type.png
cell_type.png
Course_Information/Installation Instructions.md
Installation Instructions.md
Course_Information/Python in the practicum.ipynb
Python in the practicum.ipynb
Course_Information/Installation Instructions.ipynb
Installation Instructions.ipynb
Course_Information/Frequently Asked Questions.md
Frequently Asked Questions.md
Notebook 1/anatomy_of_an_error.png
anatomy_of_an_error.png
Notebook 1/behind_the_scenes.png
behind_the_scenes.png
Notebook 1/stop_button.png
stop_button.png
Notebook 5/exercise_data.dat
exercise_data.dat
Notebook 5/v_vs_time.dat
v_vs_time.dat
Outline of notebooks.ipynb
Outline of notebooks.ipynb
...
...
This diff is collapsed.
Click to expand it.
create zipfile.md
+
0
−
3
View file @
f357ef74
...
...
@@ -16,7 +16,6 @@ jupyter:
```
python
# https://stackoverflow.com/questions/458436/adding-folders-to-a-zip-file-using-python
import
zipfile
import
os
from
glob
import
glob
from
datetime
import
datetime
...
...
@@ -32,9 +31,7 @@ files += glob("Notebook 5/v_vs_time.dat")
files
+=
glob
(
"
Outline of notebooks.ipynb
"
)
for
f
in
files
:
fname
=
os
.
path
.
basename
(
f
)
print
(
f
)
print
(
fname
)
outfile
.
write
(
f
,
f
,
zipfile
.
ZIP_DEFLATED
)
outfile
.
close
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment