INTERACTIVE PROGRAMMING IN PYTHON

 

~Sandhiya and Kayalvizhi

We learned “An Introduction to Interactive Programming in Python (Part-1 and Part-2) Online course in Coursera.

CodeSkulptor is an interactive, web-based Python programming environment that allows Python code to be run in a web browser.

These are the game we learnt in the coursera course,

  • Rock Paper Scissors
  • Guess the number
  • Ping pong
  • Stop watch
  • Blackjack
  • Memory game
  • Spaceship/Asteriod

We are trying to run the Codeskulptor python in our local system (Create executable file). In codeskulptor we have a save options to download our code.

We used following steps to converting the python files into exe.file in local system.

These are the API tried for Simplegui to run the code for local system.

  • 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”.

  • Create Pyinstaller using to EXE: https://datatofish.com/executable-pyinstaller/
  • Install pip install SimpleGUITk
  • Change the import simplegui to import simpleguitk
  • Able to run the codeskulptor file in our local and create the .exe file also, but not able to run and create exe file for the images having file like blackjack and spaceship game.
  • Simplequi

Same thing we did for simplequi also, not able to create the blackjack and spaceship game.

  • Download the images and set a path to the image in the spaceship python code. Not able to get the image file.

Solution-1(Windows)

  • Install SimpleGUICS2Pygame

https://pypi.org/project/SimpleGUICS2Pygame/

  • Replace the import simplegui to

try:

import simplegui

except ImportError:

import SimpleGUICS2Pygame.simpleguics2pygame as simplegui

  • Convert .py files to .exe file

Install pysimplegui-exemaker

https://pypi.org/project/pysimplegui-exemaker/

  • Run the Pysimplegui-exemaker– open the command prompt and paste

python -m pysimplegui-exemaker.pysimplegui-exemaker

The pop up showed liked that, browse your code in source python file and click Make EXE.