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'm going to attach the script, just in case you want to see it.
#!/usr/bin/python
#V 0.4
import string

contador = "s" # Cria um contador que verifica que deve ou nao executar o script

while contador.lower() == "s" or contador.lower() == "sim": # Enquanto o valor for "s" ou "sim" o programa nao sai (converte a palavra em minusculas)

	print "Escolhe a lingua que queres traduzir. [p]ortugues ou [a]l-bhed"

	lingua = raw_input() # Escolhe a lingua
	
	if lingua.isspace() == True: # Se "lingua" e constituida por espacos em branco

		print "Tens de escrever alguma coisa ok?"

	if lingua == "": # Se lingua estiver vazia
		
		print "Tens de escrever alguma coisa ok?"

	if lingua.lower() == "a" or lingua.lower() == "al-bhed":
		lista = string.maketrans('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'epstiwknuvgclrybxhmdofzqajEPSTIWKNUVGCLRYBXHMDOFZQAJ') # Cria a lista de palavra e de que maneira vao ser trocadas

		print "Escreve a palavra que queres traduzir."

		palavra = raw_input() # Pede por uma palavra

		print "" + palavra.translate(lista) + "" # Imprime as palavras trocadas

	if lingua.lower() == "p" or lingua.lower() == "portugues":
		lista = string.maketrans('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'ypltavkrezgmshubxncdijfqowYPLTAVkREZGMSHUBXNCDIJFQOW') # Cria a lista de palavra e de que maneira vao ser trocadas

		print "Escreve a palavra que queres traduzir."

		palavra = raw_input() # Pede por uma palavra

		print "" + palavra.translate(lista) + "" # Imprime as palavras trocadas
	

	print "Ainda tens mais alguma coisa para traduzir? [S/N]"
	
	contador = raw_input() # Modifica o contador que esta inicio do script

if contador.lower() == "n" or contador.lower() == "nao": # Se contador igual a "n" ou "nao" minusculos
	print "Entao adeus."
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to