Note that there are some explanatory texts on larger screens.

plurals
  1. POPython 3.3 cypher script
    text
    copied!<p>So i have this code here in python 3.3, it cyphers text with the ceaser cypher. What i need to know is how do i make a script that will convert it back from the original so that the person i send it too can read it.</p> <pre><code>message = input("Input: ") key = 11 coded_message = "" for ch in message: code_val = ord(ch) + key if ch.isalpha(): if code_val &gt; ord('z'): code_val -= ord('z') - ord('a') coded_message = coded_message + chr(code_val) else: coded_message = coded_message + ch # print ("Input: " + message) print ("Output: " + coded_message) </code></pre> <p>One more thing, I plan to be putting this is a tkinter message box, with the two entry fields used for the input and output. one field should be used to type what i want to convert and the other should be used to show what the text looks like after it has been crypted. The button should start the encryption. here is the code:</p> <pre><code>import sys from tkinter import * def mHello(): mLabel = Label(mGui,text = input("Hello World")) mLabel.grid(row=3, column=0,) mGui = Tk() ment = StringVar() mGui.geometry("450x450+250+250") mGui.title("My TKinter") # input label mLabel = Label(mGui,text = "Input",) mLabel.grid(row=1,column=0,) # output label mLabeltwo = Label(mGui,text = "Input",) mLabeltwo.grid(row=2,column=0,) # convert button mButton = Button(text = "Convert",command = mHello) mButton.grid(row=3,column=0) # input entry mEntry = Entry(mGui,textvariable=ment) mEntry.grid(row=1,column=1) # output entry mEntryTwo = Entry(mGui,textvariable=ment) mEntryTwo.grid(row=2,column=1) mGui.mainloop() </code></pre> <p>By the way i am only 15 and this is my 2nd day learning python. Some credit goes to sources on this forum that have provided me with some code snippets Thank-you in advance guys!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload