Python Log 02-09-2014, 08:09 PM
#1
I was trying to write a simple log for a software I'm working on and I came across an error. I couldn't find out what was wrong so I thought someone else might be able to...
Thanks!:epic:
Code:
import getpass
pc_user = getpass.getuser()
target_log = 'C:\Users\' + pc_user + '\Desktop\log.txt'
with open(target_log, 'a') as the_file:
the_file.write('Hello\n')
![[+]](https://sinister.li/images/modern/collapse_collapsed.png)