Git Product home page Git Product logo

gutingui's Introduction

GutinGUI

GutinGUI is a wrapper for the CodeSkulptor SimpleGUI API using TkInter. This is a fork of dholm/simpleguitk, with some changes to make it suitable for use in our CS1822 course.

CodeSkulptor is a browser-based Python interpreter used in the online course "An Introduction to Interactive Programming in Python".

This wrapper makes it easier to work in the development environment of your choice while still being able to quickly test your implementation without using a web browser.

Fork Additions

This fork adds three extra named arguments for simplegui.create_frame. In addition, existing arguments can be called with named arguments.

New Argument Default Description
No title "GutinGUI" The title of the window
No canvas_width 800 The width of the canvas
No canvas_height 600 The height of the canvas
Yes canvas_padding 5 The padding around the canvas.
No control_width 200 The width of the control panel. Note that the control panel is above the input panel (the one with Key and Mouse).
Yes show_panel True Make the control frame and the input frame visible. When hidden, the canvas takes up the space of the entire window.
Yes target_framerate 60 The frame rate the program runs at. May destroy your program if changed if you've tied the physics to the framerate. Whoopsiedaisy.

There's no way this horrible hack is going onto pypi, so you're going to have to set your PYTHONPATH environment variable.

Microsoft Windows (short term)

  1. In cmd.exe, enter set PYTHONPATH=[path to cloned repo]
  2. Run your python code in the terminal

Microsoft Windows (more longer term)

  1. Search for Edit the system environment variables in the Start menu
  2. Click Environment Variables
  3. Add or create a new variable, with name PYTHONPATH and the value to the path of where you have cloned this repository.
  4. Restart your terminal to apply the changes. You may also need to restart the entire text editor if it has a built in terminal.

The environment variables screen

Requirements

None of these are strict requirements as SimpleGUITk will run without them as long as you don't need to use the SimpleGUI Images or SimpleGUI Sounds APIs.

Usage

Although GutinGUI is a drop-in replacement, you should probably use a try-catch statement to utilise the new named arguments within simplegui.create_frame.

import gutingui as simplegui

Assuming you intend to eventually run your code in CodeSkulptor make it a habit to test it often. As of this writing some of Python's language features are unavailable in CodeSkulptor and catching these early on makes it easier to make sure your implementation works as expected.

One important difference between SimpleGUITk and CodeSkulptor is that due to the design of TkInter the call to frame.start() is going to block until the application terminates. Simply make sure that it is called as the last line of the application.

To use SimplePlot just import it the same way as in CodeSkulptor.

import simpleplot

Versions

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.