Skip to content

Commit 4a9a2dd

Browse files
author
zspatter
committed
Embeds sample output in README
1 parent 7eac32b commit 4a9a2dd

17 files changed

Lines changed: 89 additions & 4 deletions

File tree

chapter_projects/archive_directory/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
This script has a function that compresses a directory (including all subdirectories and thier contents). The desired directory's path is an argument to the function. This will makes an effort to exclude the unneccesary directories from the absolute path (path starts at the argument's path). The .zip is of the same name as the directory being compressed. This mirrors the behavior of native features of all major OS's to compress files/folders from the file viewer.
44

5-
Ideas for similar programs:
5+
## Sample Output
6+
<p align=center>
7+
<img src=./sample_output.png alt=sample console output>
8+
</p>
9+
10+
## Ideas for similar programs:
611
* Walk a directory tree and archive just files with certain extensions, such as .txt or .py, and nothing else
712
* Walk a directory tree and archive every file except the .txt and .py ones
813
* Find the folder in a directory tree that has the greatest number of files or the folder that uses the most disk space
14+

chapter_projects/date_converter/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ This means the code will need to do the following:
1010
* Call `os.listdir()` to find all the files in the working directory
1111
* Loop over each filename, using the regex to check whether it has a date
1212
* If it has a date, rename the file with `shutil.move()`
13+
14+
## Sample Output
15+
<p align=center>
16+
<img src=./sample_output.png alt=sample console output>
17+
</p>

chapter_projects/password_locker/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ The password manager program you’ll create in this example isn’t secure, but
55
This script can be run with a command line argument that is the account's name (for example, email or blog). The password associated with the account will be copied to the clipboard so that the user can paste it into a Password field.
66

77
This script demonstrates how to automate the retrieval of commonly referenced text.
8+
9+
## Sample Output
10+
<p align=center>
11+
<img src=./sample_output.png alt=sample console output>
12+
</p>

chapter_projects/phone_email_extractor/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This simple script scans the contents of the clipboard for entries that match either the phone number or email regex patterns. If there are any matches found, they are converted to a standard format and pasted to the clipboard.
44

5+
## Sample Output
6+
<p align=center>
7+
<img src=./sample_output.png alt=sample console output>
8+
</p>
9+
510
## Similar Uses
611
* Find website URLs that begin with http:// or https://
712
* Clean up dates in different date formats (such as 3/14/2015, 03-14-2015, and 2015/3/14) by replacing them with dates in a single, standard format

character_picture_grid/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,9 @@ Copy the previous grid value, and write code that uses it to print the image.
2121
..OOOOO..
2222
...OOO...
2323
....O....
24-
```
24+
```
25+
26+
## Sample Output
27+
<p align=center>
28+
<img src=./sample_output.png alt=sample console output>
29+
</p>

collatz_sequence/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ Enter number: 3
2121

2222
## Input Validation
2323
Add try and except statements to the previous project to detect whether the user types in a noninteger string. Normally, the int() function will raise a ValueError error if it is passed a noninteger string, as in int('puppy'). In the except clause, print a message to the user saying they must enter an integer.
24+
25+
## Sample Output
26+
<p align=center>
27+
<img src=./sample_output.png alt=sample console output>
28+
</p>

comma_code/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,9 @@ Say you have a list value like this:
55
spam = ['apples', 'bananas', 'tofu', 'cats']
66
```
77

8-
Write a function that takes a list value as an argument and returns a string with all the items separated by a comma and a space, with and inserted before the last item. For example, passing the previous spam list to the function would return 'apples, bananas, tofu, and cats'. But your function should be able to work with any list value passed to it.
8+
Write a function that takes a list value as an argument and returns a string with all the items separated by a comma and a space, with and inserted before the last item. For example, passing the previous spam list to the function would return 'apples, bananas, tofu, and cats'. But your function should be able to work with any list value passed to it.
9+
10+
## Sample Output
11+
<p align=center>
12+
<img src=./sample_output.png alt=sample console output>
13+
</p>

debugging_coin_toss/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ else:
2020
```
2121

2222
This is just a simple debugging exercise. I chose to add some logging to the script which indicates where control currently is as well as variable values.
23+
24+
## Sample Output
25+
<p align=center>
26+
<img src=./sample_output.png alt=sample console output>
27+
</p>

fantasy_game_inventory/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ Inventory:
3232
3333
Total number of items: 48
3434
```
35+
36+
## Sample Output
37+
<p align=center>
38+
<img src=./sample_output.png alt=sample console output>
39+
</p>

fill_gaps/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22
Write a program that finds all files with a given prefix, such as _spam001.txt_, _spam002.txt_, and so on, in a single folder and locates any gaps in the numbering (such as if there is a _spam001.txt_ and _spam003.txt_ but no _spam002.txt_). Have the program rename all the later files to close this gap.
33

44
As an added challenge, write another program that can insert gaps into numbered files so that a new file can be added.
5+
6+
## Sample Output
7+
<p align=center>
8+
<img src=./sample_output.png alt=sample console output>
9+
</p>

0 commit comments

Comments
 (0)