As you have mentioned it doesn't change anything.
First, you should redirect both standard input and standard error from the crontab execution like below:
*/2 * * * * /usr/bin/python /home/souza/Documets/Listener/listener.py > /tmp/listener.log 2>&1
Then you can view the file /tmp/listener.log
to see if the script executed as you expected.
Second, I guess what you mean by change anything is by watching the files created by your program:
f = file('counter', 'r+w')
json_file = file('json_file_create_server.json', 'r+w')
The crontab job above won't create these file in directory /home/souza/Documets/Listener
, as the cron job is not executed in this directory, and you use relative path in the program. So to create this file in directory /home/souza/Documets/Listener
, the following cron job will do the trick:
*/2 * * * * cd /home/souza/Documets/Listener && /usr/bin/python listener.py > /tmp/listener.log 2>&1
Change to the working directory and execute the script from there, and then you can view the files created in place.