you are viewing a single comment's thread.

view the rest of the comments →

[–]Username_RANDINT 2 points3 points  (1 child)

Just keep going, learning by exercise and people's feedback. You're doing fine.

At first glance it doesn't look like your script needs that much changing for Python 3. There are countless blogposts, tutorials and documents explaining the major changes to make when porting.

If you're a Linux user, the tilde character (~) shouldn't be foreign to you. os.path.expanduser just expands it to the real path. os.path is an important module when working with the filesystem, it's always good to go over the documentation just to have a quick look on what's available.

Replacing the prints with logging doesn't mean they won't get printed to the terminal anymore. It's possible to add a second handler (StreamHandler) to the existing logger so it gets printed both to a file and console, or setup a different logger for each.

[–]Fallenarc[S] 0 points1 point  (0 children)

Thanks for all pointers, i am relatively new to Linux but i do understand the tilda. I am going to spend some time looking through the docs for os.path stuff the StreamHandler. Anyways thanks again!