to filter "}"

A forum for general discussion of the Python programming language. to filter "}"

Postby alabview » Tue Oct 29, 2013 9:30 am

Hi there,

I have no idea how to remove "}". My code is below,

Code: Select all

When I perform querying....
Code: Select all

So, I would like to remove "}" after "1000" and no idea how to do.

Many Thanks.
Posts: 22
Joined: Mon Sep 16, 2013 1:48 pm

Re: to filter "}"

Postby metulburr » Tue Oct 29, 2013 9:45 am

Code: Select all
we will be moving to on October 1 2016
more details here
User avatar
Posts: 2244
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: to filter "}"

Postby micseydel » Tue Oct 29, 2013 4:35 pm

How about str.rstrip?
Due to the reasons discussed here we will be moving to on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: to filter "}"

Postby ochichinyezaboombwa » Tue Oct 29, 2013 5:59 pm

And could you please stop CAPITALIZING EVERYTHING? It hurts my eyes.
Posts: 203
Joined: Tue Jun 04, 2013 7:53 pm

Re: to filter "}"

Postby bunburya » Fri Nov 08, 2013 1:41 am

If the variables are to be used as constants, then PEP8 says they should be given names in ALL_CAPS.

Micseydel's rstrip idea seems better to me than [:-1], with the caveat that it will not work correctly if the final value contained in the curly braces also ends with a '}'. |

Join the #python-forum IRC channel on!
Posts: 9
Joined: Sat Feb 09, 2013 7:28 pm
Location: Dublin, Ireland

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 3 guests