Re: Where and when does Python say this to you?
File "prueba.py", line 4, in sock = socket(AF_UNIX, SOCK_STREAM) NameError: name 'AF_UNIX' is not defined code: import socket sock = socket(AF_UNIX, SOCK_STREAM) Thank you ! Submitted via EggHeadCafe Statistics, Probability, Lotteries and Dumb Programmers http://www.eggheadcafe.com/tutorials/aspnet/041de19a-e704-468f-bd3c-79164fc739f5/statistics-probability-lotteries-and-dumb-programmers.aspx -- http://mail.python.org/mailman/listinfo/python-list
Re: Where and when does Python say this to you?
This is the simple code: import socket sock = socket(AF_UNIX, SOCK_STREAM) -- Thank you Submitted via EggHeadCafe SQL Server CLR Stored Procedures for External Access http://www.eggheadcafe.com/tutorials/aspnet/08c40d08-af4a-41f6-9352-91ac82b90078/sql-server-clr-stored-procedures-for-external-access.aspx -- http://mail.python.org/mailman/listinfo/python-list
Re: Where and when does Python say this to you?
this is the simple code: -- import socket # Create an unbound and not-connected socket. sock = socket(AF_UNIX, SOCK_STREAM) --- Thank you ! Submitted via EggHeadCafe SharePoint Tip / Thought of the Day WebPart http://www.eggheadcafe.com/tutorials/aspnet/14280ff8-3c9f-46bd-8214-9267e613c8ec/sharepoint-tip--thought-of-the-day-webpart.aspx -- http://mail.python.org/mailman/listinfo/python-list
AF_UNIX socket not supported
Hello ! I'm trying to develop with AF_UNIX socket type in python (2.5) but python says that AF_UNIX is not supported How can I do for work with AF_UNIX sockets? Thank you -- http://mail.python.org/mailman/listinfo/python-list
Re: Where and when does Python say this to you?
On 8 feb, 14:40, Chris Rebert wrote: > On Tue, Feb 8, 2011 at 5:26 AM, gracemia gracemia wrote: > > File "prueba.py", line 4, in > > sock = socket(AF_UNIX, SOCK_STREAM) > > NameError: name 'AF_UNIX' is not defined > > > code: > > > import socket > > sock = socket(AF_UNIX, SOCK_STREAM) > > You need to qualify all those names. Normal `import` doesn't dump all > the importee's names into the importer's namespace; it only imports > the name of the module itself. Thus: > > import socket > sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) > > I would recommend (re-)reading the relevant part of the > tutorial:http://docs.python.org/tutorial/modules.html > > Cheers, > Chris > -- > I would also recommend bypassing the EggHeadCafe junk and instead > posting directly to the newsgroup/mailinglist.http://blog.rebertia.com Sorry about my reply numbers, my browser blocked. Thank you very much. It works for me. -- http://mail.python.org/mailman/listinfo/python-list
