About 10,400,000 results
Open links in new tab
  1. Is it possible to get a list of keywords in Python?

    I'd like to get a list of all of Pythons keywords as strings. It would also be rather nifty if I could do a similar thing for built in functions. Something like this : import syntax print syntax.

  2. How do I use a keyword as a variable name? - Stack Overflow

    Jun 22, 2016 · As mentioned in the comments, from is a Python keyword so you can't use it as a variable name, or an attribute name. So you need to use an alternative name, and do a conversion …

  3. What is the python keyword "with" used for? - Stack Overflow

    In python the with keyword is used when working with unmanaged resources (like file streams). It is similar to the using statement in VB.NET and C#. It allows you to ensure that a resource is "cleaned …

  4. python - Named colors in matplotlib - Stack Overflow

    What named colors are available in matplotlib for use in plots? I can find a list on the matplotlib documentation that claims that these are the only names: b: blue g: green r: red c: cyan m: mag...

  5. List of python keywords - Stack Overflow

    Jan 30, 2013 · I'm writing a program which does some code generation to python and need to treat a string differently if it is a python keyword. help (keywords) prints the python keywords and some extra …

  6. python - Passing a dictionary to a function as keyword parameters ...

    How to use a dictionary with more keys than function arguments: A solution to #3, above, is to accept (and ignore) additional kwargs in your function (note, by convention _ is a variable name used for …

  7. How can we force naming of parameters when calling a function?

    In Python 3 - Yes, you can specify * in the argument list. From docs: Parameters after “*” or “*identifier” are keyword-only parameters and may only be passed used keyword arguments.

  8. python - Positional argument vs keyword argument - Stack Overflow

    That is, Python infers that when you say 1, 2 we mean height is 1 and width is 2 based on the position they are passed (i.e., in the function definition the first parameter is the height and the second is the …

  9. Can you add new statements to Python's syntax? - Stack Overflow

    This should allow you to add new keywords, control structures etc while interpreting the source similarly to the python interpreter, thus avoiding the breakage crude regex solutions would cause.

  10. Can we use python keywords as variable names without explicitly ...

    May 27, 2020 · -5 -2 My understanding was that we cannot use python keywords as variable names. Is there any special scenario where is works? Many thanks for your help. Update: As suggested in one …