Questions tagged «python-os»

5
os.getenv和os.environ.get之间的区别
两种方法之间有什么区别吗? >>> os.getenv('TERM') 'xterm' >>> os.environ.get('TERM') 'xterm' >>> os.getenv('FOOBAR', "not found") == "not found" True >>> os.environ.get('FOOBAR', "not found") == "not found" True 它们似乎具有完全相同的功能。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.