diff --git a/04-Milestone Project - 1/01-Milestone Project 1 - Assignment.ipynb b/04-Milestone Project - 1/01-Milestone Project 1 - Assignment.ipynb index 2b887b9dd..cbe4562d8 100644 --- a/04-Milestone Project - 1/01-Milestone Project 1 - Assignment.ipynb +++ b/04-Milestone Project - 1/01-Milestone Project 1 - Assignment.ipynb @@ -27,7 +27,7 @@ "* The board should be printed out every time a player makes a move\n", "* You should be able to accept input of the player position and then place a symbol on the board\n", "\n", - "Feel free to use Google to help you figure anything out (but don't just Google \"Tic Tac Toe in Python\" otherwise you won't learn anything!) Keep in mind that this project can take anywhere between several hours to several days.\n", + "Feel free to use Google or any chatbot to help you figure anything out (but don't just ask \"Tic Tac Toe in Python\" otherwise you won't learn anything!) Keep in mind that this project can take anywhere between several hours to several days.\n", "\n", "There are 4 Jupyter Notebooks related to this assignment:\n", "\n", @@ -51,9 +51,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python [conda env:base] *", "language": "python", - "name": "python3" + "name": "conda-base-py" }, "language_info": { "codemirror_mode": { @@ -65,9 +65,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.6" + "version": "3.12.2" } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/05-Object Oriented Programming/01-Object Oriented Programming.ipynb b/05-Object Oriented Programming/01-Object Oriented Programming.ipynb index 9e93e989d..bed9a66cf 100644 --- a/05-Object Oriented Programming/01-Object Oriented Programming.ipynb +++ b/05-Object Oriented Programming/01-Object Oriented Programming.ipynb @@ -14,7 +14,10 @@ { "cell_type": "markdown", "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "source": [ "# Object Oriented Programming\n", @@ -40,7 +43,10 @@ "cell_type": "code", "execution_count": 1, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -173,7 +179,10 @@ "cell_type": "code", "execution_count": 5, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -260,7 +269,10 @@ "cell_type": "code", "execution_count": 8, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -278,7 +290,10 @@ "cell_type": "code", "execution_count": 9, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -435,7 +450,10 @@ "cell_type": "code", "execution_count": 14, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -724,7 +742,10 @@ "cell_type": "code", "execution_count": 23, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -781,10 +802,6 @@ "\n", "For more great resources on this topic, check out:\n", "\n", - "[Jeff Knupp's Post](https://jeffknupp.com/blog/2014/06/18/improve-your-python-python-classes-and-object-oriented-programming/)\n", - "\n", - "[Mozilla's Post](https://developer.mozilla.org/en-US/Learn/Python/Quickly_Learn_Object_Oriented_Programming)\n", - "\n", "[Tutorial's Point](http://www.tutorialspoint.com/python/python_classes_objects.htm)\n", "\n", "[Official Documentation](https://docs.python.org/3/tutorial/classes.html)" @@ -811,5 +828,5 @@ } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/07-Errors and Exception Handling/04-Unit Testing.ipynb b/07-Errors and Exception Handling/04-Unit Testing.ipynb index 9fe096efd..816ba224c 100644 --- a/07-Errors and Exception Handling/04-Unit Testing.ipynb +++ b/07-Errors and Exception Handling/04-Unit Testing.ipynb @@ -61,9 +61,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "collapsed": true - }, + "metadata": {}, "outputs": [], "source": [ "! pip install pylint" @@ -114,41 +112,117 @@ "output_type": "stream", "text": [ "************* Module simple1\n", - "C: 4, 0: Final newline missing (missing-final-newline)\n", - "C: 1, 0: Missing module docstring (missing-docstring)\n", - "C: 1, 0: Invalid constant name \"a\" (invalid-name)\n", - "C: 2, 0: Invalid constant name \"b\" (invalid-name)\n", - "E: 4, 6: Undefined variable 'B' (undefined-variable)\n", + "simple1.py:1:0: C0114: Missing module docstring (missing-module-docstring)\n", + "simple1.py:1:0: C0103: Constant name \"a\" doesn't conform to UPPER_CASE naming style (invalid-name)\n", + "simple1.py:2:0: C0103: Constant name \"b\" doesn't conform to UPPER_CASE naming style (invalid-name)\n", + "simple1.py:4:6: E0602: Undefined variable 'B' (undefined-variable)\n", + "\n", + "\n", + "Report\n", + "======\n", + "4 statements analysed.\n", + "\n", + "Statistics by type\n", + "------------------\n", + "\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|type |number |old number |difference |%documented |%badname |\n", + "+=========+=======+===========+===========+============+=========+\n", + "|module |1 |1 |= |0.00 |0.00 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|class |0 |NC |NC |0 |0 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|method |0 |NC |NC |0 |0 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|function |0 |1 |-1.00 |0 |0 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "\n", + "\n", + "\n", + "6 lines have been analyzed\n", + "\n", + "Raw metrics\n", + "-----------\n", + "\n", + "+----------+-------+------+---------+-----------+\n", + "|type |number |% |previous |difference |\n", + "+==========+=======+======+=========+===========+\n", + "|code |5 |83.33 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", + "|docstring |0 |0.00 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", + "|comment |0 |0.00 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", + "|empty |1 |16.67 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", + "\n", + "\n", + "\n", + "Duplication\n", + "-----------\n", + "\n", + "+-------------------------+------+---------+-----------+\n", + "| |now |previous |difference |\n", + "+=========================+======+=========+===========+\n", + "|nb duplicated lines |0 |0 |0 |\n", + "+-------------------------+------+---------+-----------+\n", + "|percent duplicated lines |0.000 |0.000 |= |\n", + "+-------------------------+------+---------+-----------+\n", + "\n", + "\n", + "\n", + "Messages by category\n", + "--------------------\n", + "\n", + "+-----------+-------+---------+-----------+\n", + "|type |number |previous |difference |\n", + "+===========+=======+=========+===========+\n", + "|convention |3 |0 |0 |\n", + "+-----------+-------+---------+-----------+\n", + "|refactor |0 |0 |0 |\n", + "+-----------+-------+---------+-----------+\n", + "|warning |0 |0 |0 |\n", + "+-----------+-------+---------+-----------+\n", + "|error |1 |0 |0 |\n", + "+-----------+-------+---------+-----------+\n", + "\n", + "\n", "\n", - "---------------------------------------------------------------------\n", + "Messages\n", + "--------\n", "\n", - "Your code has been rated at -12.50/10 (previous run: 8.33/10, -20.83)\n", + "+-------------------------+------------+\n", + "|message id |occurrences |\n", + "+=========================+============+\n", + "|invalid-name |2 |\n", + "+-------------------------+------------+\n", + "|undefined-variable |1 |\n", + "+-------------------------+------------+\n", + "|missing-module-docstring |1 |\n", + "+-------------------------+------------+\n", "\n", "\n", + "\n", + "\n", + "--------------------------------------------------------------------\n", + "Your code has been rated at 0.00/10 (previous run: 10.00/10, -10.00)\n", "\n" ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "No config file found, using default configuration\n" - ] } ], "source": [ - "! pylint simple1.py" + "! pylint -r y simple1.py" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Pylint first lists some styling issues - it would like to see an extra newline at the end, modules and function definitions should have descriptive docstrings, and single characters are a poor choice for variable names.\n", + "Pylint first lists some styling issues - modules and function definitions should have descriptive docstrings, and single characters are a poor choice for variable names.\n", "\n", "More importantly, however, pylint identified an error in the program - a variable called before assignment. This needs fixing.\n", "\n", - "Note that pylint scored our program a negative 12.5 out of 10. Let's try to improve that!" + "Note that pylint scored our program 0 out of 10. Let's try to improve that!" ] }, { @@ -191,34 +265,103 @@ "name": "stdout", "output_type": "stream", "text": [ - "************* Module simple1\n", - "C: 14, 0: Final newline missing (missing-final-newline)\n", "\n", - "---------------------------------------------------------------------\n", "\n", - "Your code has been rated at 8.33/10 (previous run: -12.50/10, +20.83)\n", + "Report\n", + "======\n", + "6 statements analysed.\n", + "\n", + "Statistics by type\n", + "------------------\n", + "\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|type |number |old number |difference |%documented |%badname |\n", + "+=========+=======+===========+===========+============+=========+\n", + "|module |1 |1 |= |100.00 |0.00 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|class |0 |NC |NC |0 |0 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|method |0 |NC |NC |0 |0 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|function |1 |NC |NC |100.00 |0.00 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "\n", + "\n", + "\n", + "16 lines have been analyzed\n", + "\n", + "Raw metrics\n", + "-----------\n", + "\n", + "+----------+-------+------+---------+-----------+\n", + "|type |number |% |previous |difference |\n", + "+==========+=======+======+=========+===========+\n", + "|code |7 |43.75 |5 |+2.00 |\n", + "+----------+-------+------+---------+-----------+\n", + "|docstring |6 |37.50 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", + "|comment |0 |0.00 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", + "|empty |3 |18.75 |1 |+2.00 |\n", + "+----------+-------+------+---------+-----------+\n", + "\n", + "\n", + "\n", + "Duplication\n", + "-----------\n", + "\n", + "+-------------------------+------+---------+-----------+\n", + "| |now |previous |difference |\n", + "+=========================+======+=========+===========+\n", + "|nb duplicated lines |0 |0 |0 |\n", + "+-------------------------+------+---------+-----------+\n", + "|percent duplicated lines |0.000 |0.000 |= |\n", + "+-------------------------+------+---------+-----------+\n", + "\n", + "\n", + "\n", + "Messages by category\n", + "--------------------\n", "\n", + "+-----------+-------+---------+-----------+\n", + "|type |number |previous |difference |\n", + "+===========+=======+=========+===========+\n", + "|convention |0 |3 |3 |\n", + "+-----------+-------+---------+-----------+\n", + "|refactor |0 |0 |0 |\n", + "+-----------+-------+---------+-----------+\n", + "|warning |0 |0 |0 |\n", + "+-----------+-------+---------+-----------+\n", + "|error |0 |1 |1 |\n", + "+-----------+-------+---------+-----------+\n", "\n", + "\n", + "\n", + "Messages\n", + "--------\n", + "\n", + "+-----------+------------+\n", + "|message id |occurrences |\n", + "+===========+============+\n", + "\n", + "\n", + "\n", + "\n", + "--------------------------------------------------------------------\n", + "Your code has been rated at 10.00/10 (previous run: 0.00/10, +10.00)\n", "\n" ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "No config file found, using default configuration\n" - ] } ], "source": [ - "! pylint simple1.py" + "! pylint -r y simple1.py" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "Much better! Our score climbed to 8.33 out of 10. Unfortunately, the final newline has to do with how jupyter writes to a file, and there's not much we can do about that here. Still, pylint helped us troubleshoot some of our problems. But what if the problem was more complex?" + "Excellent! Our score climbed to 10 out of 10. But what if the problem was more complex?" ] }, { @@ -262,27 +405,99 @@ "output_type": "stream", "text": [ "************* Module simple2\n", - "C: 14, 0: Final newline missing (missing-final-newline)\n", - "W: 10, 4: Unused variable 'second' (unused-variable)\n", + "simple2.py:10:4: W0612: Unused variable 'second' (unused-variable)\n", + "\n", + "\n", + "Report\n", + "======\n", + "6 statements analysed.\n", + "\n", + "Statistics by type\n", + "------------------\n", + "\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|type |number |old number |difference |%documented |%badname |\n", + "+=========+=======+===========+===========+============+=========+\n", + "|module |1 |1 |= |100.00 |0.00 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|class |0 |NC |NC |0 |0 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|method |0 |NC |NC |0 |0 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "|function |1 |1 |= |100.00 |0.00 |\n", + "+---------+-------+-----------+-----------+------------+---------+\n", + "\n", + "\n", + "\n", + "16 lines have been analyzed\n", + "\n", + "Raw metrics\n", + "-----------\n", + "\n", + "+----------+-------+------+---------+-----------+\n", + "|type |number |% |previous |difference |\n", + "+==========+=======+======+=========+===========+\n", + "|code |7 |43.75 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", + "|docstring |6 |37.50 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", + "|comment |0 |0.00 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", + "|empty |3 |18.75 |NC |NC |\n", + "+----------+-------+------+---------+-----------+\n", "\n", - "------------------------------------------------------------------\n", "\n", - "Your code has been rated at 6.67/10 (previous run: 6.67/10, +0.00)\n", "\n", + "Duplication\n", + "-----------\n", "\n", + "+-------------------------+------+---------+-----------+\n", + "| |now |previous |difference |\n", + "+=========================+======+=========+===========+\n", + "|nb duplicated lines |0 |0 |0 |\n", + "+-------------------------+------+---------+-----------+\n", + "|percent duplicated lines |0.000 |0.000 |= |\n", + "+-------------------------+------+---------+-----------+\n", + "\n", + "\n", + "\n", + "Messages by category\n", + "--------------------\n", + "\n", + "+-----------+-------+---------+-----------+\n", + "|type |number |previous |difference |\n", + "+===========+=======+=========+===========+\n", + "|convention |0 |0 |0 |\n", + "+-----------+-------+---------+-----------+\n", + "|refactor |0 |0 |0 |\n", + "+-----------+-------+---------+-----------+\n", + "|warning |1 |1 |1 |\n", + "+-----------+-------+---------+-----------+\n", + "|error |0 |0 |0 |\n", + "+-----------+-------+---------+-----------+\n", + "\n", + "\n", + "\n", + "Messages\n", + "--------\n", + "\n", + "+----------------+------------+\n", + "|message id |occurrences |\n", + "+================+============+\n", + "|unused-variable |1 |\n", + "+----------------+------------+\n", + "\n", + "\n", + "\n", + "\n", + "------------------------------------------------------------------\n", + "Your code has been rated at 8.33/10 (previous run: 8.33/10, +0.00)\n", "\n" ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "No config file found, using default configuration\n" - ] } ], "source": [ - "! pylint simple2.py" + "! pylint -r y simple2.py" ] }, { @@ -370,15 +585,15 @@ "metadata": {}, "outputs": [ { - "name": "stderr", + "name": "stdout", "output_type": "stream", "text": [ "F.\n", "======================================================================\n", - "FAIL: test_multiple_words (__main__.TestCap)\n", + "FAIL: test_multiple_words (__main__.TestCap.test_multiple_words)\n", "----------------------------------------------------------------------\n", "Traceback (most recent call last):\n", - " File \"test_cap.py\", line 14, in test_multiple_words\n", + " File \"/Users/marci/GIT/Udemy/Complete-Python-3-Bootcamp/07-Errors and Exception Handling/test_cap.py\", line 14, in test_multiple_words\n", " self.assertEqual(result, 'Monty Python')\n", "AssertionError: 'Monty python' != 'Monty Python'\n", "- Monty python\n", @@ -430,7 +645,7 @@ "metadata": {}, "outputs": [ { - "name": "stderr", + "name": "stdout", "output_type": "stream", "text": [ "..\n", @@ -499,15 +714,15 @@ "metadata": {}, "outputs": [ { - "name": "stderr", + "name": "stdout", "output_type": "stream", "text": [ "..F\n", "======================================================================\n", - "FAIL: test_with_apostrophes (__main__.TestCap)\n", + "FAIL: test_with_apostrophes (__main__.TestCap.test_with_apostrophes)\n", "----------------------------------------------------------------------\n", "Traceback (most recent call last):\n", - " File \"test_cap.py\", line 19, in test_with_apostrophes\n", + " File \"/Users/marci/GIT/Udemy/Complete-Python-3-Bootcamp/07-Errors and Exception Handling/test_cap.py\", line 19, in test_with_apostrophes\n", " self.assertEqual(result, \"Monty Python's Flying Circus\")\n", "AssertionError: \"Monty Python'S Flying Circus\" != \"Monty Python's Flying Circus\"\n", "- Monty Python'S Flying Circus\n", @@ -544,9 +759,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python [conda env:base] *", "language": "python", - "name": "python3" + "name": "conda-base-py" }, "language_info": { "codemirror_mode": { @@ -558,9 +773,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.6" + "version": "3.12.2" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/10-Python Decorators/02-Decorators Homework.ipynb b/10-Python Decorators/02-Decorators Homework.ipynb index a142c665f..075767ba0 100644 --- a/10-Python Decorators/02-Decorators Homework.ipynb +++ b/10-Python Decorators/02-Decorators Homework.ipynb @@ -17,7 +17,7 @@ "source": [ "# Decorators Homework (Optional)\n", "\n", - "Since you won't run into decorators until further in your coding career, this homework is optional. Check out the Web Framework [Flask](http://flask.pocoo.org/). You can use Flask to create web pages with Python (as long as you know some HTML and CSS) and they use decorators a lot! Learn how they use [view decorators](http://flask.pocoo.org/docs/0.12/patterns/viewdecorators/). Don't worry if you don't completely understand everything about Flask, the main point of this optional homework is that you have an awareness of decorators in Web Frameworks. That way if you decide to become a \"Full-Stack\" Python Web Developer, you won't find yourself perplexed by decorators. You can also check out [Django](https://www.djangoproject.com/) another (and more popular) web framework for Python which is a bit more heavy duty.\n", + "Since you won't run into decorators until further in your coding career, this homework is optional. Check out the Web Framework [Flask](http://flask.pocoo.org/). You can use Flask to create web pages with Python (as long as you know some HTML and CSS) and they use decorators a lot! Learn how they use [view decorators](https://flask.palletsprojects.com/en/stable/patterns/viewdecorators/). Don't worry if you don't completely understand everything about Flask, the main point of this optional homework is that you have an awareness of decorators in Web Frameworks. That way if you decide to become a \"Full-Stack\" Python Web Developer, you won't find yourself perplexed by decorators. You can also check out [Django](https://www.djangoproject.com/) another (and more popular) web framework for Python which is a bit more heavy duty.\n", "\n", "Also for some additional info:\n", "\n", @@ -27,6 +27,13 @@ "\n", "## Great job!" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -49,5 +56,5 @@ } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/12-Advanced Python Modules/07-Unzipping-and-Zipping-Files.ipynb b/12-Advanced Python Modules/07-Unzipping-and-Zipping-Files.ipynb index e86f2f022..458d776f7 100644 --- a/12-Advanced Python Modules/07-Unzipping-and-Zipping-Files.ipynb +++ b/12-Advanced Python Modules/07-Unzipping-and-Zipping-Files.ipynb @@ -31,7 +31,10 @@ "cell_type": "code", "execution_count": 1, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -45,7 +48,10 @@ "cell_type": "code", "execution_count": 2, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -68,7 +74,10 @@ "cell_type": "code", "execution_count": 3, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -86,7 +95,10 @@ "cell_type": "code", "execution_count": 4, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -97,7 +109,10 @@ "cell_type": "code", "execution_count": 5, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -108,7 +123,10 @@ "cell_type": "code", "execution_count": 6, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -119,7 +137,10 @@ "cell_type": "code", "execution_count": 7, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -139,7 +160,10 @@ "cell_type": "code", "execution_count": 8, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -150,7 +174,10 @@ "cell_type": "code", "execution_count": 9, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -177,7 +204,10 @@ "cell_type": "code", "execution_count": 13, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -216,7 +246,10 @@ "cell_type": "code", "execution_count": 15, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -251,21 +284,25 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ "# Extracting a zip archive\n", "# Notice how the parameter/argument order is slightly different here\n", + "dir_for_extract_result = 'C:\\\\Users\\\\Marcial\\\\Pierian-Data-Courses\\\\Extract' # Change to your desired path\n", "shutil.unpack_archive(output_filename,dir_for_extract_result,'zip')" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python [conda env:base] *", "language": "python", - "name": "python3" + "name": "conda-base-py" }, "language_info": { "codemirror_mode": { @@ -277,9 +314,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.6" + "version": "3.12.2" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/08-Advanced-Modules-Exercise-Solutions.ipynb b/12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/08-Advanced-Modules-Exercise-Solutions.ipynb index 14c3ae6df..98032de22 100644 --- a/12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/08-Advanced-Modules-Exercise-Solutions.ipynb +++ b/12-Advanced Python Modules/08-Advanced-Python-Module-Exercise/08-Advanced-Modules-Exercise-Solutions.ipynb @@ -41,7 +41,10 @@ "cell_type": "code", "execution_count": 2, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -52,7 +55,10 @@ "cell_type": "code", "execution_count": 3, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -86,7 +92,7 @@ } ], "source": [ - "with open('extracted_content/Instructions.txt') as f:\n", + "with open('extracted_content/Instructions.txt') as f: # Adjust path if necessary (Caution: Windows vs Unix)\n", " content = f.read()\n", " print(content)" ] @@ -104,7 +110,10 @@ "cell_type": "code", "execution_count": 9, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -115,7 +124,10 @@ "cell_type": "code", "execution_count": 10, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -126,7 +138,10 @@ "cell_type": "code", "execution_count": 11, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -166,7 +181,10 @@ "cell_type": "code", "execution_count": 15, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -193,7 +211,10 @@ "cell_type": "code", "execution_count": 16, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ @@ -204,15 +225,18 @@ "cell_type": "code", "execution_count": 17, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [ "results = []\n", - "for folder , sub_folders , files in os.walk(os.getcwd()+\"\\\\extracted_content\"):\n", + "for folder , sub_folders , files in os.walk(os.getcwd()+\"\\\\extracted_content\"): # Adjust path if necessary (Caution: Windows vs Unix)\n", " \n", " for f in files:\n", - " full_path = folder+'\\\\'+f\n", + " full_path = folder+'\\\\'+f # Replace \\\\ by / if using a Unix based OS\n", " \n", " results.append(search(full_path)) " ] @@ -268,5 +292,5 @@ } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/13-Web-Scraping/00-Guide-to-Web-Scraping.ipynb b/13-Web-Scraping/00-Guide-to-Web-Scraping.ipynb index d5f7a2e53..cb0da2c2c 100644 --- a/13-Web-Scraping/00-Guide-to-Web-Scraping.ipynb +++ b/13-Web-Scraping/00-Guide-to-Web-Scraping.ipynb @@ -113,10 +113,8 @@ }, { "cell_type": "code", - "execution_count": 51, - "metadata": { - "collapsed": true - }, + "execution_count": 1, + "metadata": {}, "outputs": [], "source": [ "import requests" @@ -124,10 +122,8 @@ }, { "cell_type": "code", - "execution_count": 52, - "metadata": { - "collapsed": true - }, + "execution_count": 2, + "metadata": {}, "outputs": [], "source": [ "# Step 1: Use the requests library to grab the page\n", @@ -145,7 +141,7 @@ }, { "cell_type": "code", - "execution_count": 53, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -154,7 +150,7 @@ "requests.models.Response" ] }, - "execution_count": 53, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -165,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -174,7 +170,7 @@ "'\\n\\n
\\nThis domain is for use in illustrative examples in documents. You may use this\\n domain in literature without prior coordination or asking for permission.
\\n \\n