-1

During debug sessions in PyCharm I need to set some environment variables to None value.

There is good explanation on how to set Run/Debug configuration environment variables in PyCharm How to set environment variables in PyCharm?, but they set each variable to specific value.

It is possible to delete environment variable from Run/Debug configuration setting it to None, but I would prefer to keep the variable's name inside PyCharm configuration settings for further use.

So how I set it to python None?

Alexander Borochkin
  • 4,249
  • 7
  • 38
  • 53

2 Answers2

1

You can't. Environment variables behave as Windows determines, and Windows doesn't provide an equivalent of Python's None. If you do SET MYVAR= at a console prompt, Windows will delete the variable. There is little that PyCharm can do to change that.

But there is nothing to stop you having an environment variable called #MYVAR that is set to the old value of MYVAR.

BoarGules
  • 16,440
  • 2
  • 27
  • 44
0

I found the solution. I just have to create different run/debug configurations with different environment variables.

Alexander Borochkin
  • 4,249
  • 7
  • 38
  • 53