Replies: 3 comments 1 reply
-
To achieve this, you can use the Set CODON_ON environment variable to TRUE: export CODON_ON=TRUE Check if CODON_ON is TRUE: import os
if os.getenv('CODON_ON') == 'TRUE':
print('Codon running...')
else:
print('Python running...') |
Beta Was this translation helpful? Give feedback.
-
I think another approach could be to create a symbolic link between
So one still has |
Beta Was this translation helpful? Give feedback.
-
Thanks!
… On Apr 1, 2023, at 12:50 PM, Elis Byberi ***@***.***> wrote:
To achieve this, you can use the os.getenv() method. Define an environment variable named CODON_ON to indicate whether Codon is running or not, and then check if this variable is set to TRUE to determine whether Codon is currently running or not.
Set CODON_ON environment variable to TRUE:
export CODON_ON=TRUE
Check if CODON_ON is TRUE:
import os
if os.getenv('CODON_ON') == 'TRUE':
print('Codon running...')
else:
print('Python running...')
—
Reply to this email directly, view it on GitHub <#275 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAIIQKHK5ZC27PQUIV7TS5LW7BTF3ANCNFSM6AAAAAAWAIC3QY>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
I have been playing with getting something to run and need to import a few unimplemented features. As I do this my source becomes incompatible with python. As a sanity check I go back to see if the modified code still works with python (for instance, after changing a list of lists to tuples) but then I have to delete the 'from python ' lines, since those don't work with python. Seems like some sort of conditional would be worthwhile, and seems like it needs to be on the Codon side, rather than the python side.
A more general solution (addressing other language variations) might be optimal.
Beta Was this translation helpful? Give feedback.
All reactions