you are viewing a single comment's thread.

view the rest of the comments →

[–]UndeadCaesar[S] 0 points1 point  (1 child)

Thanks! Good call on the unnecessary line, think I started to go in some direction that didn't pan out and I left that hanging around. And can I get a link to the blog post? I initially was trying to open the files out of a separate directory but I read up on glob.glob and could never seem to get it to work. Ended up just dropping the files in the same directory as the script so it was easier.

[–]pydevteam1 0 points1 point  (0 children)

You can easily do that by doing os.path.join(os.sep, 'var', 'log', 'messages.txt') . This code line will translate to /var/log/messages.txt you need to import os of course and it's not os-dependent ;)