13 May
2021
13 May
'21
9:15 a.m.
On 5/13/21 8:05 AM, ZHANG Cheng wrote: > random_integer = int(-1*str($SGE_TASK_ID)[-4:]) > ^ > SyntaxError: invalid syntax > > So is that possible to use the job ID (e.g. 7172646) as an variable in > the python environment? Thank you!
A simple Google search tells you the answer; here's one hit: https://www.askpython.com/python/environment-variables-in-python
In your case, you want to use os.environ['SGE_TASK_ID'] rather than $SGE_TASK_ID.
Ben Webb, Modeller Caretaker
--
modeller-care@salilab.org https://salilab.org/modeller/
Modeller mail list: https://salilab.org/mailman/listinfo/modeller_usage