Created
February 26, 2013 07:22
-
-
Save santosh/5036637 to your computer and use it in GitHub Desktop.
This script lists the python keywords. Its portable so running as $ python python_keywords.py will list for Python 2 and $ python3 python_keywords.py will return for Python 3. Basically it will list the keywords of the current interpreter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- coding: utf-8 -*- | |
import sys | |
import keyword | |
''' | |
File: python_keywords.py | |
Author : Santosh Kumar <https://twitter.com/sntshk> | |
Date created: Fri 22 Feb 2013 07:00:09 PM IST | |
Description: The list of python keywords | |
''' | |
print("Python version:", sys.version_info) | |
print("Python keywords:", keyword.kwlist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment