Python Tutorial

  • Submitted by: 
    Introduction: This tutorial is on how to create a simple calculator in Python. The Theory: Here's how the program will be structured: Get the users first number Get the users second number Get the users action Use if statements to perform the calculation Print out the result Getting The Users Numbers: First we want to get the users two numbers to calculate together somehow. We use input...
  • Submitted by: 
    Introduction: This tutorial is on how to set up SQLite and Python to use databases within your scripts. Downloading SQLite: First we need to download SQLite. To do this, go to http://sqlite.org/download.html and download the latest pre-compiled binary release for your operating system - I am using Windows, I am unsure if this tutorial 100% works with other systems. Once you have downloaded it,...
  • Submitted by: 
    Introduction: This tutorial is on how to create a user management system in Python using SQLite. The Database: First we need to create the database to store the information, to do this open CMD (on Windows) and type cd followed by your SQLite installation path, mine is: cd /d G: cd Libaries\Documents\SQLite Now we use the command sqlite3 followed by the database name followed by the extension for...
  • Submitted by: 
    Introduction: This tutorial will be covering how to create a hangman game based on ASCII characters in Python. Imports: First we need to import the random package to randomise which word the PC will choose... import random ; Variables: Next we need a list of possible words for the pc to choose, we use a full caps name and a tuple to store the list of information because it will not change...
  • Submitted by: 
    Introduction: This tutorial is on how to make a guess my number game in Python. The Game: This is a simple game where the computer chooses a random number, then the player has a certain amount of guesses to guess the correct number by following the feedback (too high, or too low). The Imports: First we need to import the random module to let the computer choose a random number... import random ;...
  • Submitted by: 
    Introduction: In this tutorial, we are going to be covering handling files in Python. Generic: To read or write from/to a file, we first need to create a stream. To do this we use the Python function 'open' which takes two parameters, the file, and the mode. The file should a file name (including directory location if it is not in the same directory as the current program) as a string, while the...
  • Submitted by: 
    Introduction: This tutorial is going to be on how to create a GUI in Python using Tkinter. Tkinter: Tkinter is a basic package to give your projects a simple GUI with the essential GUI elements such as textboxes, checkboxes, buttons and more. Our Program: Our program is going to be a simple program where the user enters text in to a textbox, then clicks a button to get it output to the console...

Pages