About 54 results
Open links in new tab
  1. What is the Python equivalent for a case/switch statement?

    Jul 14, 2012 · Python 3.10.0 provides an official syntactic equivalent, making the submitted answers not the optimal solutions anymore! In this SO post I try to cover everything you might want to know about …

  2. Replacements for switch statement in Python? - Stack Overflow

    Sep 13, 2008 · I want to write a function in Python that returns different fixed values based on the value of an input index. In other languages I would use a switch or case statement, but Python does not …

  3. Python Match Case (Switch) Performance - Stack Overflow

    Jul 21, 2021 · A while back, I published an article on Medium about Python's match-case performance, analyzing the generated byte code and performing benchmarks and comparisons.

  4. Есть ли в Python оператор switch case? - Stack Overflow на русском

    Столкнулся с тем, что требуется реализовать множественное условие, которое в других языках я бы реализовал с помощью конструкции switch-case. В Python мне приходится расписывать всё …

  5. python - What is the purpose of the -m switch? - Stack Overflow

    Python 2.4 adds the command line switch -m to allow modules to be located using the Python module namespace for execution as scripts. The motivating examples were standard library modules such …

  6. What is the syntactical equivalent to switch/case in Python?

    Mar 30, 2021 · With Python, there are some differences to note though. Cases don't fall through It's common that languages with switch - case statements execute every case the value matches - from …

  7. Switch in Python - Stack Overflow

    Jan 17, 2012 · 3 Other ans are suitable for older version of python. For python v3.10+ you can use match/case which is more powerful than general switch/case construct.

  8. python - Switch between two frames in tkinter? - Stack Overflow

    Over time people have asked other questions using this code (or an online tutorial that copied this code) as a starting point. You might want to read the answers to these questions: Understanding parent …

  9. How to use multiple cases in Match (switch in other languages) cases in ...

    Oct 20, 2021 · How to use multiple cases in Match (switch in other languages) cases in Python 3.10 Ask Question Asked 4 years, 5 months ago Modified 2 years, 7 months ago

  10. How Should I Set Default Python Version In Windows?

    Feb 23, 2011 · 170 I installed Python 2.6 and Python 3.1 on Windows 7 and set environment variable: path = d:\python2.6. When I run python in cmd, it displays the python version 2.6, which is what I …