Home > Software design >  add `DEBUG=1` commands to windows?
add `DEBUG=1` commands to windows?

Time:09-29

I'm trying to use kaki library with kivy and python but to use it you need to run

DEBUG=1 python main.py

but I'm facing this error

DEBUG=1 : The term 'DEBUG=1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that 
the path is correct and try again.
At line:1 char:1
  DEBUG=1 python main.py
  ~~~~~~~
      CategoryInfo          : ObjectNotFound: (DEBUG=1:String) [], CommandNotFoundException
      FullyQualifiedErrorId : CommandNotFoundException


but I can find any source about how to add this command to my path

I'm using

python:3.7
windows 10

I will add any information if need it

CodePudding user response:

In PowerShell, you can write to an environment variable which will be inherited by child processes, like this:

PS ~> $env:DEBUG = 1
PS ~> python main.py

Or as two statements on a single line:

$env:DEBUG = 1; python main.py

Python will now get the value 1 when resolving the DEBUG environment variable

In cmd.exe you can use the set keyword:

C:\> set DEBUG=1 && python main.py
  • Related