From b52422b399e71d94bffc7f8bff0483aa460fac9c Mon Sep 17 00:00:00 2001 From: Ryan Soklaski Date: Sun, 31 Jan 2021 14:11:36 -0500 Subject: [PATCH 1/5] add discussion of copying code snippets. Closes #34 --- .../SiteFormatting.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/Python/Module1_GettingStartedWithPython/SiteFormatting.md b/Python/Module1_GettingStartedWithPython/SiteFormatting.md index bd1c539e..eeefad31 100644 --- a/Python/Module1_GettingStartedWithPython/SiteFormatting.md +++ b/Python/Module1_GettingStartedWithPython/SiteFormatting.md @@ -70,3 +70,31 @@ Lastly, the input and output of an iPython console and a Jupyter notebook alike ```python 2 + 3 ``` + +## Running Code Snippets from this Site + +In PLYMI, we typically precede every code snippet with one or more commented lines. +This is useful because it makes a page more "skimmable", since the code snippets essentially come with +descriptive, self-explanatory captions. +That being said, there is a downside to this. + +Python terminals don't like having multiple comment likes precede an input-prompt. +E.g. if you paste and run the following code into a terminal + +```python +# demonstrating the distinction of +# input and output via >>> + +>>> x = 1 +``` + +you will get a syntax error. +To fix this issue, simply exclude the comments when you copy this block to your clipboard. +Running + +```python +>>> x = 1 +``` + +will work without any issue. +Keep this in mind if you ever find yourself having trouble running code that you copied from this site. From 41e176d8bcf977d2bf24e065d144a3a47ae4059e Mon Sep 17 00:00:00 2001 From: Ryan Soklaski Date: Sun, 31 Jan 2021 14:16:33 -0500 Subject: [PATCH 2/5] fix notebook formatting --- Python/Module1_GettingStartedWithPython/SiteFormatting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/Module1_GettingStartedWithPython/SiteFormatting.md b/Python/Module1_GettingStartedWithPython/SiteFormatting.md index eeefad31..658e62d4 100644 --- a/Python/Module1_GettingStartedWithPython/SiteFormatting.md +++ b/Python/Module1_GettingStartedWithPython/SiteFormatting.md @@ -65,7 +65,6 @@ We can spend some time talking about `my_func` and then see it in action: ``` Lastly, the input and output of an iPython console and a Jupyter notebook alike is displayed as follows: - ```python 2 + 3 @@ -98,3 +97,4 @@ Running will work without any issue. Keep this in mind if you ever find yourself having trouble running code that you copied from this site. + \ No newline at end of file From 929c88d79cbe571f57e92154bf5371e5ca42b407 Mon Sep 17 00:00:00 2001 From: Ryan Soklaski Date: Sun, 31 Jan 2021 14:18:36 -0500 Subject: [PATCH 3/5] Add metadata to homepage for SEO --- Python/index.rst | 4 ++++ Python/intro.rst | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Python/index.rst b/Python/index.rst index a29fd418..475dee10 100644 --- a/Python/index.rst +++ b/Python/index.rst @@ -1,3 +1,7 @@ +.. meta:: + :description: Topic: Top page of Python Like You Mean It, Difficulty: Easy, Category: Introduction + :keywords: PLYMI, home page, Python Like You Mean It, tutorial, python for machine learning, numpy, python from scratch, python for data science + ======================= Python Like You Mean It ======================= diff --git a/Python/intro.rst b/Python/intro.rst index e094a78c..3bd19dfa 100644 --- a/Python/intro.rst +++ b/Python/intro.rst @@ -1,3 +1,7 @@ +.. meta:: + :description: Topic: Top page of Python Like You Mean It, Difficulty: Easy, Category: Introduction + :keywords: PLYMI, home page, Python Like You Mean It, tutorial, python for machine learning, numpy, python from scratch, python for data science + ======================= Python Like You Mean It ======================= From cc1ad237c0b7ae1d61678034971e28df767d3f9c Mon Sep 17 00:00:00 2001 From: Ryan Soklaski Date: Sun, 31 Jan 2021 14:25:21 -0500 Subject: [PATCH 4/5] improve keywords and mention teaching/college/high school --- Python/index.rst | 5 +++-- Python/intro.rst | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Python/index.rst b/Python/index.rst index 475dee10..d2e400d2 100644 --- a/Python/index.rst +++ b/Python/index.rst @@ -1,6 +1,6 @@ .. meta:: :description: Topic: Top page of Python Like You Mean It, Difficulty: Easy, Category: Introduction - :keywords: PLYMI, home page, Python Like You Mean It, tutorial, python for machine learning, numpy, python from scratch, python for data science + :keywords: PLYMI, Python Like You Mean It, tutorial, python for machine learning, python for deep learning, python for data science, numpy, python from scratch, basic python tutorial, teaching python ======================= Python Like You Mean It @@ -17,6 +17,7 @@ What this is Python Like You Mean It (PLYMI) is a free resource for learning the basics of Python & NumPy, and moreover, becoming a competent Python user. The features of the Python language that are emphasized here were chosen to help those who are particularly interested in STEM applications (data analysis, machine learning, numerical work, etc.). I want this to be a lean, one-stop resource for learning the essentials of Python from scratch. The reader will begin by learning about what Python is and what installing Python even means, and will hopefully walk away with a solid understanding of a substantial core of the language and its premiere numerical library, NumPy. I am also placing an emphasis on best practices throughout this site and am teaching to the latest version of Python (version 3.9, as of writing this). +This material has proven to be fruitful for high school and college teachers alike to teach Python as part of their STEM curriculum. What this isn't @@ -62,7 +63,7 @@ The following people made significant contributions to PLYMI, adding problems wi About Me -------- -I started learning to use Python in graduate school for my physics research, and I was *so* bad at using it. Fortunately, one of my labmates was more experienced and had the good sense to tell me that my code and work flow was terrible. He pointed me to tooling, style guides, and documentation pages so that I could improve (I'd like to think that this resource would have been a huge help to me back then). I've been coding in Python for at least six years now, and I've taken to following the language, along with its new features and changes, quite closely. Currently I do machine learning research, and have served as a core developer for a machine learning library. I also love to teach, so this has been a fun project for me to take on! +I started learning to use Python in graduate school for my physics research, and I was *so* bad at using it. Fortunately, one of my labmates was more experienced and had the good sense to tell me that my code and work flow was terrible. He pointed me to tooling, style guides, and documentation pages so that I could improve (I'd like to think that this resource would have been a huge help to me back then). I've been coding in Python for at least eight years now, and I've taken to following the language, along with its new features and changes, quite closely. Currently I do machine learning research, and have served as a core developer for a machine learning library. I also love to teach, so this has been a fun project for me to take on! .. toctree:: diff --git a/Python/intro.rst b/Python/intro.rst index 3bd19dfa..1d822383 100644 --- a/Python/intro.rst +++ b/Python/intro.rst @@ -1,6 +1,6 @@ .. meta:: :description: Topic: Top page of Python Like You Mean It, Difficulty: Easy, Category: Introduction - :keywords: PLYMI, home page, Python Like You Mean It, tutorial, python for machine learning, numpy, python from scratch, python for data science + :keywords: PLYMI, Python Like You Mean It, tutorial, python for machine learning, python for deep learning, python for data science, numpy, python from scratch, basic python tutorial, teaching python ======================= Python Like You Mean It @@ -17,6 +17,7 @@ What this is Python Like You Mean It (PLYMI) is a free resource for learning the basics of Python & NumPy, and moreover, becoming a competent Python user. The features of the Python language that are emphasized here were chosen to help those who are particularly interested in STEM applications (data analysis, machine learning, numerical work, etc.). I want this to be a lean, one-stop resource for learning the essentials of Python from scratch. The reader will begin by learning about what Python is and what installing Python even means, and will hopefully walk away with a solid understanding of a substantial core of the language and its premiere numerical library, NumPy. I am also placing an emphasis on best practices throughout this site and am teaching to the latest version of Python (version 3.9, as of writing this). +This material has proven to be fruitful for high school and college teachers alike to teach Python as part of their STEM curriculum. What this isn't @@ -60,4 +61,4 @@ The following people made significant contributions to PLYMI, adding problems wi About Me -------- -I started learning to use Python in graduate school for my physics research, and I was *so* bad at using it. Fortunately, one of my labmates was more experienced and had the good sense to tell me that my code and work flow was terrible. He pointed me to tooling, style guides, and documentation pages so that I could improve (I'd like to think that this resource would have been a huge help to me back then). I've been coding in Python for at least six years now, and I've taken to following the language, along with its new features and changes, quite closely. Currently I do machine learning research, and have served as a core developer for a machine learning library. I also love to teach, so this has been a fun project for me to take on! +I started learning to use Python in graduate school for my physics research, and I was *so* bad at using it. Fortunately, one of my labmates was more experienced and had the good sense to tell me that my code and work flow was terrible. He pointed me to tooling, style guides, and documentation pages so that I could improve (I'd like to think that this resource would have been a huge help to me back then). I've been coding in Python for at least eight years now, and I've taken to following the language, along with its new features and changes, quite closely. Currently I do machine learning research, and have served as a core developer for a machine learning library. I also love to teach, so this has been a fun project for me to take on! From 56a944c5dfb7b859f27c070461ee50ec8b0eadea Mon Sep 17 00:00:00 2001 From: Ryan Soklaski Date: Sun, 31 Jan 2021 16:42:12 -0500 Subject: [PATCH 5/5] Update Python/Module1_GettingStartedWithPython/SiteFormatting.md Co-authored-by: Petar Griggs --- Python/Module1_GettingStartedWithPython/SiteFormatting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/Module1_GettingStartedWithPython/SiteFormatting.md b/Python/Module1_GettingStartedWithPython/SiteFormatting.md index 658e62d4..482651ca 100644 --- a/Python/Module1_GettingStartedWithPython/SiteFormatting.md +++ b/Python/Module1_GettingStartedWithPython/SiteFormatting.md @@ -77,7 +77,7 @@ This is useful because it makes a page more "skimmable", since the code snippets descriptive, self-explanatory captions. That being said, there is a downside to this. -Python terminals don't like having multiple comment likes precede an input-prompt. +Python terminals don't like having multiple comment lines precede an input-prompt. E.g. if you paste and run the following code into a terminal ```python @@ -97,4 +97,4 @@ Running will work without any issue. Keep this in mind if you ever find yourself having trouble running code that you copied from this site. - \ No newline at end of file +