I have a program that manipulates lots of very large indices, which I
implement as bit vectors (via the bitarray module). These are too
large to keep all of them in memory so I have to come up with a way to
cache and load them from disk as necessary. I've been reading about
weak references a
On Fri, 22 Oct 2010 22:03:38 -0700, Sean DiZazzo wrote:
> How can I assure him (and the client) that the transfer completed
> successfully like my log shows?
"It has worked well for many years, there are no reported bugs in the ftp
code, and the logs show the file was transferred correctly. Unle
On Thu, 21 Oct 2010 16:19:43 -0700, Raymond Hettinger wrote:
> I'm considering a nested mapping class for the collections module and
> would like to solicit feedback from people here on comp.lang.python:
>
>http://code.activestate.com/recipes/577434-nested-contexts-a-chain-
of-mapping-objects
Hi,
I have some scripts that send files via ftplib to a client's ftp
site. The scripts have generally worked great for a few years.
Recently, the client complained that only part of an important file
made it to their server. My boss got this complaint and brought it to
my attention.
The first
In article
<04a3c943-5aee-4248-9cb3-60ea42410...@j4g2000prm.googlegroups.com>,
Roger Davis wrote:
> Hi, I have some questions about the IDLE debugger. I am using the
> 2.6.6 bundle downloaded from python.org.
>
> First, how do I debug a Python program that requires command-line
> args? I usuall
Hi, I have some questions about the IDLE debugger. I am using the
2.6.6 bundle downloaded from python.org.
First, how do I debug a Python program that requires command-line
args? I usually run it with a command like
% test.py arg1 arg2 arg3
There seems to be practically no detailed IDLE debugger
paypal wholesale world cup 2010 football jersey England
www.supertrade06.com
paypal wholesale world cup 2010 football jersey France
www.supertrade06.com
paypal wholesale world cup 2010 football jersey New Zealand
paypal wholesale world cup 2010 football jersey Portugal
www.supertrade06.com
payp
In message
, Baba
wrote:
> csqrt = math.sqrt(csqrd)
> for c in range (1, csqrd):
> if c * c == a * a + b * b and math.floor(csqrt) == csqrt:
> print (a,b,c)
Is there such a term as “bogosearch”?
--
http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger wrote:
On Oct 21, 5:18 pm, Paul Rubin wrote:
The API you suggested looks reasonable although you should also say how
to delete a context, how to find the inner contexts of a context, etc.
The c.parent.parent.parent chain finds successive enclosing contexts:
while c.paren
On Oct 21, 6:13 pm, Paul Rubin wrote:
> Raymond Hettinger writes:
> > The c.parent.parent.parent chain finds successive enclosing contexts:
>
> I was asking about finding the child contexts, not the parents. This is
> analogous to how you can find the keys in a dict with dict.keys().
Children p
On Oct 22, 8:48 am, Robert Kern wrote:
> On 10/21/10 6:19 PM, Raymond Hettinger wrote:
>
> > I would appreciate any feedback on the API and on how well it fits
> > with various use cases that you've found in the wild.
>
> We've done something similar in the past:
>
> https://svn.enthought.com/svn/
I have several different versions of a web app that run under Apache. The issue
is that I need to have several different configurations available under several
environments (such as Django, mod_python and plain vanilla mod_wsgi). Is there
a simple way to get several of these to be completely ind
On Fri, 22 Oct 2010 17:02:07 -0400
Andrew wrote:
>
> Python's nntplib seems ideal for my purposes, but as far as I can see it
> doesn't support nntps connections. If I understand nntp correctly (I may
> not) that means, among other things, it sends passwords in cleartext.
>
> That won't do. I n
> I much prefer the wx version of the GUI over the tk version of my app.
Check out Python 2.7's Tkinter support for Tile. The enhanced version of
Tkinter that ships with 2.7 supports native OS themes across all
platforms giving you very professional looking user interfaces.
wx has lots more funct
I'm working on a personal project that, among other things, needs to talk
to a news server.
Python's nntplib seems ideal for my purposes, but as far as I can see it
doesn't support nntps connections. If I understand nntp correctly (I may
not) that means, among other things, it sends passwords in
On Oct 22, 4:17 am, Peter Otten <__pete...@web.de> wrote:
> I just read the recipe, and it looks good to me except for the len() and
> iter() implementations:
>
> >>> a = Context()
> >>> a["x"] = 1
> >>> b = a.new_child()
> >>> b["x"] = 2
> >>> len(b)
> 2
> >>> b.keys()
>
> ['x', 'x']
>
> I would h
Hi! I was looking for a good decorator library to study and make my
own decorators. I've read the Bruce Eckel's blog at artima dot com.
But I need some more examples. I'm building a WSN simulator like SHOX
is in java, but programming it in python. I'd like to use decorators
to set methods that woul
Try
import tkinter.messagebox as tkMessageBox
--
http://mail.python.org/mailman/listinfo/python-list
As I indicated, generating such triples is easy. What you found is the edge
case that
2*i*j = 200 => 100 = i*j
so (i,j) = (100,1) or (50,2) (25,4), (20,5) or (10,10). The maximal value are i
= 100, j = 1. The other sides are
i^2 - j^2 = 10,000 - 1 =
i^2 + j^2 = 10,000 + 1 = 10,001
...a
Mel wrote:
> MRAB wrote:
>> On 22/10/2010 13:33, Baba wrote:
>
>>> only a has an upper limit of 200
>>>
>> Really? The quote you gave included "whose small sides are no larger
>> than n". Note: "sides", plural.
>
> Strangely, there does seem to be a limit. Fixing one side at 200, the
> largest
MRAB wrote:
> On 22/10/2010 13:33, Baba wrote:
>> only a has an upper limit of 200
>>
> Really? The quote you gave included "whose small sides are no larger
> than n". Note: "sides", plural.
Strangely, there does seem to be a limit. Fixing one side at 200, the
largest pythagorean triple I have
On 21 Oct, 16:45, Nobody wrote:
> On Thu, 21 Oct 2010 02:34:15 -0700, Jon Clements wrote:
> > I'm after something that says: "I want 512mb of physical RAM, I don't
> > want you to page/swap it, if you can't do that, don't bother at all".
> > Now I'm guessing, that an OS might be able to grant that
John Nagle wrote:
On 10/22/2010 6:10 AM, Ethan Furman wrote:
John Nagle wrote:
class nonnulldict(dict) :
def __setitem__(self, k, v) :
if not (v is None) :
dict.__setitem__(self, k, v)
That creates a subclass of "dict" which ignores stores of None values.
So you never store the unwanted ite
On 10/21/2010 4:05 PM, Todd Walter wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thu, 21 Oct 2010 17:03:58 +0100
MRAB wrote:
On 21/10/2010 15:57, Todd Walter wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thu, 21 Oct 2010 00:07:58 +0100
MRAB wrote:
[snip]
The docs f
On 10/22/2010 6:10 AM, Ethan Furman wrote:
John Nagle wrote:
class nonnulldict(dict) :
def __setitem__(self, k, v) :
if not (v is None) :
dict.__setitem__(self, k, v)
That creates a subclass of "dict" which ignores stores of None values.
So you never store the unwanted items at all.
It's g
On 2010-10-22, Jean-Michel Pichavant wrote:
>> I'm all for descriptive names, but there's a great deal of benefit to
>> knowing when a descriptive name will help, and when all you need is a
>> variable which will be quickly recognized.
>> Compare:
>> [theValueInTheList.func() forTheValueInTheList
On 22/10/2010 13:33, Baba wrote:
On Oct 22, 8:07 am, Dennis Lee Bieber wrote:
On Thu, 21 Oct 2010 03:51:07 -0700 (PDT), Baba
declaimed the following in gmane.comp.python.general:
Hi everyone
i need a hint regarding the following exercise question:
"Write a program that generates all Pyt
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Thank you all for your help, I now have a functioning interface. As it
turns out, trying to do things the "correct" way was wrong. The timing
was so tight that doing anything (such as traversing the while-loop
once) instead of a read immediately afte
On Fri, 22 Oct 2010 07:49:39 -0700 (PDT), Brendan wrote:
[snip]
> x.py
> class X(object):
> pass
>
> y.py
> import x
> class Y(x.X):
> pass
>
> z.py
> import x
> import y
> class ZX(x.X):
> pass
> class ZY(y.Y):
> pass
>
> w.py
> import x
> import y
> import z
> class WX(x.X):
>
On 10/22/2010 4:22 AM, Jan Kosinski wrote:
I have created a python module, which contains a bunch of utility
functions that use a number of global variables (directory and file
names, etc.).
I want to move that global variables to an external configuration
file and I want to load all global vari
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dear User,
ANNOUNCE:Major Feature Release
libmsgque: Application-Server-Toolkit for
C, C++, JAVA, C#, TCL, PERL, PYTHON, RUBY, VB.NET
PLMK: Programming-Language-Microkernel
NHI1:
On Fri, 22 Oct 2010 01:35:11 -0400, Terry Reedy wrote:
> On 10/21/2010 7:55 PM, Baba wrote:
>
>> the bit i'm having difficulties with in constructing my loops is:
>> "whose small sides are no larger than n"
>
> from math import sqrt
>
> def py_trips(n):
>for b in range(4,n+1):
> for a in
On Oct 21, 1:48 am, Tim Golden wrote:
> On 21/10/2010 09:34, Jon Clements wrote:
>
> > Only just noticed this thread, and had something similar. I took the
> > following approach:-
>
> > (I'm thinking this might be relevant as you mentioned checking whether
> > your client'sOutlookcould export .EM
I'm all for descriptive names, but there's a great deal of benefit to
knowing when a descriptive name will help, and when all you need is a
variable which will be quickly recognized.
Compare:
[theValueInTheList.func() forTheValueInTheList in theList]
[x.func() for x in list]
One of these is mu
On 2010-10-22, Jean-Michel Pichavant wrote:
> Seebs wrote:
>> On 2010-10-21, Jean-Michel Pichavant wrote:
>>> list1 = []
>>> for x in theList:
>>> if x[0] == 4:
>>> list1 += x;
>>> return list1
>>> flaggedCells = []
>>> for cell in theBoard:
>>> if cell[STATUS_VALUE] == FLAGGED:
gb345 wrote:
In Tim Golden
writes:
On 22/10/2010 15:25, gb345 wrote:
3. Both versions of the app work fine on Windows 7, as long as
I do the following:
a. run CMD
b. cd to where the GUI script and my original script live
c. execute either
C:\Python27\python myapp_tk.py
On 2010-10-22, Jean-Michel Pichavant wrote:
> Seebs wrote:
>> The one that brought this up, though, was "except FooError, e:", and in
>> that case, there is no need for any further description; the description
>> is provided by the "except", and "e" is a perfectly reasonable, idiomatic,
>> pronoun
In Tim Golden
writes:
>On 22/10/2010 15:25, gb345 wrote:
>> 3. Both versions of the app work fine on Windows 7, as long as
>> I do the following:
>>a. run CMD
>>b. cd to where the GUI script and my original script live
>>c. execute either
>>
>> C:\Python27\python myapp_tk.py
On 10/21/10 6:19 PM, Raymond Hettinger wrote:
I would appreciate any feedback on the API and on how well it fits
with various use cases that you've found in the wild.
We've done something similar in the past:
https://svn.enthought.com/svn/enthought/CodeTools/trunk/enthought/contexts/multi_co
Hi,
Any instructions on how to get started with the source code?
--deostroll
On Oct 8, 1:57 am, lkcl wrote:
> apologies for the 3 copies of the post: mail.python.org's SMTP service
> was offline yesterday.
>
> just a quick update: XMLHttpRequest support has been fixed today, and
> the correct ve
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 22 Oct 2010 10:53:45 -0400
Tom Pacheco wrote:
> On 10/21/2010 4:05 PM, Todd Walter wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > On Thu, 21 Oct 2010 17:03:58 +0100
> > MRAB wrote:
> >
> >> On 21/10/2010 15:57, Todd W
On 10/21/2010 4:05 PM, Todd Walter wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thu, 21 Oct 2010 17:03:58 +0100
MRAB wrote:
On 21/10/2010 15:57, Todd Walter wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Thu, 21 Oct 2010 00:07:58 +0100
MRAB wrote:
[snip]
The docs f
On Oct 22, 9:16 am, Dave Angel wrote:
> On 2:59 PM, Brendan wrote:> On Oct 21, 3:56 pm, Ethan
> Furman wrote:
> >>
> >> Because y.py has "from x import x" the x class from x.py is added to the
> >> y.py namespace.
>
> >> ~Ethan~- Hide quoted text -
>
> >> - Show quoted text -
> > So what is usu
On 22/10/2010 15:25, gb345 wrote:
3. Both versions of the app work fine on Windows 7, as long as
I do the following:
a. run CMD
b. cd to where the GUI script and my original script live
c. execute either
C:\Python27\python myapp_tk.py
or
C:\Python27\python myapp_wx.p
On Fri, 22 Oct 2010 16:09:15 +0200, Mateusz Koryciński wrote:
> Hi,
>
> I need to install Cogent via python installation script. Unfortunately
> after typing in command line: "python setup.py build" or "python
> setup.py install" (I've tried with sudo as well) I receive something
> like that:
>
In gb345 writes:
>I have a handy Python script, which takes a few command-line
>arguments, and accepts a few options. I developed it on Unix, with
>very much of a Unix-mindset. Some Windows-using colleagues have
>asked me to make the script "easy to use under Windows 7". I.e.:
>no command-lin
Hi,
I need to install Cogent via python installation script. Unfortunately
after typing in command line: "python setup.py build" or "python
setup.py install" (I've tried with sudo as well) I receive something
like that:
running install
running build
running build_py
running build_ext
buildin
On Fri, 22 Oct 2010 09:27:51 -0400
Todd Walter wrote:
> Is there a way to specify the source port for a
> transmission without first binding to it?
Of course not, why do you want to do so?
(well, not using plain UDP or TCP, that is. You can of course do that
through ad-hoc means in the applicatio
On Oct 21, 2:57 pm, Eric_NYRelEng wrote:
> Does anyone have any example with perforce integrate command? Please
> help
>
> —Code Snippet—
> import P4
> ##set p4.port, p4.client
>
> p4c = P4.P4()
> p4c.connect()
> view = “//depot/meta/project/frombranch/...//depot/meta/project/
> tobranch/..."
> p4
Seebs wrote:
On 2010-10-21, Jean-Michel Pichavant wrote:
It can be short if descriptive:
for o, c in cars:
park(o)
phone(c)
for owner, car in cars: # by just using meaningful names you give the
info to the reader that you expect cars to be a list of tuple (owner
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 22 Oct 2010 00:00:03 +0100
MRAB wrote:
> On 21/10/2010 21:05, Todd Walter wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > On Thu, 21 Oct 2010 17:03:58 +0100
> > MRAB wrote:
> >
> >> On 21/10/2010 15:57, Todd Walter wrote
On Oct 22, 6:35 am, Terry Reedy wrote:
> On 10/21/2010 7:55 PM, Baba wrote:
>
> > the bit i'm having difficulties with in constructing my loops is:
> > "whose small sides are no larger than n"
>
> from math import sqrt
>
> def py_trips(n):
> for b in range(4,n+1):
> for a in range(3,b+1):
Seebs wrote:
On 2010-10-21, Jean-Michel Pichavant wrote:
Let me quote the paper I linked in the previous post:
list1 = []
for x in theList:
if x[0] == 4:
list1 += x;
return list1
compare it to:
flaggedCells = []
for cell in theBoard:
if cell[STATUS_VALUE] == FLAGGED:
John Nagle wrote:
On 10/20/2010 9:32 PM, Phlip wrote:
Not Hyp:
def _scrunch(**dict):
result = {}
for key, value in dict.items():
if value is not None: result[key] = value
return result
That says "throw away every item in a dict if the Value is None".
Are there any
Neil Cerutti wrote:
On 2010-10-21, James Mills wrote:
Rather than creating a new dict why don't you just do:
def _scrunch(d):
for k, v in d.items():
if v is None:
del d[k]
In Python 3, where items returns an iterator, modifying the
dictionary in this way may lead to cirrhoss
On Oct 22, 6:35 am, Terry Reedy wrote:
> On 10/21/2010 7:55 PM, Baba wrote:
>
> > the bit i'm having difficulties with in constructing my loops is:
> > "whose small sides are no larger than n"
>
> from math import sqrt
>
> def py_trips(n):
> for b in range(4,n+1):
> for a in range(3,b+1):
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 22 Oct 2010 00:00:03 +0100
MRAB wrote:
> On 21/10/2010 21:05, Todd Walter wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > On Thu, 21 Oct 2010 17:03:58 +0100
> > MRAB wrote:
> >
> >> On 21/10/2010 15:57, Todd Walter wrote
On Oct 22, 8:07 am, Dennis Lee Bieber wrote:
> On Thu, 21 Oct 2010 03:51:07 -0700 (PDT), Baba
> declaimed the following in gmane.comp.python.general:
>
> > Hi everyone
>
> > i need a hint regarding the following exercise question:
>
> > "Write a program that generates all Pythagorean triples whos
On 2:59 PM, Brendan wrote:
On Oct 21, 3:56 pm, Ethan Furman wrote:
Because y.py has "from x import x" the x class from x.py is added to the
y.py namespace.
~Ethan~- Hide quoted text -
- Show quoted text -
So what is usually done to prevent this? (In my case not wanting class
x added to th
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Fri, 22 Oct 2010 00:00:03 +0100
MRAB wrote:
> On 21/10/2010 21:05, Todd Walter wrote:
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> >
> > On Thu, 21 Oct 2010 17:03:58 +0100
> > MRAB wrote:
> >
> >> On 21/10/2010 15:57, Todd Walter wrote
On Oct 22, 5:02 am, Steven D'Aprano wrote:
> On Thu, 21 Oct 2010 12:12:34 -0700, Brendan wrote:
> >> Because y.py has "from x import x" the x class from x.py is added to
> >> the y.py namespace.
>
> >> ~Ethan~- Hide quoted text -
>
> >> - Show quoted text -
>
> > So what is usually done to prevent
On 2:59 PM, Sean Choi wrote:
I found two similar questions in the mailing list, but I didn't understand
the explanations.
I ran this code on Ubuntu 10.04 with Python 2.6.5.
Why do the functions g and behave differently? If calls (3) and
g(3) both exit their functions in the same state,
I have created a python module, which contains a bunch of utility functions
that use a number of global variables (directory and file names, etc.).
I want to move that global variables to an external configuration file and I
want to load all global variables from that configuration file when mod
Raymond Hettinger wrote:
> I'm considering a nested mapping class for the collections module and
> would like to solicit feedback from people here on comp.lang.python:
>
>http://code.activestate.com/recipes/577434-nested-contexts-a-chain-of-
mapping-objects/
>
> The class is an attempt to ge
On Thu, 21 Oct 2010 10:47:28 -0400, Mel wrote:
> Long variable names can lie; they share this ability with comments. The
> one study** I've seen of newbie errors observed the #1 error being as
> assumption that descriptive variable names could somehow replace
> computation, e.g. that if you calle
On Thu, 21 Oct 2010 17:20:54 +0200, Jean-Michel Pichavant wrote:
> While I totally understand why some ppl prefer to use short names,
Oh the irony.
> I
> really don't see the point in saying that because any information can be
> wrong, we should stop giving any.
It's only in your fevered imagi
On Thu, 21 Oct 2010 12:12:34 -0700, Brendan wrote:
>> Because y.py has "from x import x" the x class from x.py is added to
>> the y.py namespace.
>>
>> ~Ethan~- Hide quoted text -
>>
>> - Show quoted text -
>
> So what is usually done to prevent this? (In my case not wanting class x
> added to th
In message , kj wrote:
> What's wrong with it is that what python thinks is a "reasonable
> state" is actually wrong in this case (it differs from the default
> setting established by the Emacs shell).
I personally wouldn’t try to run one program that wants to do its
own interactive terminal con
On Thu, 21 Oct 2010 19:53:53 -0700, John Nagle wrote:
>> This is a common newbie stumbling-block: Don't use lists (or anything
>> mutable) as default argument values
>
> That really should be an error.
No it shouldn't. Punishing everybody for a newbie mistake that nobody
makes twice would
On Thu, 21 Oct 2010 20:04:10 +0100, Arnaud Delobelle wrote:
> Steven D'Aprano writes:
>
>> On Thu, 21 Oct 2010 11:37:36 +0200, Jean-Michel Pichavant wrote:
>
>> By the way:
>>
>>> xCoordinate, yCoordinate, zCoordinate = polygon.nextPointCoordinates()
>>
>> Coordinates are pairs or triples of *o
70 matches
Mail list logo