[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[modeller_usage] Use $SGE_TASK_ID in the python script
- To: "=?gb18030?b?bW9kZWxsZXJfdXNhZ2U=?=" <>
- Subject: [modeller_usage] Use $SGE_TASK_ID in the python script
- From: "=?gb18030?b?WkhBTkcgQ2hlbmc=?=" <>
- Date: Thu, 13 May 2021 16:05:19 +0100
- Cc: "=?gb18030?b?1cKzzFFR?=" <>
- Feedback-id: webmail:qq.com:bgweb:bgweb1
This thread told me to use $SGE_TASK_ID to generate random integer
https://salilab.org/archives/modeller_usage/2020/msg00077.html
I tried:
random_integer = int(-1*str($SGE_TASK_ID)[-4:])
# so that the number is within the range of (-50000, -2)
But I was told the $ sign is invalid:
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!