There are various distributions of qsub, each with their own syntax (pbs_pro, torque, openpbs) .
If you are using the torque variant, check out chapter 2 of the documentation. http://docs.adaptivecomputing.com/torque/help.htm
Basically you submit a job like so
qsub -l nodes=1:ppn=2 -l walltime=300 -l node=foo training.py
You can alternatively add these flags as part of the job submit script.
cat training.py
#!/usr/bin/python
#PBS nodes=foo
#PBS walltime=300
To specify which version of python to use, you will either need to install python yourself (assuming you have root), or request that your sys admin install python 2.7 for you on the nodes.