I have a Python script which simply writes some text and saves it to a file
#! /usr/bin/python3
def main():
filename = \'/home/user/testHello.txt\'
I've had a similar problem with a @reboot cron job not running; in case it helps anyone else:
The problem for me is that my home directory is encrypted with eCryptfs (which is what you get if you choose to encrypt your home directory when installing Ubuntu) - broadly speaking this means that the contents of your home directory aren't available until you log in, but cron runs @reboot jobs on reboot, not when you log in.