#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    100
    Rep Power
    2

    Python exceptions doubt.


    What does this 'as' mean in:
    Code:
    try:
    ...
    except IndexError as X:
    ???
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2012
    Location
    39N 104.28W
    Posts
    158
    Rep Power
    2
    Originally Posted by Akshat1
    What does this 'as' mean in:
    Code:
    try:
    ...
    except IndexError as X:
    ???
    It means that in subsequent statements, the IndexError object may be referred to as "X".
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Posts
    100
    Rep Power
    2
    Originally Posted by rrashkin
    It means that in subsequent statements, the IndexError object may be referred to as "X".
    OK. Thanks a lot.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0
    I think that means assign IndexError exception to a variable X. Well i use this technique when i don't want to print the python generated error to be displayed on the screen....

    "networls.wordpress.com"

IMN logo majestic logo threadwatch logo seochat tools logo