import{_ast,casa,oass,ahasi}from"./chunks/framework.j4Nev8bF.js";constu=JSON.parse('{"title":"Python","description":"","frontmatter":{},"headers":[],"relativePath":"rebel_coding/step3.md","filePath":"rebel_coding/step3.md"}'),o={name:"rebel_coding/step3.md"};functionn(r,e,l,p,h,d){returns(),a("div",null,[...e[0]||(e[0]=[i(`<h1 id="python" tabindex="-1">Python <a class="header-anchor" href="#python" aria-label="Permalink to “Python”"></a></h1><hr><p>What if you could automate processes in your building … but not just simple processes - intensive analysis and creation ?</p><p>Enter Python!</p><p>Python has access to systems level functionality allowing it to interact with the hardware in a larger variety of ways!</p><p>And though this is a bit more of a detailed tutorial, compared to what we've already done; we'll still stay in the shallow end of the pool for writing our first scraper.</p><p>There are few tools that one can use to bypass the method outlined belows; Beautiful Soup is one such tool. Though we're gonna opt for directly using the toolset around which Beautiful Soup is built.</p><blockquote><p>QN: A quick note about Package Managers</p></blockquote><p>Package managers ... manage the packages, libraries and software our systems use.</p><p>If you are using Ubuntu, you will likely be using a package manager called <code>apt</code>, Mac users may be using one called <code>homebrew</code>, while Windows users can use one called <code>chocolatey</code>.</p><p>Individual languages can also have their own package managers.</p><p>NodeJS has <code>npm</code>, Ruby uses a tool called RubyGems, and Python uses <code>pip</code>.</p><p>Depending on your chose operating system, you will need to learn how to use your operating systems package manager, and subsequently acquire <code>pip</code> for Python.</p><p>For those wanting to dive in head first, you can check out the official <code>pip</code> documentation: <a href="https://pip.pypa.io/en/stable/installing/" target="_blank" rel="noreferrer">https://pip.pypa.io/en/stable/installing/</a>.</p><p>Make sure to read the warnings.</p><p>Alright, let's dig in!!!</p><h2 id="your-first-python-scraper" tabindex="-1">#Your First Python Scraper <a class="header-anchor" href="#your-first-python-scraper" aria-label="Permalink to “#Your First Python Scraper”"></a></h2><h3 id="prep-virtual-environment" tabindex="-1">Prep Virtual Environment <a class="header-anchor" href="#prep-virtual-environment" aria-label="Permalink to “Prep Virtual Environment”"></a></h3><p>Now that we've got <code>pip</code>, we want to the ability to make Python <em>virtual environments</em>.</p><p>The reason we want to use a <em>virtual environment</em> is to keep our systems <em>clean</em>.</p><p>We will be downloading quite a few Python packages that may not be necessary afterwards; or that may interfere with packages we want to use later.</p><p>In short, uing virtual environments allows such keep the packages utilized for each project we pursue compartmentalized.</p><p>The command to run is <code>pip install virtualenv</code>; bells will ring, whistles will be blown, and when it's all done; you'll have Python Virtual Environments accessible on your computer!</p><h3 id="start-venv-install-lxml" tabindex="-1">Start VEnv & Install LXML <a class="header-anchor" href="#start-venv-install-lxml" aria-label="Permalink to “Start VEnv & Install LXML”"></a></h3><p>Next week need to create a virtual environment.</p><p>In order to spin-up our virtual environment we run the following command:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span> virtualenv pickYourOwnName</span></span></code></pre></div><p>More bells and whistles will sound, and when it's all down we'll have a new folder