Advanced Python Getting Started

Advanced Python

Getting Started

Welcome ? these instructions are provided to help out where needed ? you do not need to follow all the sections here. But please read the start of each section to determine whether you might need to follow the steps to get completely set up.

Table of Contents: ? Required Software ? Installing the Python Interpreter from Anaconda ? Installing the PyCharm Editor/IDE ? Updating Anaconda and PyCharm ? Configuring PyCharm Fonts and Colors ? Downloading Course Files ? Setting PyCharm to work with Anaconda ? Exploring PyCharm ? Using the PyCharm Debugger ? Using Jupyter Notebook

Required Software

You are required to install and be able to use: ? a Python distribution. I am recommending Anaconda Python. ? a text editor or IDE. I am recommending PyCharm. ? Jupyter Notebook, another tool for writing and running programs.

You may choose to use an alternative Python distribution or IDE that you already have installed; in that case you would not need to install any additional software for this class.

However if you don't want to use Anaconda, you must install the following Python modules: ? requests, a web client library ? bs4 (Beautiful Soup), a web scraping library ? pandas, a data processing library ? matplotlib, a data visualization library ? Jupyter notebook (this is not a module but does need to be installed)

Let me know if you have any issues installing these modules (installing these is required for nonAnaconda users only - Anaconda includes them).

Installing the Python Interpreter from Anaconda

If you already have Anaconda or another version of Python installed, you may skip to "Installing the PyCharm Editor/IDE".

If you don't have it, I recommend Anaconda Python: ? a popular distribution of Python ? includes the Python interpreter ? adds useful tools for learning and collaboration, such as Jupyter notebook ? adds many useful modules for finance, web and scientific computing ? requires 3-4GB of space on your computer's disk (you should have at least 5-8GB available on disk before installing). If you do not have this much disk space available, let me know

1. Check the amount of available disk space on your computer.

a. On Mac: i. open a Finder (file listing) window and display a folder of files (for example, your Desktop, but not "All My Files") ii. Look at the bottom of the window - you should see XX GB available

b. On Windows: i. in the search box, do a search for This PC, or look for it on the Desktop ii. scroll down to the disk drives (with horizontal bars illustrating space used) iii. look for XX GB free message for your main hard drive

If you have at least 5GB of space available on your disk, follow Step 2 below (your disk should not have less than 2GB free after installation). If you don't have enough disk space, you can use your current version of Python (3.8, 3.9 or 3.10). You may proceed to Installing PyCharm, below.)

2. Please don't uninstall any version of Python you may have. We will simply configure our tools to use the preferred version.

3. Install Anaconda Python. (Again if you do not have 5GB free on your computer, you can use your current version of Python.)

* Please note that you never need to uninstall any version of Python! Multiple versions can be, and often are, installed on the same system (I currently have four versions installed on my system). If you find that the wrong version of Python is run when you try to use it, you can simply change the 'default' version for your system - I can show you how.

a. Visit

b. Find and click the Free Download link at the top right

