I am starting a python code once my system (debian based raspberry pi) starts by adding the statement sudo python /path/code.py in crontab -e. On boot up it does start. But I would like to know, how can I stop the thing from running using the command line once it starts up.
You must not add it to the crontab which will start it on a time scheduled base. Instead write an init script or (more simple) add it to /etc/rc.local !
Stopping a autostarted python program started using crontab