namespace question

Rainer Deyke root at rainerdeyke.com
Sat Jun 10 21:45:36 EDT 2000


Jerome Chan <eviltofu at rocketmail.com> wrote in message
news:eviltofu-8E2F45.12073510062000 at news.earthlink.net...
> If I do the following:
>
> import socket
>
> socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
>
> how do I call a function from the socket module later on?

Technically correct answer (assuming that you don't use the name _socket):

_socket = socket
import socket
# call socket function here
socket = _socket
del _socket


--
Rainer Deyke (root at rainerdeyke.com)
Shareware action/role-playing games      -      http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list