I have some code that generates a time-stamp as follows: from datetime import datetime tt = datetime.now() timestamp = "%4d-%02d-%02d %02d:%02d" % \ (tt.year, tt.month, tt.day, tt.hour, tt.minute)
I later realized that I could have written it as: from datetime import datetime from time import strftime timestamp = datetime.now().strftime( "%Y-%m-%d %H:%M" ) The first seems a little clunky with its accessing of multiple attributes, but the second has an additional import. Is there any reason to prefer one over the other? -- Michael F. Stemper There's no "me" in "team". There's no "us" in "team", either. -- https://mail.python.org/mailman/listinfo/python-list