May-18-2017, 08:29 PM
I started learning python about 1 week ago, so I'm not sure if the path I'm taking for creating gui's will be a good one. I heard that appJar was pretty simple from this website https://wiki.python.org/moin/GuiProgramming, so I decided to try it in my test script
...And it turned out like this: Of course, I did the bare minimum to make the program functional, as I'm still learning. It probably isn't accurately representative of appJar's capabilities.
On appJar's website, it says that It has no dependencies, other than Python (Python 3.x or 2.7) and relies on Python's built-in tkinter library.
So I guess my question is this: If I'm going to being creating some more detailed or in depth gui's, should I switch from appJar? If so, to what?
EDIT: Any tips on my code would also be appreciated :-)
def encrypt(message,shift):
message = list(message)
chars = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !@#$%^&*()-=[]\;',./_+{}|:<>?")
schars = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !@#$%^&*()-=[]\;',./_+{}|:<>?")
x = int(shift)
counter = 0
while counter < x:
schars.insert(92, schars[0])
del (schars[0])
counter += 1
for x in range(len(message)):
message[x] = schars[chars.index(message[x])]
message = ''.join(message)
return message
def decrypt(message,shift):
message = list(message)
chars = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !@#$%^&*()-=[]\;',./_+{}|:<>?")
schars = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !@#$%^&*()-=[]\;',./_+{}|:<>?")
x = int(shift)
counter = 0
while counter < x:
schars.insert(92, schars[0])
del (schars[0])
counter += 1
for x in range(len(message)):
message[x] = chars[schars.index(message[x])]
message = ''.join(message)
return message
from appJar import gui
def press(btn):
if btn=="Encrypt":
app.clearTextArea('emessage')
app.setTextArea('emessage', encrypt(app.getEntry('message'),app.getEntry('shift')))
else:
app.clearTextArea('emessage')
app.setTextArea('emessage', decrypt(app.getEntry('message'),app.getEntry('shift')))
app = gui()
app.addLabel("title", "Welcome to Ken's Encryption Software", 0, 0, 2)
app.addLabel("message", "Message:", 1, 0)
app.addEntry("message", 1, 1)
app.addLabel("shift", "Shift Amount:", 2, 0)
app.addEntry("shift", 2, 1)
app.addButtons(["Encrypt", "Decrypt"], press, 3, 0, 2)
app.setEntryFocus("message")
app.addTextArea('emessage', 4,0,2,4)
app.go()
message = list(message)
chars = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !@#$%^&*()-=[]\;',./_+{}|:<>?")
schars = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !@#$%^&*()-=[]\;',./_+{}|:<>?")
x = int(shift)
counter = 0
while counter < x:
schars.insert(92, schars[0])
del (schars[0])
counter += 1
for x in range(len(message)):
message[x] = schars[chars.index(message[x])]
message = ''.join(message)
return message
def decrypt(message,shift):
message = list(message)
chars = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !@#$%^&*()-=[]\;',./_+{}|:<>?")
schars = list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 !@#$%^&*()-=[]\;',./_+{}|:<>?")
x = int(shift)
counter = 0
while counter < x:
schars.insert(92, schars[0])
del (schars[0])
counter += 1
for x in range(len(message)):
message[x] = chars[schars.index(message[x])]
message = ''.join(message)
return message
from appJar import gui
def press(btn):
if btn=="Encrypt":
app.clearTextArea('emessage')
app.setTextArea('emessage', encrypt(app.getEntry('message'),app.getEntry('shift')))
else:
app.clearTextArea('emessage')
app.setTextArea('emessage', decrypt(app.getEntry('message'),app.getEntry('shift')))
app = gui()
app.addLabel("title", "Welcome to Ken's Encryption Software", 0, 0, 2)
app.addLabel("message", "Message:", 1, 0)
app.addEntry("message", 1, 1)
app.addLabel("shift", "Shift Amount:", 2, 0)
app.addEntry("shift", 2, 1)
app.addButtons(["Encrypt", "Decrypt"], press, 3, 0, 2)
app.setEntryFocus("message")
app.addTextArea('emessage', 4,0,2,4)
app.go()
On appJar's website, it says that It has no dependencies, other than Python (Python 3.x or 2.7) and relies on Python's built-in tkinter library.
So I guess my question is this: If I'm going to being creating some more detailed or in depth gui's, should I switch from appJar? If so, to what?
EDIT: Any tips on my code would also be appreciated :-)