Code Monkey home page Code Monkey logo

codefirstgirlssheffield-python-intro's Introduction

CodeFirstGirlsSheffield-Python-Intro

Course materials for the CodeFirstGirls Sheffield Introduction to Python Course

Running the slides

Method 1: Run via Python on your machine

To run the Jupyter Notebook slides, you need:

  • Python 3
  • The jupyter Python package
  • The RISE Python package

Install Python 3 with the link above. Then, open a terminal and run the following commands to install the jupyter and RISE package:

pip install jupyter RISE

If you also have Python 2 installed on your computer (i.e. if you are working on a Mac/Linux machine), you may have to replace pip with pip3 in the command above.

In the terminal, change to the directory containing the Jupyter Notebook slides, then run the following commands to start the Jupyter Notebook server needed to run the slides:

jupyter notebook

Method 2: Run with Docker

Alternatively, if your machine can run Docker (Windows 10 Pro, MacOS or any Linux distro), you can run the Jupyter Notebook server inside a Docker container.

To begin, install Docker and the Docker Compose command line tool. If you are on Windows or MacOS, Docker Compose will have already come with your Docker installation.

Then, at the root of the repository, type this single command to start the Jupyter Notebook server:

docker-compose up

You should see output similar to the following:

Starting jupyter-notebook ... done
Attaching to jupyter-notebook
jupyter-notebook | Executing the command: jupyter notebook
jupyter-notebook | [I 20:38:44.343 NotebookApp] JupyterLab extension loaded from /opt/conda/lib/python3.7/site-packages/jupyterlab
jupyter-notebook | [I 20:38:44.343 NotebookApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
jupyter-notebook | [I 20:38:45.348 NotebookApp] Serving notebooks from local directory: /home/jovyan
jupyter-notebook | [I 20:38:45.348 NotebookApp] The Jupyter Notebook is running at:
jupyter-notebook | [I 20:38:45.349 NotebookApp] http://47e3a7c93868:8888/?token=c5abd1bcdfbb9f70d26eed5a045eb3a58dd7c1d9e8627b29
jupyter-notebook | [I 20:38:45.349 NotebookApp]  or http://127.0.0.1:8888/?token=c5abd1bcdfbb9f70d26eed5a045eb3a58dd7c1d9e8627b29
jupyter-notebook | [I 20:38:45.349 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
jupyter-notebook | [C 20:38:45.354 NotebookApp]
jupyter-notebook |
jupyter-notebook |     To access the notebook, open this file in a browser:
jupyter-notebook |         file:///home/jovyan/.local/share/jupyter/runtime/nbserver-6-open.html
jupyter-notebook |     Or copy and paste one of these URLs:
jupyter-notebook |         http://47e3a7c93868:8888/?token=c5abd1bcdfbb9f70d26eed5a045eb3a58dd7c1d9e8627b29
jupyter-notebook |      or http://127.0.0.1:8888/?token=c5abd1bcdfbb9f70d26eed5a045eb3a58dd7c1d9e8627b29

Unlike Method 1 which opens a browser automatically, you need to copy the URL beginning with http://127.0.0.1:8888 in your browser instead to see the same Jupyter user interface.

Converting documents to PDF (Slides and Homework)

Convert Slides

Using nbconvert (from https://rise.readthedocs.io/en/stable/exportpdf.html)

Generate the slides and serve them using nbconvert:

jupyter nbconvert --to slides your_talk.ipynb --post serve

It opens up a webpage in the browser at http://127.0.0.1:8000/your_talk.slides.html#/

Add ?print-pdf to the query string as http://127.0.0.1:8000/your_talk.slides.html?print-pdf Note that you need to remove the # at the end. The page will render the slides vertically.

Save to PDF in Chrome using the print option:

Open the in-browser print dialog (Cmd/Ctrl + P).

Change the Destination setting to Save as PDF.

Change the Layout to Landscape.

Change the Margins to None.

Enable the Background graphics option.

Click Save.

Create homework/ solutions document

Download pandoc & wkhtmltopdf (need to add wkgtmltopdf to path)

navigate to folder where the file is located

pandoc -t html --css stylesheet.css {filename}.md -o {output filename}.pdf -V margin-top=20 -V margin-left=20 -V margin-right=20 -V margin-bottom=20

codefirstgirlssheffield-python-intro's People

Contributors

lauraredmondson avatar adamckay avatar darrenvong avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.