Re: using variables with modules

2005-05-05 Thread marc . wyburn
thanks runes, that makes sense, time for me to go off and read some more about strip and try: Cheers, MW. -- http://mail.python.org/mailman/listinfo/python-list

Re: using variables with modules

2005-05-05 Thread runes
I tested your code and made a few changes: import _winreg import sys readfile = open("C:\scripts\ip.txt", 'r') IPList = readfile.readlines() for ClientIP in IPList: ClientIP = ClientIP.strip() ClientIP = r'\\' + ClientIP try: key = _winreg.ConnectRegistry(ClientIP, _winreg.H

Re: using variables with modules

2005-05-05 Thread runes
The only problem I can see, is trailing whitespace from the ip.txt file. Perhaps ClientIP.strip() will help? -- http://mail.python.org/mailman/listinfo/python-list

using variables with modules

2005-05-05 Thread marc . wyburn
Hi, I am trying to move away from Windows only scripting to Python. I've written a quick script that will pull the product version from the client registry. I can get the IP addresses from a file into a list and then pull each element in the list using the for loop. I am setting each element to a