Python-list Digest, Vol 18, Issue 366
Vidyasagar
vidyasagar.svn at gmail.com
Wed Mar 23 06:08:40 EST 2005
I have a doubt in python curses....
how to get the current screen size using python curses...
glad if neone cud help....
thankz
Sagar
On Wed, 23 Mar 2005 12:00:17 +0100 (CET),
python-list-request at python.org <python-list-request at python.org> wrote:
> Send Python-list mailing list submissions to
> python-list at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mail.python.org/mailman/listinfo/python-list
> or, via email, send a message with subject or body 'help' to
> python-list-request at python.org
>
> You can reach the person managing the list at
> python-list-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Python-list digest..."
>
>
> Today's Topics:
>
> 1. Re: cross platform use of set locale (Serge Orlov)
> 2. Re: Python to c++ conversion problem (Ahmed MOHAMED ALI)
> 3. setattr inside a module (kramb64)
> 4. Re: cross platform use of set locale (Timothy Smith)
> 5. Re: Regular Expressions (Roel Schroeven)
>
>
>
> ---------- Forwarded message ----------
> From: "Serge Orlov" <Serge.Orlov at gmail.com>
> To: python-list at python.org
> Date: 23 Mar 2005 02:34:06 -0800
> Subject: Re: cross platform use of set locale
> Timothy Smith wrote:
> > thats ok, but how do i get it to group thousands with a , ?
> > and thats would mean i'd have to run everything through a formatter
> > before i displayed it :/ it'd be nicer if i could just select a
> > proper locale
>
> I think you're misusing locale. There is no guarantee that any specific
> locale will have properties (like grouping) set to a known value.
> Are you trying to format money? Then you need a special class so that
> you can say:
>
> d = Dollars(1000000.01)
> print "You have %s in your account" % d
>
> and get
>
> You have $1,000,000.01 in your account.
>
> Serge.
>
>
>
> ---------- Forwarded message ----------
> From: "Ahmed MOHAMED ALI" <ahmedmo at wanadoo.fr>
> To: python-list at python.org
> Date: Wed, 23 Mar 2005 11:54:24 +0100
> Subject: Re: Python to c++ conversion problem
> Hi,
> Convert the string to int then cast the int to enum with static_cast.
> Ahmed
>
> "Akdes Serin" <e0427463 at student.tuwien.ac.at> wrote in message
> news:424141bb$0$12642$3b214f66 at tunews.univie.ac.at...
> > I have a code in python like
> > if eval('player.moveRoom(SeLinuxMud.Direction.' + x + ')'): # moveRoom
> > function takes Direction enum as a parameter
> >
> > When I am trying to write this code in c++
> > if (player->moveRoom(s[1])) //s[1] is a string so it outputs an error
> > because of not taking enum as a parameter
> >
> > How can I change string to enum in c++?
> > Thanks.
> >
> >
>
>
>
> ---------- Forwarded message ----------
> From: kramb64 <kramb64 at hotmail.com>
> To: python-list at python.org
> Date: Wed, 23 Mar 2005 11:35:34 +0100
> Subject: setattr inside a module
> I'm trying to use setattr inside a module.
> >From outside a module it's easy:
>
> import spam
> name="hello"
> value=1
> setattr(spam, name, value)
>
> But if I want to do this inside the module spam itself, what I've to
> pass to setattr as first argument?
>
> Thanks a lot for your time.
> Marco.
>
>
>
> ---------- Forwarded message ----------
> From: Timothy Smith <timothy at open-networks.net>
> To: Serge Orlov <Serge.Orlov at gmail.com>, python-list at python.org
> Date: Wed, 23 Mar 2005 20:52:06 +1000
> Subject: Re: cross platform use of set locale
> Serge Orlov wrote:
>
> >Timothy Smith wrote:
> >
> >
> >>thats ok, but how do i get it to group thousands with a , ?
> >>and thats would mean i'd have to run everything through a formatter
> >>before i displayed it :/ it'd be nicer if i could just select a
> >>proper locale
> >>
> >>
> >
> >I think you're misusing locale. There is no guarantee that any specific
> >locale will have properties (like grouping) set to a known value.
> >Are you trying to format money? Then you need a special class so that
> >you can say:
> >
> >d = Dollars(1000000.01)
> >print "You have %s in your account" % d
> >
> >and get
> >
> >You have $1,000,000.01 in your account.
> >
> > Serge.
> >
> >
> >
> thats exactly what i'm trying to do, only having to do that for all my
> outputs is more work then i'd like :/
> why is this a misuse of locale? it's exactly what locale is meant for
> isn't it?
>
>
>
> ---------- Forwarded message ----------
> From: Roel Schroeven <rschroev_nospam_ml at fastmail.fm>
> To: python-list at python.org
> Date: Wed, 23 Mar 2005 10:51:41 GMT
> Subject: Re: Regular Expressions
> Ron wrote:
> > This is probably a repeated question, but try as I might I was unable
> > to find something similar in the archives.
> >
> > I'm trying to develop a regular expression for recognizing a simplified
> > C-Style string syntax. I need it to be able to handle escape sequences
> > of the form \x where x is any character including ".
> >
> > Here's what I'm trying:
> >
> > \"([^"\\]|(\\.))*\"
> >
> > When I try to get it to recognize something like:
> >
> > "I said, \"Hello!\""
> >
> > It stops at the first quote after the \.
>
> Works for me:
>
> >>> print re.search(r'\"([^"\\]|(\\.))*\"',
> ... r'"I said \"Hello!\""').group(0)
> "I said \"Hello!\""
>
> You can leave out the backslashes in fron of the first and last quotes
> in the regex, by the way, at least if you use ' instead of " to delimite it:
>
> >>> print re.search(r'"([^"\\]|(\\.))*"',
> ... r'"I said \"Hello!\""').group(0)
> "I said \"Hello!\""
>
> --
> If I have been able to see further, it was only because I stood
> on the shoulders of giants. -- Isaac Newton
>
> Roel Schroeven
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
More information about the Python-list
mailing list