My curl.trill works:
JavaScript
x
7
1
$ = os.getenv('$')
2
3
cookies = {
4
'AlteonP': f"AKgyK+bV+AqyP5hdVrxVFA{$}",
5
'JSESSIONID': '919BAF7B84FEF902E41306B1C27345E8.lgd',
6
}
7
But python throws this error:
JavaScript
1
6
1
$ = os.getenv('$')
2
File "<stdin>", line 1
3
$ = os.getenv('$')
4
^
5
SyntaxError: invalid syntax
6
I have tried changing $
to something else but it didn’t help. Any suggestions?
Advertisement
Answer
you can use $
as the name of a variable, try this code:
JavaScript
1
11
11
1
import os
2
3
key = 'HOME'
4
value = os.getenv(key)
5
print("Value of 'HOME' environment variable :", value)
6
7
8
key = '$'
9
value = os.getenv(key)
10
print("Value of '$' environment variable :", value)
11