File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
more-python-for-beginners
06 - Managing the file system
python-for-beginners/11 - Collections Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -23,5 +23,14 @@ def framework(item):
23
23
if isinstance (item , Loggable ):
24
24
item .log ()
25
25
26
+ class JustLog (Loggable ):
27
+ def __init__ (self ):
28
+ self .title = 'Just logging'
29
+
30
+
31
+
26
32
sql_connection = SqlDatabase ()
33
+ jutlog = JustLog ()
27
34
framework (sql_connection )
35
+
36
+ framework (jutlog )
Original file line number Diff line number Diff line change 1
1
from pathlib import Path
2
2
cwd = Path .cwd ()
3
3
4
+ print ('Path ' + cwd .drive )
5
+
4
6
demo_file = Path (Path .joinpath (cwd , 'demo.txt' ))
5
7
6
8
# Get the file name
Original file line number Diff line number Diff line change 2
2
scores = array ('i' )
3
3
scores .append (97 )
4
4
scores .append (98 )
5
- print (scores )
5
+ print (scores )
6
+
7
+ scores2 = ('i' ,97 ,98 )
8
+ print (scores2 )
You can’t perform that action at this time.
0 commit comments