How to turn a python shell into a android application

1.9k views Asked by At

I have never made an app before... I only know python and a bit of java... I was wondering is it possible to make an app using python? My app is a translation app for deaf people to be able to communicate with hearing people. How would I go about it?An example one of my files is (sorry if my code is sloppy):

import time import os import sys from easygui import * import pygame as pygame

pygame.init()
screen = pygame.display.set_mode((89, 112))
os.chdir("/Users/marcellobachechi/Desktop/learn-asl")
tf = open("spelspeed.spd","r")
speed = tf.readline()
# def selectword(a):
#   a = m
#   return a
m = enterbox(msg="what do you want to spell?",image="fingerspell.gif")
if m == "cancel":
        sys.exit()
        os.system("python startasl.py")
while m == "" or m == " " or m == "null" or m == 'NoneType' or len(m) <= 0:
    sys.exit()
    os.system("python startasl.py")


mains = len(m)


l = list(m)
if speed == "slow":
    speeds = 1.5
    print('work')
elif speed == "fast":
    speeds = 0.5
    print('work')
else:
    speeds = 1.0
    print('work')

for element in l:
    pars = element.split(',')
    parts = str(pars)
    nparts = parts.replace("['","")
    flarts = nparts.replace("']","")
    print (flarts)
    name = str(flarts) + ".gif"

    ##############################
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()
    pygame.init()

    myimage = pygame.image.load(name)
    imagerect = myimage.get_rect()
    black = (255,255,255,255)
    screen.fill(black)
    screen.blit(myimage, imagerect)
    pygame.display.flip()
    time.sleep(speeds)




yes = "yes"
rsts = buttonbox(msg="Do you wish to restart?",choices=("yes","no"))
if rsts == yes:
        os.system("python fingerspelltranslator.py")
        pygame.display.quit()
else:
    pygame.display.quit()
    os.system("python startasl.py")

pygame.display.quit()
#os.system("python startasl.py")

How could i turn this into a frame work that I could pull all my outputs onto the screen? How do I make a gui? How do I display images in a GUI? Sorry if this is trivial!! I am only 14 and just started programming 5 months ago. So I am still very new and I might do somethings a bit sloppy. Thank you for all your help!!!!!

1

There are 1 answers

1
Prahalad Deshpande On BEST ANSWER

It is possible to develop Android apps in Python using SL4A (Scripting Layer for Android) and other complementing frameworks.

Refer to this Euro Python tutorial that provides an introduction to developing Android Apps using Python.