The ampersand (for sending a process in the background) is not necessary for commands issued to cron via the crontab as processes are already forked. The given examples work fine without the
&. Actually the first version shows working parameters as it invokes the python interpreter with the filename of the script to be executed as parameter.
0,30 * * * * python /home/pi/pythonscripts/script.py foobar
0,30 * * * * /home/pi/pythonscripts/script.py foobar
script.py contains the first line
#!/bin/python3 and has executable flags.
An example how to use and print the passed parameter (per question of the OP):
for arg in sys.argv:
Parsing through the list
argv that contains the parameters passed to the script.
argv contains the name (and path) of the script.
argv is the first parameter, and so on. For more serious handling of arguments it is advisable to use
argparse (tutorial) instead of reinventing the wheel.