On Sat, 2005-09-17 at 23:34 -0500, Gustavo Picon wrote:
> Maybe something like this?
>
> class music(object):
> def __init__(self):
> self.lst = {}
> def __setattr__(self, name, value):
> self.__dict__[name] = value
>
> array = []
> array.
usic())
array.append(music())
# begin quoting your code
array[0].artist = 'genesis'
array[0].album = 'foxtrot'
array[0].songs = ['watcher', 'time table', 'friday']
array[1].artist = 'beatles'
array[1].album = 'abbey road'
array[1]
> ipFile.close()
>
You should be using different variables in that algorithm, because you
are concatenating strings to "mySET" over and over again.
A more efficient approach would be something like:
def findIPs():
ip = 0
while ip < 256**4:
print '.'.jo
> How can I print a word without appending a newline character? Appending
> a "," to the print statement only substitutes the newline for a space,
> which is not what I am looking for.
>
Try with:
print ''.join(str(foo) for foo in range(3))
or sys.stdout.write