About 50 results
Open links in new tab
  1. python - How can I use a global variable in a function? - Stack Overflow

    Jul 11, 2016 · set_globvar_to_one() print_globvar() # Prints 1 Since it's unclear whether globvar = 1 is creating a local variable or changing a global variable, Python defaults to creating a local variable, …

  2. Python Conditional Variable Setting - Stack Overflow

    For some reason I can't remember how to do this - I believe there was a way to set a variable in Python, if a condition was true? What I mean is this: value = 'Test' if 1 == 1 Where it would hope...

  3. How to set python variables to true or false? - Stack Overflow

    a = true NameError: global name 'true' is not defined What is the python syntax to set a variable true or false? Python 2.7.3

  4. python - How do I create variable variables? - Stack Overflow

    The "base" variable name becomes the name of the list and the varying identifier is used to access it. Finally, don't forget other data structures, such as the set - this is similar to a dictionary, except that …

  5. python - How to assign a variable in an IF condition, and then return ...

    Apr 27, 2019 · The one liner doesn't work because, in Python, assignment (fruit = isBig(y)) is a statement, not an expression. In C, C++, Perl, and countless other languages it is an expression, and …

  6. python - Set variable from another variable in Jinja - Stack Overflow

    I would like to know how can I set a variable with another variable in Jinja. I have got a submenu and I would like to show which link is active. I tried this: {% set active_link = {{recordtype}} -...

  7. python - How to add to the PYTHONPATH in Windows, so it finds my ...

    Sep 13, 2010 · Python 3 by default will be installed in C:\Users\\AppData\Local\Programs\Python\Python35-32\ So this path has to be added to Path …

  8. yaml - Azure Pipelines - Output variable from python script file to ...

    Sep 7, 2021 · Now you can technically do all kinds of cool stuff in python, then set, and reference the variables in the following steps. In my case I have to extract specific package version numbers from …

  9. How can I access environment variables in Python?

    I haven’t set it (PYTHONPATH) before; what I am doing just go with command prompt and type CMD anywhere (since python.exe is in my shell PATH). If I try to access Window ENVIRONMENT …

  10. python - How to set default value for variable? - Stack Overflow

    How to set default value for variable? Asked 9 years, 10 months ago Modified 3 years, 7 months ago Viewed 52k times