Yes, it saved my time big time.
Thank you Bruno.
I use the print >>>file to generate HTML files. print is very flexible and
nice.
The dictionary formatting that Brunto said is awesome!
Thanks again,
Alan
"Jon Clements" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Di
Truthfully, I wouldn't mind it at all. In Python, I frequently write
things like
i == int(f)
or vice versa just to avoid subtle bugs that sometimes creep in when
later modifications to code change the original assumptions.
When working in C, I always set the compiler for maximum warnings and
d
Edward Elliott <[EMAIL PROTECTED]> writes:
> John J. Lee wrote:
>
> > find / -maxdepth 3 -size -100k -type f -exec grep -sli pythonpath '{}' \;
> >
> >
> > The minus in '-100k' (meaning "less than 100k") seems to be
> > undocumented, at least on my system.
>
> It should be standard in linux
Laszlo Nagy <[EMAIL PROTECTED]> writes:
[...]
> how can I return the redirection URL?
> I tried to get this information from the exception but I could not. Is
> it possible to read it from the openerdirector?
> Any suggestions?
>
>
> try:
>self.post_multipart(
>
On Thu, 01 Jun 2006 13:40:34 -0700
[EMAIL PROTECTED] wrote:
#> Scott David Daniels wrote:
#> > Would you say that envelope containing five $100 bills is equal to
#> > an envelope containing five $100 bills with different serial numbers?
#> Yes (unless I was testing the assertion that the second e
In article <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]> wrote:
>hello,
>
>i'm looking for a way to have a list of number grouped by consecutive
>interval, after a search, for example :
>
>[3, 6, 7, 8, 12, 13, 15]
>
>=>
>
>[[3, 4], [6,9], [12, 14], [15, 16]]
>
>(6, not following 3, so 3 => [3:4] ; 7, 8
I believe that 'is' tests equality of reference, such that
>>> a = range(1,3)
>>> b = range(1,3)
>>> a is b
False
The 'is' operator tells you whether a and b refer to the same object.
What I've been discussing is whether == should test for "structural"
equality so that a and b remain equivalent u
[EMAIL PROTECTED] wrote:
> i'm looking for a way to have a list of number grouped by consecutive
> interval, after a search, for example :
>
> [3, 6, 7, 8, 12, 13, 15]
>
> =>
>
> [[3, 4], [6,9], [12, 14], [15, 16]]
>
> (6, not following 3, so 3 => [3:4] ; 7, 8 following 6 so 6, 7, 8 =>
> [6:9], and
BartlebyScrivener wrote:
>>>I've looked at various search-and-replace snippets but none that address
>>>what I am trying to do
>
>
> I think you need to tell more about what you're trying to do. You say
> it's in a database? Is that why you can't just put the whole blob in
> your text editor
Dennis Lee Bieber wrote:
> On 1 Jun 2006 03:29:35 -0700, "Brian" <[EMAIL PROTECTED]> declaimed the
> following in comp.lang.python:
>
> > Thank you for that response. Your code was very helpful to me. I
> > think that actually seeing how it should be done in Python was a lot
> > more educational
Please don't post non-text message bodies to discussion
forums. Message bodies should be plain text.
"Anthra Norell" <[EMAIL PROTECTED]> writes:
> If a piece of code exits with an exception before it closes an open
> file, that file seems to remain locked, which is real pain in the
> butt
You wi
On Thu, 2006-06-01 at 08:31 -0400, Michael Yanowitz wrote:
> Hello:
>
>
>I have a Tkinter GUI Dialog with many buttons and labels and text
> widgets.
> What I would like to do is, can I:
>
> 1) Disable/deactivate/hide a button, text widget that is already drawn (and
>of course the opposi
David Isaac wrote:
> 2. Is this a good argmax (as long as I know the iterable is finite)?
> def argmax(iterable): return max(izip( iterable, count() ))[1]
Other than the subtle difference that Peter Otten pointed out, that's a
good method.
However if the iterable is a list, it's cleaner (and more
[EMAIL PROTECTED] wrote:
> hello,
>
> i'm looking for a way to have a list of number grouped by consecutive
> interval, after a search, for example :
>
> [3, 6, 7, 8, 12, 13, 15]
>
> =>
>
> [[3, 4], [6,9], [12, 14], [15, 16]]
>
> (6, not following 3, so 3 => [3:4] ; 7, 8 following 6 so 6, 7, 8 =>
>
On Thu, 01 Jun 2006 15:12:23 -0700
[EMAIL PROTECTED] wrote:
#> I believe that 'is' tests equality of reference, such that
#>
#> >>> a = range(1,3)
#> >>> b = range(1,3)
#> >>> a is b
#> False
#>
#> The 'is' operator tells you whether a and b refer to the same object.
#> What I've been discussing
[EMAIL PROTECTED] wrote:
> Hi,
> I have a python app that runs fine on MacOS X and Fedora Core 5.
>
> This evening I dragged the folder over to my windows partition and
> tried to run the rascal.
>
> The program starts up fine but at the first call to create a Table
> object
> I get
>
> Traceback
On 2/06/2006 4:18 AM, Serge Orlov wrote:
> Giovanni Bajo wrote:
>> John Machin wrote:
>>> I am an idiot, so please be gentle with me: I don't understand why you
>>> are using struct.pack at all:
>> Because I want to be able to parse largest chunks of binary datas with custom
>> formatting. Did you
I did a little re-arranging of the generator version:
def interv3(inlist):
tmp = inlist[0]
valinc = tmp+1
for val in inlist[1:]:
if val != valinc:
yield [tmp, valinc];
tmp = val
valinc = val+1
yield [tmp, valinc]
--
http://mail.python.org/m
Captain Dondo wrote:
> What I'd like to do is build the correct selectlist in the first place,
> rather than build the wrong one and then rebuild a correct one.
This is sounding more like a SQL/DB problem and less like a Python one.
If you have a field that is being pulled from the database that
In article <[EMAIL PROTECTED]>,
Paddy <[EMAIL PROTECTED]> wrote:
>=== interv2 ===
def interv2(inlist):
>...for i,val in enumerate(inlist):
>...if i==0:
>...tmp = val
>...elif val != valinc:
>...yield [tmp, valinc]
>...
Jim Segrave wrote:
> In article <[EMAIL PROTECTED]>,
> Paddy <[EMAIL PROTECTED]> wrote:
> >=== interv2 ===
> def interv2(inlist):
> >... for i,val in enumerate(inlist):
> >... if i==0:
> >... tmp = val
> >... elif val != valinc:
> >... yiel
Max a écrit :
(snip)
> But now I'm ready to do it in the real world. Nothing complicated, but a
> real project. And I have to choose my tools. Zope, Plone, Django, what
> are these?
Zope -> an application server
Plone -> a CMS built upon Zope
Django -> a MVC fullstack framework (fullstack : int
Brian wrote:
> Captain Dondo wrote:
>
>>What I'd like to do is build the correct selectlist in the first place,
>>rather than build the wrong one and then rebuild a correct one.
>
>
> This is sounding more like a SQL/DB problem and less like a Python one.
> If you have a field that is being pul
In article <[EMAIL PROTECTED]>,
Paddy <[EMAIL PROTECTED]> wrote:
>I did a little re-arranging of the generator version:
>
>def interv3(inlist):
>tmp = inlist[0]
>valinc = tmp+1
>for val in inlist[1:]:
>if val != valinc:
>yield [tmp, valinc];
>tmp = val
>
In article <[EMAIL PROTECTED]>,
Paddy <[EMAIL PROTECTED]> wrote:
>
>What I ran was more like the version below, but i did a quick
>separation of the line that has the ';' in it and goofed.
>
def interv2(inlist):
>...for i,val in enumerate(inlist):
>...if i==0:
>...
Hi,
I am using Python 2.4. I read the PEP 308 at:
http://www.python.org/dev/peps/pep-0308/
I tried the statement:
a= "Yes" if 1==1 else "No"
but the interpreter doesn't accept it.
Do we have the conditional expressions in Python 2.4?
Thank you,
Alan
--
http://mail.python.org/
[EMAIL PROTECTED]:
>are there any specific groups for zope / plone regarding questions?
Try plone-users: http://plone.org/support
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Is there any built in feature in Python that can format long integer
123456789 to 12,3456,789 ?
Thank you,
Alan
--
http://mail.python.org/mailman/listinfo/python-list
A.M wrote:
> Do we have the conditional expressions in Python 2.4?
No.
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
-- Umberto Eco
--
http://
Just curious... I have plenty of programming background (C++ being the closest
to Python), and I have a copy of Lutz's "Learning Python," but before I dive
head-first into that tome, does anyone know of a web-based or CD/DVD-based
training class that's priced for individuals?
Example of what I'
>> that one column is always the same, the name of the host that
>> the database resides on.
Then why are you pulling all of the other stuff out of the db? Why
don't you just
UPDATE tablename
SET hostname(or colname) = 'localhost'
WHERE search condition = the rows you want to change
--
BartlebyScrivener wrote:
>>>that one column is always the same, the name of the host that
>>>the database resides on.
>
>
> Then why are you pulling all of the other stuff out of the db? Why
> don't you just
>
> UPDATE tablename
> SET hostname(or colname) = 'localhost'
> WHERE search con
On 2/06/2006 8:36 AM, Paddy wrote:
> [EMAIL PROTECTED] wrote:
>> hello,
>>
>> i'm looking for a way to have a list of number grouped by consecutive
>> interval, after a search, for example :
>>
>> [3, 6, 7, 8, 12, 13, 15]
>>
>> =>
>>
>> [[3, 4], [6,9], [12, 14], [15, 16]]
>>
>> (6, not following 3,
Joel Kolstad wrote:
> Just curious... I have plenty of programming background (C++ being the
> closest
> to Python), and I have a copy of Lutz's "Learning Python," but before I dive
> head-first into that tome, does anyone know of a web-based or CD/DVD-based
> training class that's priced for i
On 2/06/2006 9:08 AM, A.M wrote:
> Hi,
>
> Is there any built in feature in Python that can format long integer
> 123456789 to 12,3456,789 ?
>
> Thank you,
> Alan
Not that I know of, but this little kludge may help:
8<---
import re
subber = re.compile(r'^(-?\d+)(\d{3})').sub
def fmt_thousands
A.M wrote:
> The application is not mission critical system. It is just a simple
> reporting tool.
Famous last words.
--
http://mail.python.org/mailman/listinfo/python-list
A.M wrote:
> Hi,
>
> Is there any built in feature in Python that can format long integer
> 123456789 to 12,3456,789 ?
>
Sorry about my previous post. It would produce 123,456,789.
"12,3456,789" is weird -- whose idea PHB or yours??
--
http://mail.python.org/mailman/listinfo/python-list
A.M wrote:
> Is there any built in feature in Python that can format long integer
> 123456789 to 12,3456,789 ?
The locale module can help you here:
>>> import locale
>>> locale.setlocale(locale.LC_ALL, '')
'English_United States.1252'
>>> locale.format('%d', 123456789, True)
'123,456,78
A.M wrote:
> Hi,
>
> Is there any built in feature in Python that can format long integer
> 123456789 to 12,3456,789 ?
>
> Thank you,
> Alan
I did this for putting commas into monetary amounts (thus the .2f):
def commas(value):
return "".join(commafy("%.2f" % value))
def commafy(s):
John Machin wrote:
> A.M wrote:
> > Hi,
> >
> > Is there any built in feature in Python that can format long integer
> > 123456789 to 12,3456,789 ?
> >
>
> Sorry about my previous post. It would produce 123,456,789.
> "12,3456,789" is weird -- whose idea PHB or yours??
If it's not a typo, it's pro
I am seeing something strange with execfile. I've simplified the code
to:
## t.py ##
print "here"
v = None
def f():
global v
v = 6
if __name__ == "__main__":
f()
print "0:", v
execfile("x.py")
print "0:", v
execfile("y.py")
print "0:", v
#
> ## x.py and y.py (they are identical) ##
> import testexec
> print "1:", v, testexec.v
> testexec.v = 7
Oops, testexec should be changed to t instead. That is:
## x.py and y.py (they are identical) ##
import t
print "1:", v, t.v
t.v = 7
--
http://mail.python.or
[EMAIL PROTECTED] wrote:
> A.M wrote:
> > Hi,
> >
> > Is there any built in feature in Python that can format long integer
> > 123456789 to 12,3456,789 ?
> >
> > Thank you,
> > Alan
>
> I did this for putting commas into monetary amounts (thus the .2f):
>
> def commas(value):
> return "".j
In article <[EMAIL PROTECTED]>,
Michael Yanowitz <[EMAIL PROTECTED]> wrote:
>Hello:
>
>
> I have a Tkinter GUI Dialog with many buttons and labels and text
>widgets.
>What I would like to do is, can I:
>
>1) Disable/deactivate/hide a button, text widget that is already drawn (and
> of course th
In article <[EMAIL PROTECTED]>,
Michael Yanowitz <[EMAIL PROTECTED]> wrote:
.
.
.
>2) Change the text of a label or button that is already drawn?
>
> based on actions taken by the user. Can it be done without destroying
>the p
Thanks for help. Is there any comprehensive library for number formatting
available on the net?
Alan
--
http://mail.python.org/mailman/listinfo/python-list
Dear A.M.,
The day is complete. My TPS reports still aren't on my desk. Either
with or without cover sheets. Not a good time to try to teach yourself
a new language. Please gather your belongings and move down to basement
storage C.
That'd be great,
Bill Lumberg
John Machin wrote:
> A.M wrote:
>
Hi,
It's been claimed that inheritance structures are less important in dynamic
languages like Python. Why is that and where can i read more about that?
/Marv
--
http://mail.python.org/mailman/listinfo/python-list
I'm sorry for asking about another language here, but since I only know
Python and I'm trying to write something in C#, I guess this is the
best place...
I'd like to know how to write this in C#:
x=[]
sz = 1000
x.extend(range(sz))
My question is about "range" and "extend". Is there any equiv
Neuruss wrote:
> I'm sorry for asking about another language here, but since I only know
> Python and I'm trying to write something in C#, I guess this is the
> best place...
>
Bad guess. Ask questions about language X on comp.lang.X
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> "Manoj Kumar P" wrote:
> > Can anyone tell me a good python editor/IDE?
> emacs!
[...]
Fredrik Lundh wrote:
> "Manoj Kumar P" wrote:
> > Can anyone tell me a good python editor/IDE?
> vim!
There is much truth in this man's replies. ;-D
Cheers,
Terry
--
Terry Hancock
<[EMAIL PROTECTED]> wrote:
> Hi Alex,
> With all due respect to your well-deserved standing in the Python
> community, I'm not convinced that equality shouldn't imply invariance
> under identical operations.
So, why aren't you satisfying my request? Provide a simple concrete
definition of what y
<[EMAIL PROTECTED]> wrote:
...
> I agree with Alex that checking for this type of inequality is not a
> trivial programming exercise. It requires (at least) a parallel
I'm not asking for ANY programming: I'm asking for a *straightforward
operational definition*. If the concept which you hanke
Slawomir Nowaczyk <[EMAIL PROTECTED]> wrote:
> On Thu, 01 Jun 2006 13:40:34 -0700
> [EMAIL PROTECTED] wrote:
>
> #> Scott David Daniels wrote:
> #> > Would you say that envelope containing five $100 bills is equal to
> #> > an envelope containing five $100 bills with different serial numbers?
>
Slawomir Nowaczyk <[EMAIL PROTECTED]> wrote:
> On Thu, 01 Jun 2006 15:12:23 -0700
> [EMAIL PROTECTED] wrote:
>
> #> I believe that 'is' tests equality of reference, such that
> #>
> #> >>> a = range(1,3)
> #> >>> b = range(1,3)
> #> >>> a is b
> #> False
> #>
> #> The 'is' operator tells you wh
"Neuruss" <[EMAIL PROTECTED]> writes:
> I'm sorry for asking about another language here, but since I only
> know Python and I'm trying to write something in C#, I guess this is
> the best place...
Really, it isn't. Post in a C# discussion forum, describing the
behaviour you want from your progra
TWiki, written in perl, makes extensive use of versioning/diff
functionality you mention through the use of RCS, which, IIRC, is the
basis for CVS. This method eliminates the need for the repository as
such, and merely requires the presence of the RCS files (and RCS).
Unless you _want_ to host
Neuruss wrote:
> I'm sorry for asking about another language here, but since I only know
> Python and I'm trying to write something in C#, I guess this is the
> best place...
>
> I'd like to know how to write this in C#:
>
> x=[]
> sz = 1000
> x.extend(range(sz))
>
> My question is about "ra
John Machin wrote:
> Neuruss wrote:
> > I'm sorry for asking about another language here, but since I only know
> > Python and I'm trying to write something in C#, I guess this is the
> > best place...
> >
>
> Bad guess. Ask questions about language X on comp.lang.X
Well, perhaps I should.
And I s
Thank you DH!!
D H wrote:
> Neuruss wrote:
> > I'm sorry for asking about another language here, but since I only know
> > Python and I'm trying to write something in C#, I guess this is the
> > best place...
> >
> > I'd like to know how to write this in C#:
> >
> > x=[]
> > sz = 1000
> > x.
Neuruss wrote:
> John Machin wrote:
> > Neuruss wrote:
> > > I'm sorry for asking about another language here, but since I only know
> > > Python and I'm trying to write something in C#, I guess this is the
> > > best place...
> > >
> >
> > Bad guess. Ask questions about language X on comp.lang.X
A.M wrote:
> Hi,
>
> Is there any built in feature in Python that can format long integer
> 123456789 to 12,3456,789 ?
Apparently you need to use the locale module. This is the
example they give online to print a simple number with commas:
import locale
locale.setlocale(locale.LC_ALL, 'English
Well the work is done now. I arrived home at 10:30 PM.
The application takes data from Oracle 10g stored procedures and renders
data to both HTML and CSV formats. The HTML reports have summary and
grouping sections and the HTML files are Excel friendly. The application is
modular and consis
aljosa wrote:
> does anybody know how to load (in-memory
> representation of PNG image) from Qt (v.4.1.3) as QImage?
If you want the data from a StringIO object, you can either *read* the
data from the object (it's a file-like object, after all), or use the
getvalue() method.
Something like
Hi all,
I just finished reading Learning Python 3rd ed, and am doing my
first Python application, which retrieves and process text and XML
documents from Web. Python helped me to write the application in a few
hours, I'm very happy with its productivity. But the performance is not
satisfacto
Neuruss wrote:
> I thougt that maybe some python programmer could have experience here
> with c# and give me a little hint.
>
> But unfortunately, there are people here who are not willing to waste
> their time helping, but enjoy to waste their time niggling...
Yeah, what jerks. They actually w
"Marvin" <[EMAIL PROTECTED]> writes:
> It's been claimed that inheritance structures are less important in
> dynamic languages like Python.
Who claimed that? I ask not because I doubt your assertion ("it was
claimed"), but rather that if someone claimed something, it seems
better to ask that pers
Erik Max Francis wrote:
> Yeah, what jerks. They actually wanted to talk about Python, not some
> random other language that you're trying to learn that has nothing to do
> with it ...
There are thousands of threads to choose from in this forum.
If they didn't like this question, they could have
[EMAIL PROTECTED] wrote:
> hello,
>
> i'm looking for a way to have a list of number grouped by consecutive
> interval, after a search, for example :
>
> [3, 6, 7, 8, 12, 13, 15]
>
> =>
>
> [[3, 4], [6,9], [12, 14], [15, 16]]
>
> (6, not following 3, so 3 => [3:4] ; 7, 8 following 6 so 6, 7, 8 =>
>
Mike Meng wrote:
> Hi all,
> I just finished reading Learning Python 3rd ed, and am doing my
> first Python application, which retrieves and process text and XML
> documents from Web. Python helped me to write the application in a few
> hours, I'm very happy with its productivity. But the pe
Gerard Flanagan wrote:
> [EMAIL PROTECTED] wrote:
> > hello,
> >
> > i'm looking for a way to have a list of number grouped by consecutive
> > interval, after a search, for example :
> >
> > [3, 6, 7, 8, 12, 13, 15]
> >
> > =>
> >
> > [[3, 4], [6,9], [12, 14], [15, 16]]
> >
> > (6, not following 3
Fredrik Lundh wrote:
> To get better performance, you should be able to use PIL's tostring()
> method together with the QImage(buffer, width, height, depth,
> colortable, numColors, bitOrder) form of the QImage constructor.
for PyQt4, that seems to have changed to QImage(buffer, width, height,
I think Aahz stated somewhere that he was workign on Effective Python.
I'm not sure if it's an ongoing plan or it's been canned though?
Mike Meng wrote:
> Hi all,
> I just finished reading Learning Python 3rd ed, and am doing my
> first Python application, which retrieves and process text a
Hi!
> There are thousands of threads to choose from in this forum.
> If they didn't like this question, they could have picked any other one
> to discuss.
> There's no need to be disagreeable :-)
I think the same thing.
--
@-salutations
Michel Claveau
--
http://mail.python.org/mailman/listi
>> I just finished reading Learning Python 3rd ed,
For real? I thought there was only a 2nd edition.
http://www.oreilly.com/catalog/lpython2/
--
http://mail.python.org/mailman/listinfo/python-list
Jim Segrave wrote:
> In article <[EMAIL PROTECTED]>,
> Paddy <[EMAIL PROTECTED]> wrote:
> >
> >What I ran was more like the version below, but i did a quick
> >separation of the line that has the ';' in it and goofed.
> >
> def interv2(inlist):
> >... for i,val in enumerate(inlist):
> >...
Hi all,
I am facing a problem while importing a file in python
script.
After doing import file i am updating that file. Later i am
accessing a dictionary contained in that
file. Eventhough changes are reflected in the file... When i
access a dictionary those changes
201 - 277 of 277 matches
Mail list logo