summaryrefslogtreecommitdiff
path: root/src/examples/holaMundo.py
diff options
context:
space:
mode:
authorPaul McGuire <ptmcg@austin.rr.com>2012-11-23 08:54:10 +0000
committerPaul McGuire <ptmcg@austin.rr.com>2012-11-23 08:54:10 +0000
commit774e46526945ea91265734a2dc82d15eed515577 (patch)
tree734ae210c20a98f01fe029f7e6eeb7a93b4617fb /src/examples/holaMundo.py
parent6b12041d4656f4cda910f24acda8d71013166fbd (diff)
downloadpyparsing-git-774e46526945ea91265734a2dc82d15eed515577.tar.gz
Clean up examples to be Python 3 compatible
Diffstat (limited to 'src/examples/holaMundo.py')
-rw-r--r--src/examples/holaMundo.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/examples/holaMundo.py b/src/examples/holaMundo.py
index 0e10069..357e3c8 100644
--- a/src/examples/holaMundo.py
+++ b/src/examples/holaMundo.py
@@ -1,3 +1,5 @@
+# -*- coding: UTF-8 -*-
+
# escrito por Marco Alfonso, 2004 Noviembre
# importamos el modulo
@@ -14,7 +16,7 @@ tokens = saludo.parseString("Hola, Mundo !")
# el metodo parseString, nos devuelve una lista con los tokens
# encontrados, en caso de no haber errores...
for i in range(len(tokens)):
- print "Token %d -> %s" % (i,tokens[i])
+ print ("Token %d -> %s" % (i,tokens[i]))
#imprimimos cada uno de los tokens Y listooo!!, he aquí la salida
# Token 0—> Hola Token 1—> , Token 2—> Mundo Token 3—> !
@@ -23,6 +25,6 @@ for i in range(len(tokens)):
numimag = Word(nums) + 'i'
numreal = Word(nums)
numcomplex = numreal + '+' + numimag
-print numcomplex.parseString("3+5i")
-
+print (numcomplex.parseString("3+5i"))
+
# Excelente!!, bueno, los dejo, me voy a seguir tirando código…