Re: [Tutor] Python IDE
Check out geany. It's fairly simple but I've found it very neat and simple. http://geany.uvena.de/ On 6/11/07, scott <[EMAIL PROTECTED]> wrote: Could someone suggest a few good IDE's for me to look at. I would need a IDE that haves syntax highlighting and I also really like type completion where the IDE gives you suggestions as you type. -m ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
[Tutor] Sloppy Code ?
Hi guys Very new to python programming but am really enjoying it. Anyway, I was just wondering if this code could be improved on in anway. ... stdin, stdout, stderr = os.popen3('/bin/hostname -f') system_name = stdout.read() stdin.close() stderr.close() stdout.close() ... report.write("System Report for: ") report.write(system_name) ... Is there a better way of doing this ? It works for what I want to do, but I would like to know if there's another way of doing things Thanks in advance. Matt E matt.erasmus (at) gmail (dot) com ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Sloppy Code ?
Hi Michael Yes, that does help, although it doesn't print the FQDN which is what I'm really after. But thanks to you I now know about the socket module (is that the right terminology ?) and using the Python script in Vim I found socket.getfqdn() which prints exactly what I needed... So my code goes from: stdin, stdout, stderr = os.popen3('/bin/hostname -f') system_name = stdout.read() stdin.close() stderr.close() stdout.close() ... to report.write(socket.getfqdn()) On 13/11/06, Michael Lange <[EMAIL PROTECTED]> wrote: > import socket > print socket.gethostname() > > I hope this helps Thanks so much Michael -Matt ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor