Giter Site home page Giter Site logo

python_tutorial's Introduction

๐Ÿ Python Tutorial

๐Ÿง Setup!

Python is a really popular language, and it's named after Monty Python, so you know it's gotta be good. First, let's make sure you have it on your dang computer.

In your terminal, type python --version and hit enter.

If you get an error, you don't have python at all. If not, it will list your Python version. If your version is under 3.6, try entering python3 --version. If you have at least version 3.6, you're all set! If not, you'll need to install Python.

Installing Python3 - Windows

Go to this link and download 3.7.3. ๐Ÿ˜Ž

Installing Python3 - Mac

Macs come with Python on them, but you might not have the newest version. You can install it with Homebrew. If you don't already have Homebrew, you can install it with this ruby command:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And then install the newest Python like so:

brew install python3

Testing Our File

Let's start with a basic Python script. Create a new directory, cd into it, create and open new file, and name it main.py. In that file, write this:

print("Hello world!")

To run that file, run python3 main.py in your command line.

๐Ÿ•น The game!

Our starting, base file:

from pygame.locals import *
import pygame

grid_size = 44

class Player:
  
  #
  # Attributes will go here!
  #


  #
  # Override Print function
  #

  
  #
  # Movement function
  #


# Setting up the class for our game:
class App:
  
  #
  # Attributes here
  #


  # 
  # Init function
  #


  #
  # on_execute()
  #
 
  # Just leave this here:
  def on_loop(self):
    pass
 

  # 
  # on_loop()
  #
 
  #
  # on_cleanup
  #

# This is what starts the whole game:
if __name__ == "__main__" :
  theApp = App()
  theApp.on_execute()

Note that this file won't work yet! We need to add a bunch.

Look through the rest of this repo to see various stages of the project. The various iterationX.py files have finished projects at each of our checkpoints, while iterationX_base.py files have a starting file for each of those iterations, including comments indicating what you'll need to add.

python_tutorial's People

Contributors

benholland1024 avatar

Watchers

James Cloos avatar Camden Fullmer avatar David Steinberg avatar I Park avatar Sami Glass avatar Nick Crawford 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.