If you're just going for a simple two-textbox, one button, 'type here,
hit the button, and the translated text appears in the other box'
Yeah, its something like that :D
Nothing to much fancy, it just that it can get kind of boring always
going to the linux console to run the script.
I'm going to try the Boa Contructor.
>I'm going to attach the script, just in case you want to see it.
Good job on attaching the script!
I did want to see it.
I can't read the comments, though, but I think I got what it was doing.
Yeah, I kind of forgot to translate the comments.
Now I have attached the script with the translated comments.
Also any comments about the program are welcome.
Luke Paireepinart escreveu:
rolando wrote:
Well, I don't know if I can ask this question here, but never mind
that :)
It´s like this, I created this python script that translates "human
language" to Al-bhed language (it's a language from the game Final
Fantasy 10, it's basicly a change in the letters for example A
becomes W or B become H).
Since I like the script, and it's my first "program", I am now trying
to create a GUI for it.
So what do you recommend?
I don't think something like this lends itself to a particular GUI set,
so the question I have to ask you is:
Do you feel lucky?
Just kidding.
It's really up to you on this one.
TKInter would probably be easier to learn, since it's your first program.
You could go the route of a GUI builder such as Boa Constructor, but
I'd recommend that you learn
how to use a GUI toolkit before you use a builder, so that you know
exactly what the builder is automating for you.
However, are you sure you want to jump into a GUI right now?
If you're just going for a simple two-textbox, one button, 'type here,
hit the button, and the translated text appears in the other box'
type thing, and not something fancy, I guess it's about as simple of
an introduction to a GUI toolkit as you can get, aside from a
label that says "Hello, World" or other such thing.
Just remember that it's important that you have a firm understanding
of python's built-ins, and I guess Python in general,
before you start trying to use a big external package like a GUI
toolkit, and a little up-front time learning the basics will help you
a great deal in the long run.
>I'm going to attach the script, just in case you want to see it.
Good job on attaching the script!
I did want to see it.
I can't read the comments, though, but I think I got what it was doing.
Good luck in whatever you choose to do.
-Luke
#!/usr/bin/python
#V 0.4
import string
contador = "s" # Creates a counter that checks if it should run the script or not
while contador.lower() == "s" or contador.lower() == "sim": # While the counter is a lower s or sim (that's yes in portuguese) the program doesn't quit
print "Escolhe a lingua que queres traduzir. [p]ortugues ou [a]l-bhed"
lingua = raw_input() # Chosse the language to translate
if lingua.isspace() == True: # If "lingua" is only white space
print "Tens de escrever alguma coisa ok?"
if lingua == "": # If "lingua" is empty
print "Tens de escrever alguma coisa ok?"
if lingua.lower() == "a" or lingua.lower() == "al-bhed":
lista = string.maketrans('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'epstiwknuvgclrybxhmdofzqajEPSTIWKNUVGCLRYBXHMDOFZQAJ') # Creates the list of letter, and the way they are going to be changed
print "Escreve a palavra que queres traduzir."
palavra = raw_input() # Ask for a word
print "" + palavra.translate(lista) + "" # Print the translated words
if lingua.lower() == "p" or lingua.lower() == "portugues":
lista = string.maketrans('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'ypltavkrezgmshubxncdijfqowYPLTAVkREZGMSHUBXNCDIJFQOW') # Creates the list of letter, and the way they are going to be changed
print "Escreve a palavra que queres traduzir."
palavra = raw_input() # Ask for a word
print "" + palavra.translate(lista) + "" # Print the translated words
print "Ainda tens mais alguma coisa para traduzir? [S/N]"
contador = raw_input() # Possibility of changing the counter in the begging of the script
if contador.lower() == "n" or contador.lower() == "nao": # If counter equals lower "n" or "nao" (that portugues for no) the program quits and prints the lower message
print "Entao adeus."
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor