I am creating a dictionary by parsing a text file. The code is below:
backup_servers = {} fo = open('c:/test/backup_shares.txt') for line in fo: backup_server = line.split(',') backup_servers[backup_server[0]]=backup_server[1] for i, v in backup_servers.items(): backup_shares = i archive_dir = v archive_dir += '/' archive_dir += str(today) archive_dir += '.txt' I need to use the output from the above with the win32.py modules to map drives and then create a file name with timestamp appended to it for backups that I'm doing and database dumps. The problem is that it's output like so: c:/test /backup_name_2011-03-03.txt \\server_name1\backup_share c:/test /backup_name_2011-03-03.txt \\server_name1\backup_share I've tried this several ways and using a print command as so: print backup_shares, archive_dir print '%s %s' %( backup_shares, archive_dir) and it still inserts a new line The contents of the file are just: \\server_name1\backup_share$,c:/test \\server_name1\backup_share$,c:/test I tried including the backup slashes in the text file, omitting them and including them in the print statement, to no avail. Any comments? Becky
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor