+ 1
File code
There’s something wrong within it, but I’m not sure what. Link: https://sololearn.com/compiler-playground/cHiEKo5SOjfT/?ref=app
7 Respostas
+ 1
ok, so i ran this on a pc and i get the same thing: "None"
so i tried removing the .get('PYTHONSTARTUP') and it returned a dictionary. which means that there are some environment variables in Sololearn, but there is no "PYTHONSTARTUP" in those variables
you can do:
print(os.environ)
and see what is available to you.
what are you trying to do with the code?
+ 1
I read the comments between you and Rain. Have you tried this code in an IDE on your machine? If it works in that case, then I'd assume there are no accessible environment variables through sololearn's py compiler, So it will only ever return "None"
+ 1
I thought it would extract something from that dictionary
0
I don’t even have ID(L)E
0
I’m on a mobile device
0
If that dictionary had the key "PYTHONSTARTUP", it would extract that, but it doesn't do so you get "None"
0
Hmm, ok