From 3126dcd56443e0007f8a7ab0f512da9551c5bae3 Mon Sep 17 00:00:00 2001 From: nicolafavero <61919460+nicolafavero@users.noreply.github.com> Date: Fri, 11 Sep 2020 18:27:15 +0200 Subject: [PATCH 1/5] Sistemato percorso file immagine dell'esempio 1st_edition/art --- .vscode/settings.json | 3 +++ 1st_edition/art/matplotlib1.py | 5 ++++- 1st_edition/art/oreilly.png | Bin 0 -> 2058 bytes 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .vscode/settings.json create mode 100644 1st_edition/art/oreilly.png diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c8182d6 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/Users/nicola/opt/anaconda3/bin/python" +} \ No newline at end of file diff --git a/1st_edition/art/matplotlib1.py b/1st_edition/art/matplotlib1.py index 2cffca2..8cb2340 100644 --- a/1st_edition/art/matplotlib1.py +++ b/1st_edition/art/matplotlib1.py @@ -1,6 +1,9 @@ import matplotlib.pyplot as plot import matplotlib.image as image +import os -img = image.imread('oreilly.png') + +strPath = os.getcwd() + "/1st_edition/art/" +img = image.imread(strPath + "oreilly.png") plot.imshow(img) plot.show() diff --git a/1st_edition/art/oreilly.png b/1st_edition/art/oreilly.png new file mode 100644 index 0000000000000000000000000000000000000000..b018be4ea283be0513cec0a4da62b7329bec95c2 GIT binary patch literal 2058 zcmbVM`#Td18=jO8iP*{^?_1B(Q5`ga@;9&230KPuLxQ?`CoqVzqYUbrioYA1+Cqp*@ewT{`v@0BHCPM zOo?XZHrU+xXKyAh#xgI*GcU#Q3J8+*jk%(#F*|?q_M`m(=4u{WkkHPI%45T zJLoLp@F?;YWU0e+^UJe2xb+FnfU51%hi@xC`lj#YZ!Rp01wxwMS-R;Z!M9HGHWO~f zGfw=&xuR-z7<#dyk*4E9mOjGrPugJ3aBe@GxDd1ak+kxwfBOF8%_YIm0hnY{EbJZP z#OACGj?whp#vOwwTWs+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%Y}`s6Hrz=Tp=b8!{B&^9#Y@o z4o0b?IRb*G$><$r97J6rcD?{7uG8dliX+uLcwB{zIkA{+V@fo)n)ss z^9CJ;sJrgYpl!KH$<%$BKcyyA3*J8NmI4^pzY)o^jyIlGML*BnIN8y%b6UI_b8W}{ pByp&c;`V?4S+dAypWTK31AF#AxLuCz&b<6@iWAh$p%!vI^&i{$7l8l( literal 0 HcmV?d00001 From 4aaa63dbb6dd20a40526782f1f1fa590cce381d6 Mon Sep 17 00:00:00 2001 From: nicolafavero <61919460+nicolafavero@users.noreply.github.com> Date: Fri, 11 Sep 2020 18:34:41 +0200 Subject: [PATCH 2/5] Using os.path.dirname() --- 1st_edition/art/matplotlib1.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/1st_edition/art/matplotlib1.py b/1st_edition/art/matplotlib1.py index 8cb2340..8c38068 100644 --- a/1st_edition/art/matplotlib1.py +++ b/1st_edition/art/matplotlib1.py @@ -3,7 +3,8 @@ import os -strPath = os.getcwd() + "/1st_edition/art/" -img = image.imread(strPath + "oreilly.png") +#strPath = os.getcwd() + "/1st_edition/art/" +strPath = os.path.dirname(__file__) +img = image.imread(strPath + "/oreilly.png") plot.imshow(img) plot.show() From 4aa440eed9dbf42f6894b5fd56ae8757dec3a264 Mon Sep 17 00:00:00 2001 From: nicolafavero <61919460+nicolafavero@users.noreply.github.com> Date: Thu, 17 Sep 2020 16:22:29 +0200 Subject: [PATCH 3/5] Attivato pylint --- .vscode/settings.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c8182d6..9555466 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,5 @@ { - "python.pythonPath": "/Users/nicola/opt/anaconda3/bin/python" + "python.pythonPath": "/Users/nicola/opt/anaconda3/bin/python", + "python.linting.pylintEnabled": true, + "python.linting.enabled": true } \ No newline at end of file From e1689b815aa8b220ab51d3c0ef92045643e8f952 Mon Sep 17 00:00:00 2001 From: nicolafavero <61919460+nicolafavero@users.noreply.github.com> Date: Fri, 18 Sep 2020 17:50:43 +0200 Subject: [PATCH 4/5] Added ch06 --- ch06/looping.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ch06/looping.py diff --git a/ch06/looping.py b/ch06/looping.py new file mode 100644 index 0000000..e69de29 From 7c8e552ca5bddd3b8607eec183b4e7abd63710da Mon Sep 17 00:00:00 2001 From: nicolafavero <61919460+nicolafavero@users.noreply.github.com> Date: Fri, 18 Sep 2020 17:54:01 +0200 Subject: [PATCH 5/5] *** --- ch06/looping.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ch06/looping.py b/ch06/looping.py index e69de29..6ede7c2 100644 --- a/ch06/looping.py +++ b/ch06/looping.py @@ -0,0 +1,5 @@ +# From Chapter 6 + +for x in range ( 2 , 1 , 1 ): + print(x) + \ No newline at end of file