I have an environment variable called% CCDeviceID%. When I run a command using python on the command line, I want to be able to use this variable, including% CCDeviceID% in the script does not work. How to implement environment variables in my python script?
Thanks Ed
Use os.environ:
os.environ
import os print os.environ['CCDeviceID']
You can get a list of all the environment variables available to you by simply following these steps:
>>> import os >>> print os.environ
os.environ - , env , , %. CCDeviceID.
%
CCDeviceID
Source: https://habr.com/ru/post/1545588/More articles:RabbitMQ - Close Waiting / Dangling Channels - multithreadingfailed to disable Spring security configuration - javaScala / Play Framework: how to change fields in a Form object before validation - scalaWhat happens if you add the list to yourself? - pythonYo Webapp: EACCES error, permission denied "Gruntfile.js" - node.jsMany-to-many doctrine update - arraysUsing the new CLVisit in CoreLocation - ios8Using FactoryGirl_for attributes with clip attachments - ruby | fooobar.comApply action to each object in a group for Phaser js - javascriptHow to create a list containing numbers from 1 to a given number in NetLogo? - listAll Articles