Mr Zaug wrote: > That makes sense. > > So I still can't see how to write the string object to a file whist naming > the file with whatever values I provided for the NNN and BRAND variables. > > Printing the contents of the string object is working with all the > expected substitutions. Do I need to convert the string object into a file > before I write it? Or do I need to open a new file and somehow stuff the > string object into it?
Yes, open a new file and write the string using the write() method. You can use string formatting to build the filename, too: text = ... # the string you want to write nnn = raw_input("What is the serial number of the site? ") brand = raw_input("What is the brand, or product name? ") filename = "{NNN}{BRAND}_farm.any".format(BRAND=brand, NNN=nnn) with open(filename, "w") as outstream: outstream.write(text) -- https://mail.python.org/mailman/listinfo/python-list