<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2800.1276" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=000345818-09012004><FONT face=Arial size=2>Hey, I'm brand 
spanking new to python, but I'm loving it.&nbsp;&nbsp;I've begun writing my 
first program that will run as a temperature monitor/recorder.&nbsp; I'm keeping 
track of unit IP's in a mysql database, and I've written a function to pull them 
out, problem is when I retrieve my 'list' of IP's from the databse, I get the 
info as a list, with each IP surrounded by ( and "&nbsp; i.e. 
(("10.1.1.205"),("10.1.1.206"))&nbsp; and I'm using strip() several times to get 
rid of the excess so that I can re-use the IP address when gathering my 
data.&nbsp; Here's the code, I hope this all makes sense.&nbsp; 
</FONT></SPAN></DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial size=2></FONT></SPAN><SPAN 
class=000345818-09012004><FONT face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial size=2>## Setup MySQL 
connection:</FONT></SPAN></DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial 
size=2>conn=MySQLdb.connect(host=SQLHOST, user=SQLUSER, db=SQLDATA 
passwd=SQLPASS)&nbsp;&nbsp;&nbsp;&nbsp;<BR>cursor=conn.cursor()&nbsp;&nbsp;&nbsp; 
## Setup MySQL cursor<BR>cursor.execute("SELECT * FROM ip")&nbsp; ## My list of 
IP address where my devices are 
located<BR>ip=cursor.fetchall()</FONT></SPAN></DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial size=2>## At this point ip 
looks like this: (("10.1.1.205"),("10.1.1.206"))</FONT></SPAN></DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial size=2>for x in 
range(len(ip)):&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
alpha=IP_strip(str(ip[x]))&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
config=getConfig(alpha)&nbsp; ##Custom function that uses httplib to get a page 
from my device over&nbsp;the network.<BR></FONT></SPAN></DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial size=2>def 
IP_strip(ip):<BR>&nbsp;&nbsp;&nbsp; alpha=string.strip(ip, 
")")<BR>&nbsp;&nbsp;&nbsp; alpha=string.strip(alpha, "(")<BR>&nbsp;&nbsp;&nbsp; 
alpha=string.strip(alpha, ",")<BR>&nbsp;&nbsp;&nbsp; 
alpha=string.strip(alpha,"'")<BR>&nbsp;&nbsp;&nbsp; return 
alpha</FONT></SPAN></DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial size=2>I'm wondering if 
there's any functions/methods that will strip the info in fewer lines.&nbsp; Or 
if there's another way of retrieving my information so that I won't have to 
strip it.</FONT></SPAN></DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=000345818-09012004><FONT face=Arial 
size=2>-Stryder</DIV></FONT></SPAN></BODY></HTML>