0

I got a simple script on my server

import os
import pprint

pprint.pprint(dict(os.environ))

When I connect to my server and run it manually,I got different results with when I run it throw Ctrl+Shift+F10 in Pycharm that's caused some other code not work well, so I wanna know how to make the latter the same with the former enter image description here enter image description here

4
  • When you use os.environ the values shown are system dependent. So if you run on your own computer it will show the "environment values" of your own computer, but if you run os.environ remotely on a different computer it will show the values of that remote computer. Ideally, you'd want the program to either be independent of the environment, or have a test where it adapts to the environment. (Think that if another users runs your code on their computer, it will also be different.) Commented Oct 15 at 14:33
  • When you use Ctrl+Shift+F10 you are executing a Run configuration of Pycharm that you've previously configured see how to create a Run configuration manually. I would advise keeping 2 different run configurations for simplicity, you can make a dynamic run configuration to adapt to the environment using a macro but it involves some learning. Commented Oct 15 at 14:37
  • but I've config the remote interpreter, how can I let them be same? otherwise my unsloth stuck forever Commented Oct 16 at 3:04
  • I've tried the "Emulate terminal in output console" option, but it doesn't help Commented Oct 16 at 3:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.