Python - Removing an element in list

How would i go about hiding the last element from a list. For example, Python outputs ['Go shopping @H']. Just wondering what code would I use to remove the @H from the result.


If you want to remove the last two characters, you can do this:


If you want to remove an element followed by @, you can do this:

import re

If you print l after any of these operations, you'll get ['Go shopping '].

If you need to do the same for each element of the list, you can loop through it removing the thing you want to remove.

for x in xrange(0, len(your_list)-1):
    your_list[x]= # use one of the methods mentioned above

Need Your Help

How do you get pyapns (python push notification) working on a mac?

django push-notification apple-push-notifications

pyapns appears to be the most popular push notification package for python. However, it does not appear to work on a mac running mountain lion. I am using a mac for development.