🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #9582

[Python] Sacar algo de dentro de una función

#9582
From: Pere Pujal Carabantes
Date: Thu, 13 Jun 2002 17:35
31 lines
1628 bytes
Hola

Estoy intentando hacer una funci�n que cree una tupla
con el nombre que se le pase como argumento y no consigo 
que me la saque de dentro de la funci�n.

Os pego el c�digo a ver si me podeis echar una mano

#############################
#!/usr/bin/python

def nueva_tupla(nombre):
    texte={}
    imatge={}
    nombre=(texte,imatge)
    print nombre # imprime ({}, {}) con lo cual compruebo
		 # que al menos se ha creado
    return nombre

nueva_tupla('hola')
print hola

###########################
Me da un error en el �ltimo print: NameError: name 'hola' is not defined
de lo cual deduzco que la tupla se queda dentro de la funci�n.

Alguna idea para sacarla?

Gracias

Pere
Technical Details
Message-ID: <slrnaghlv1.s0.pere@hola.fou.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!134.222.94.5!npeer.kpnqwest.net!EU.net!news.airtel.net!127.0.0.1!nobody

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,ea94857271ee2d0f,start
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-06-13 09:38:43 PST
Newsgroups: es.comp.os.linux.programacion
From: Pere Pujal Carabantes <pere@hola.fou.net>
Subject: [Python] Sacar algo de dentro de una función
Message-ID: <slrnaghlv1.s0.pere@hola.fou.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit
User-Agent: slrn/0.9.7.3 (Linux)
Date: Thu, 13 Jun 2002 19:35:29 +0200
NNTP-Posting-Host: 212.166.154.114
X-Original-NNTP-Posting-Host: 212.166.154.114
X-Trace: news.airtel.net 1023986306 212.166.154.114 (13 Jun 2002 18:38:26 +0200)
Lines: 31
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!134.222.94.5!npeer.kpnqwest.net!EU.net!news.airtel.net!127.0.0.1!nobody