c. Click the Download button (which should indicate your OS (Mac or Windows). For Mac, click the small arrow on the right side of the button and choose the correct Mac type

d. The installer will begin to download, usually to your Downloads folder.

e. When complete, find and double-click the installer.

f. Accept all of the prompts and defaults.

g. By default, Anaconda will be installed in a directory located off of your home directory. If you see a warning sign and "You cannot install Anaconda3 in this location", you must install from your home directory.

h. PLEASE NOTE if the Anaconda installer asks for your permission to make changes (requesting a password), please stop installation and start again, making sure to install for "Just Me" or "Me Only". The installer should note that Anaconda will be installed in your home directory.

If it appears that Anaconda is being installed into a directory other than your home directory: when you see the button change install location, please click the button and select your home directory, even if you see an error message similar to "Anaconda cannot install in this location". After selecting your home directory, you should be able to install Anaconda without giving a password.

Note that the installer may invite you to download and install PyCharm; we will do so ourselves in the next section.

i. Installation may take several minutes. When done, the installer will tell you installation is complete.

Installing the PyCharm Editor/IDE

Again, you may use your preferred Editor or IDE (Sublime, IDLE, etc.), but make sure you are comfortable with it. If you already have PyCharm installed, please proceed to "Updating Anaconda and PyCharm".

1. Download and Install PyCharm. (Again, you are free to use the IDE of your choice.)

a. Visit the download page at

b. Immediately beneath Download PyCharm, make sure that your operating system (Windows, macOS or Linux) is selected (it will be highlighted in blue with an underline).

c. Make sure to choose Community Edition on the right side (do not install Professional Edition as it will require a purchase after a trial, and includes features that we do not need). For Mac, make sure the correct .dmg is selected ? if your Mac has an M-series chip, you should select Apple silicon; those with non M-series chips should select Intel. You do not need to provide your email address or sign up with the website, although you may be invited to do so.

d. Download will begin. Keep in mind you do not need to provide your email address or sign up with the website.

e. Once downloaded, doubleclick the downloaded file:

i. On Mac:

a. a window will appear suggesting that you drag the PyCharm icon ("PC") to your Applications Folder -- you can do so right in that window (you may need to enter a password, or confirm that this program is safe to run -- it is!).

b. once the program is in Applications, you can also create a shortcut to the application if you wish, by dragging it from Applications to your Dock (the horizontal bar at the bottom of your screen with icons that launch programs). You can also create a Desktop shortcut by dragging the icon from Applications and holding down the Cmd+Option keys (so that a swoopy arrow indicating a shortcut is displayed) before releasing on the Desktop. (If you don't see a swoopy arrow, the application itself will be moved to the Desktop, which you do not want - it belongs in the Applications folder.)

ii. On Windows:

a. follow the installer steps and accept all defaults.

b. During the install process you can choose to have a Desktop Shortcut placed on your Desktop. (You will also be able to launch PyCharm using the search or Start > Run... box.) You can also choose to associate .py with PyCharm, but I do not recommend this.

c. Continue to click Next until installation is complete. You may also choose to launch PyCharm for the first time here.

2. Launch PyCharm and respond to initial settings questions. For Mac, find the PyCharm PC icon in Applications and double-click it, or if you placed an icon in the Dock at the bottom of your screen, you can simply click that. For Windows, use the icon you placed on your Desktop or go to the search box and type PyCharm; you should see your program listed as JetBrains PyCharm; click it.

PyCharm may ask a series of questions, for example if you would like to import settings (please do not import any settings), and share usage data with JetBrains to help them improve the product (this is your choice). PyCharm may also ask you to select a Keymap (choose the one appropriate for your platform), a Light or Dark color scheme (recommended choices: "Darcula" or "High Contrast", but you may also select a light color scheme), a launcher script (skip this), and download plugins (skip this). These questions may or may not appear during this step.

Finally, you can click to launch PyCharm.

3. Check out the PyCharm Welcome Screen. This medium-sized box shows the PyCharm PC icon and "Welcome to PyCharm" at the top. This will be the starting point from which we create new projects in PyCharm.

1. Projects on the left is where we can manage projects that we work with. 2. Customize allows us to set color theme and font sizes. However, we will set these as

part of the next step.

4. Set Font Size and Color Scheme. Please keep your font large. Don't strain your eyes!

a. On the left, click Customize.

b. From here you can select a different color scheme (the settings file has set to "High contrast", which I recommend) and an IDE font (I recommend 13).

Updating Anaconda and PyCharm

1. If you already had Anaconda installed, please perform an update:

a. On Mac: search for and open Terminal b. On PC: search for and open Anaconda Prompt

At the command line, execute the first command, and wait for it to complete - you will need to confirm installation (with y) as indicated by the updater.

conda update conda

After this command completes, issue this command:

conda update --all

Again, confirm if needed. You should see messages that indicate success. If you run into any issues, please let me know.

2. If you already had PyCharm installed, please perform an update and remove any custom settings (you may have installed settings if you took Introduction to Python with me):

a. Select PyCharm > check for updates (Mac) or Help > check for updates (Windows)

b. Launch PyCharm and from the welcome screen select File > Manage IDE Settings > Restore Default Settings... and follow the prompt to restore your settings.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download