Git Product home page Git Product logo

simpleguitk's Introduction

SimpleGUITk

SimpleGUITk is a wrapper for the CodeSkulptor SimpleGUI API using TkInter. 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.

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

The most practical way to use SimpleGUITk is to use the following import statement which makes it easy to switch between SimpleGUI and SimpleGUITk.

import simpleguitk 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

Changes

  • 1.1.3
    • Key release events are only sent on true release.
    • Repeated calls to sound play will do nothing if the sound is already playing.
  • 1.1.2
    • Supports loading data from local filesystems.
    • Fixes rotation bug in images.
    • Some minor optimizations in image rendering.
  • 1.1.1
    • matplotlib is no longer a strict requirement as it is only needed for SimplePlot.
    • Force division to behave like in Python 3 when running in Python 2.
  • 1.1.0
    • Initial support for SimplePlot via matplotlib.
    • Support for Python 3.
    • Fixes size issues with control objects.
  • 1.0.6
    • Moves SimpleGUITk version to base directory to avoid dependency cycle during installation.
  • 1.0.5
    • Ensure canvas refresh is within a reasonable interval.
  • 1.0.4
    • Canvas borderes will now render correctly.
    • The draw handler uses an adaptive timeout so that it will run smoothly at 60 FPS just like in CodeSkulptor.
    • Polygons default fill set to transparent.
  • 1.0.3
    • Prevent the input status labels from resizing dynamically which would cause the canvas to move around on certain events.
    • Increase of FPS to 100 to better match SimpleGUI in CodeSkulptor.
  • 1.0.2
    • Display input events in the status frame.
    • Ignore case on color codes when using named colors.
    • Input control events are sent as strings like in SimpleGUI.
    • Several minor bugfixes
  • 1.0.1
    • Translation of TkInter keys to JavaScript keycodes so they will work with implementations that do not use simplegui.KEY_MAP.
    • Support for colors specified as hexadecimal without a leading hash sign.
    • Bugfixes for older versions of TkInter.
  • 1.0.0
    • First official release.

simpleguitk's People

Contributors

cardenb avatar dholm avatar mpmiszczyk avatar sdsyjh avatar zhlvting avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simpleguitk's Issues

TypeError in sound.py

File "/usr/local/lib/python2.7/site-packages/simpleguitk/sound.py", line 62, in load_sound
return Sound(URL)
File "/usr/local/lib/python2.7/site-packages/simpleguitk/sound.py", line 22, in init
self._sound = pygame.mixer.Sound(io.BytesIO(soundfile))
TypeError: Unrecognized argument (type _io.BytesIO)

I guess the problem is in line 22:
self._sound = pygame.mixer.Sound(io.BytesIO(soundfile))
should be something like:
self._sound = pygame.mixer.Sound(io.BytesIO(soundfile).read())

pygame version 1.9.2a0 OSX 10.9.2

cannot install:

I've downloaded the file but when I try "python setup.py install" it says:

Installed /root/.pythonbrew/pythons/Python-2.7.7/lib/python2.7/site-packages/SimpleGUITk-1.1.3-py2.7.egg
Processing dependencies for SimpleGUITk==1.1.3
Searching for pygame>=1.9.0
Reading https://pypi.python.org/simple/pygame/
Reading http://www.pygame.org/
Reading http://www.pygame.org/download.shtml
No local packages or download links found for pygame>=1.9.0
error: Could not find suitable distribution for Requirement.parse('pygame>=1.9.0')

What to do?

draw point

using python 2.7.5.1 with simpleguitk the draw_point function comes up as an addribute error and sayes 'Canvas' object has no attribute 'draw_point'. Yet simplegui has a built in function called draw_point.

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.