File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Open diff view settings
Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Open diff view settings
Original file line number Diff line number Diff line change 7474 " - 09:30-09:45: [0:15] **Introduction**\n " ,
7575 " - 09:45-11:30: [1:45] **Session 1.1** - Starting with data and python\n " ,
7676 " - 11:30-11:45: [0:15] *break*\n " ,
77- " - 11:45-12:30: [0:45] **Session 1.2** - Using existing python modules to explore data in files\n " ,
77+ " - 11:45-12:30: [0:45] **Session 1.2** - Using existing python modules to explore data in files (part 1) \n " ,
7878 " - 12:30-13:30: [1:00] *lunch break*\n " ,
79- " - 13:30-14:30: [1:00] **Session 1.2**\n " ,
79+ " - 13:30-14:30: [1:00] **Session 1.2** - Using existing python modules to explore data in files (part 2) \n " ,
8080 " - 14:30-14:45: [0:15] *break*\n " ,
8181 " - 14:45-16:30: [1:45] **Session 1.3** - Creating functions and modules to write reusable code"
8282 ]
Original file line number Diff line number Diff line change 344344 "source" : [
345345 " ## Exercise 1.2.2\n " ,
346346 " \n " ,
347- " - List all `.txt` files from the `data` directory, print their file path only it is a file.\n " ,
347+ " - List all `.txt` files from the `data` directory, print their file path only if it is a file.\n " ,
348348 " - Check that the file `genes.txt` exists in `data/`, open the tab separated file, and calculate the length of each genes."
349349 ]
350350 },
Original file line number Diff line number Diff line change 66 "source" : [
77 " # Solution to exercise 1.2.2\n " ,
88 " \n " ,
9- " - List all `.txt` files from the `data` directory, print their file path only it is a file.\n " ,
9+ " - List all `.txt` files from the `data` directory, print their file path only if it is a file.\n " ,
1010 " - Check that the file `genes.txt` exists in `data/`, open the tab separated file, and calculate the length of each genes."
1111 ]
1212 },
2020 " dirname = '../data'\n " ,
2121 " for filename in os.listdir(dirname):\n " ,
2222 " filepath = os.path.join(dirname, filename)\n " ,
23- " if os.path.isfile(filepath):\n " ,
23+ " if os.path.isfile(filepath) and filename.endswith('.txt') :\n " ,
2424 " print(filepath)"
2525 ]
2626 },
You can’t perform that action at this time.
0 commit comments