I'm not sure I understand the question completely but maybe the function
below does what you want.
def lower_case(s):
return Testing Functions-lower case: + s.lower()
print lower_case(AbCdEfG)
From: python-list-bounces+joe=goldthwaites@p
Hi Kathy,
The defaults only get assigned when you leave them out of the list. This
will work the way you want by setting b & c to the defaults.
print my_func(a)
When you try this;
a = "testing"
b = "defaults"
print my_func(a, b, c)
s+joe=goldthwaites@python.org
[mailto:python-list-bounces+joe=goldthwaites@python.org] On Behalf Of
MRAB
Sent: Thursday, November 25, 2010 9:03 PM
To: python-list@python.org
Subject: Re: Parsing markup.
On 26/11/2010 03:28, Joe Goldthwaite wrote:
> I'm attempting to parse some basic tagged
I'm attempting to parse some basic tagged markup. The output of the TinyMCE
editor returns a string that looks something like this;
This is a paragraph with bold and italic elements in
itIt can be made up of multiple lines separated by pagagraph
tags.
I'm trying to render the paragraph int
I've been working with some developers on a project. Our standard number
formatting for the entire web site is comma separated with no decimals.
Currency is formatted with the dollar sign. This is basically how they did
it;
import locale
def currency(value):
return locale.currency(va
Hi Ulrich,
Ascii.csv isn't really a latin-1 encoded file. It's an ascii file with a
few characters above the 128 range that are causing Postgresql Unicode
errors. Those characters work fine in the Windows world but they're not the
correct byte representation for Unicode. What I'm attempting to d
Hi Steven,
I read through the article you referenced. I understand Unicode better now.
I wasn't completely ignorant of the subject. My confusion is more about how
Python is handling Unicode than Unicode itself. I guess I'm fighting my own
misconceptions. I do that a lot. It's hard for me to un
> Hello hello ... you are running on Windows; the likelihood that you
> actually have data encoded in latin1 is very very small. Follow MRAB's
> answer but replace "latin1" by "cp1252".
I think you're right. The database I'm working with is a US zip code
database. It gets updated monthly. The p
Thanks to all of you who responded. I guess I was working from the wrong
premise. I was thinking that a file could write any kind of data and that
once I had my Unicode string, I could just write it out with a standard
file.write() operation.
What is actually happening is the file.write() operati
Hi,
I've got an Ascii file with some latin characters. Specifically \xe1 and
\xfc. I'm trying to import it into a Postgresql database that's running in
Unicode mode. The Unicode converter chokes on those two characters.
I could just manually replace those to characters with something valid but
i
7;localhost'
cookiedict = {}
GetFirefoxCookies(domain, cookiedict)
print cookiedict
-Original Message-
From: Guilherme Polo [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 01, 2008 6:15 PM
To: [EMAIL PROTECTED]; python-list@python.org
Subject: Re: SQLite and Python 2.4
On T
e way. Since
I didn't get an error message, I'm thinking that I've got the wrong version
for the Firefox cookies.sqlite file.
I don't have a clue as to where else to look to trace it down. I'm hoping
that someone here is more familiar with it and can give me some pointers.
Thanks,
Joe Goldthwaite
--
http://mail.python.org/mailman/listinfo/python-list
>You bring up an excellent point. It might seem like I'm actually running
on
>a Macbook Pro with an Intel Core 2 Duo at 2.33 GHz with 2 GB of ram.
Err... Uhh... What I meant to say was "It might seem like I'm running on an
old
slow POS but I'm actually running on a Macbook Pro..."
Sorry, me fl
>You can't imagine why someone might prefer an iterative solution over
>a greedy one? Depending on the conditions, the cost of creating the
>list can be a greater or a lesser part of the total time spent. Actual
>iteration is essentially the same cost for both. Try looking at memory
>usage while yo
>90+ seconds?? What hardware, OS, and Python version? What else was
>running in the background?
>With this kit:
>OS Name: Microsoft Windows XP Professional
>Version: 5.1.2600 Service Pack 2 Build 2600
>Processor: x86 Family 15 Model 36 Stepping 2 AuthenticAMD ~1995 Mhz
>Python: Pyt
ern Schliessmann
Sent: Thursday, December 06, 2007 3:33 PM
To: python-list@python.org
Subject: Re: I'm missing something here with range vs. xrange
Joe Goldthwaite wrote:
> I read that the range function builds a list and that xrange
> returns an iterator and is therefore more effici
Duncan Booth wrote:
>for item in list:
>if item == 'searched.domain':
>return item...
[EMAIL PROTECTED] wrote:
>Sure, but I have two options here, none of them nice: either "write C
>in Python" or do it inefficient and still elaborate way.
I don't understand your point at all. How
I've been playing with Python a bit. Doing little performance benchmarks and
working with Psyco. It's been fun and I've been learning a lot. For
example, in a previous post, I was looking for a way to dynamically add new
runtime function to a class. Martin told me to use a class instance
variabl
I'm not sure how to even ask this question. I'm working on a financial
reporting application. The current system is very limited in what it can
display. You can see reports with columns of Period, Quarter, Year to date
or you can see a yearly trend. I'd like for the users to be able to define
t
[EMAIL PROTECTED] wrote:
>Makes perfect sense to me! Think about it:
>
>method 1: looks up the method directly from the object (fastest)
>method 2: looks up __class__, then looks up __dict__, then gets the
>element from __dict__
>method 3: looks up caller, looks up __class__, looks up __dict__, ge
Hi everyone,
I'm a developer who's been using python for a couple of years. I wrote a
fairly large application using it but I was learning the language at the
same time so it most of the code kind of sucks.
I've learned a lot since then and I've been going through my code trying to
organize it b
21 matches
Mail list logo