On 22/04/2010 7:23 AM, Alexandre Fayolle wrote:
Hi everyone,
I have a production server running a Windows Service written in Python, which
uses python 2.5.4 (yes I know it is old, but I am somewhat stuck with this for
now) and pywin32 214.
Given a set of manipulations, I get a stack overflow in
On 23Apr2010 15:37, I wrote:
| class Backend(object):
| def serialise(self, value):
| ''' Convert a value for external string storage.
| '''
| if isinstance(value, Node): [...]
| return ":%s:%s" % (value.type, value.name)
| t = type(value)
| assert t in (
On Fri, Apr 23, 2010 at 12:29 AM, Lawrence D'Oliveiro
wrote:
> In message , Chris
> Rebert wrote:
>
> > On Wed, Apr 21, 2010 at 5:53 PM, Lawrence D'Oliveiro wrote:
> >
> >> In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote:
> >>
> >>> Since in python nothing is guaranteed about implicit f
On Fri, 23 Apr 2010 16:29:46 +1200, Lawrence D'Oliveiro wrote:
> Any implementation that doesn’t do reference-counting is brain-damaged.
Funny, that's exactly what other people say about implementations that
*do* use reference counting.
--
Steven
--
http://mail.python.org/mailman/listinfo/py
In message , Chris
Rebert wrote:
> On Wed, Apr 21, 2010 at 5:53 PM, Lawrence D'Oliveiro wrote:
>
>> In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote:
>>
>>> Since in python nothing is guaranteed about implicit file close ...
>>
>> It is guaranteed that objects with a reference count of z
2010/4/22 :
> In production system I'll have 100+ subclasses and you code is not appliable
> ;)
> But -- thanks for __bases__ , it's thing I needed and py helpfile does not
> give me __bases__ easy
Feel free to rewrite my edges(...) function so it does not use tail
recursion and therefore does
On Thu, 22 Apr 2010 16:50:30 -0700, Jimbo wrote:
> Hello
>
> I have a relatively simple question. I want to use a try except in a
> function & when an error occurs I want to print the error type name(eg
> IOError, OSError etc) do you know how I can do this without specifying
> all possible errors
En Mon, 19 Apr 2010 12:58:16 -0300, Barrett
escribió:
I have been fighting the same bug for weeks now with zero success: I
am trying to get images to come up on my buttons, but they are way too
small. Regardless of whether I used my old Python 2.5.1 or now 2.6.5,
the following code:
[... too
amit wrote:
How does one go about calling multiple programs using subprocess?
This is the program flow:
C:\> wrenv.exe
C:\> make clean
..
..
The 'wrenv.exe' is necessary since it sets up the proper environment
for building. How do I use subprocess to execute 'wrenv.exe' and then
the 'make clea
On Thu, Apr 22, 2010 at 8:03 PM, MRAB wrote:
> It might be a stupid question, but have you tried passing in the
> Decimal() object itself?
MRAB's suggestion works for me in python 3.1.2:
import csv, io
from decimal import Decimal
d = Decimal("10.00")
o = io.StringIO()
w = csv.writer(o, quoting=
In article <4bbecc4e$0$8850$c3e8...@news.astraweb.com>,
Steven D'Aprano wrote:
>On Thu, 08 Apr 2010 23:22:46 -0700, hiral wrote:
>>
>> Is there any module/utility like 'rsync' in python.
>
>http://code.activestate.com/recipes/577022-rsync-algorithm-in-python/
>
>but you probably aren't going to
En Sun, 18 Apr 2010 22:21:40 -0300, HigStar escribió:
On Apr 13, 4:03 am, "Gabriel Genellina"
wrote:
En Sun, 11 Apr 2010 19:43:03 -0300,HigStar escribió:
> I have had trouble with the __file__ attribute in the past, when using
> py2exe (i.e. on the windows platform) and using the bundle featu
On Thu, Apr 22, 2010 at 4:50 PM, Jimbo wrote:
> I have a relatively simple question. I want to use a try except in a
> function & when an error occurs I want to print the error type name(eg
> IOError, OSError etc) do you know how I can do this without specifying
> all possible errors, eg having to
Phlip wrote:
Pythonistas:
This is not a question so much as registering a complaint.
When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in
a Decimal() object, I must convert it to a string. _Not_ a float,
because that might cause the rounding errors that Decimal() seeks to
avoid
On 4/22/10 6:23 PM, Phlip wrote:
Pythonistas:
This is not a question so much as registering a complaint.
When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in
a Decimal() object, I must convert it to a string. _Not_ a float,
because that might cause the rounding errors that Deci
Hello
I have a relatively simple question. I want to use a try except in a
function & when an error occurs I want to print the error type name(eg
IOError, OSError etc) do you know how I can do this without specifying
all possible errors, eg having to do this "except (IOError, OSError,
IndexError,
On Thu, 22 Apr 2010 10:49:29 -0700, John Nagle wrote:
>Is "nlargest" smart enough to decide when it's cheaper to track the
> N largest entries on a linear pass through the list than to sort?
Doesn't appear to do so. From Python 3.1:
def nlargest(n, iterable):
"""Find the n largest elemen
Pythonistas:
This is not a question so much as registering a complaint.
When I use the CSV library, with QUOTE_NONNUMERIC, and when I pass in
a Decimal() object, I must convert it to a string. _Not_ a float,
because that might cause the rounding errors that Decimal() seeks to
avoid. (We use Decim
On Thu, 22 Apr 2010 15:23:29 +0100, D'Arcy J.M. Cain
wrote:
On Fri, 23 Apr 2010 00:07:18 +1000
Xavier Ho wrote:
> print (sorted (l, reverse=True)[:k])
You don't really need to reverse sort there:
True but...
>>> numbers = [1, 4, 5, 3, 7, 8]
>>> sorted(numbers)[3:]
[5, 7, 8]
Now try r
Hi Amit,
As far as I know you can't really do this with subprocess,
because wrenv.exe and make would be called in different contexts.
THus wrenve.exe couldn't change the environment.
just try following:
- create a .bat file with both commands in it
- verify, that the bat file works
- call the
On Thu, Apr 22, 2010 at 7:49 AM, Zvezdan Petkovic wrote:
>
> On Apr 21, 2010, at 6:29 PM, Brendan Miller wrote:
>
>> Here's the method I was using. Note that tmp_char_ptr is of type
>> c_void_p. This should avoid the memory leak, assuming I am
>> interpreting the semantics of the cast correctly. I
How does one go about calling multiple programs using subprocess?
This is the program flow:
C:\> wrenv.exe
C:\> make clean
..
..
The 'wrenv.exe' is necessary since it sets up the proper environment
for building. How do I use subprocess to execute 'wrenv.exe' and then
the 'make clean' command.
"jobs in BRAZIL" "jobs in BRAZIL for pakistanis" "jobs in BRAZIL
banks" "jobs in BRAZIL" "jobs in BRAZIL" "jobs in BRAZIL" "BRAZIL jobs
"on http://jobsinbrazile-net.blogspot.com/ "jobs in
BRAZIL" "jobs in BRAZIL for pakistanis" "jobs in BRAZIL banks" "jobs
in BRAZIL" "jobs in BRAZIL"
On Thu, Apr 22, 2010 at 15:18, Dave Angel wrote:
> The same difference as between handing the paper boy three bucks, versus
> flying to London to open an account, making a deposit, going to a branch in
> Sydney and asking for a bank check, then flying back home and taking the
> paper boy with you
J wrote:
I was reading something from a code review a little while ago and saw
something that's got my curiosity up...
Say I had a file, foo.txt that I wanted to read from, only one time
and only read.
So what's the difference between this:
mylist = Popen(["cat","foo.txt"], stdout=PIPE).comm
J wrote:
I was reading something from a code review a little while ago and saw
something that's got my curiosity up...
Say I had a file, foo.txt that I wanted to read from, only one time
and only read.
So what's the difference between this:
mylist = Popen(["cat","foo.txt"], stdout=PIPE).commun
On Thu, Apr 22, 2010 at 11:28 AM, J wrote:
> I was reading something from a code review a little while ago and saw
> something that's got my curiosity up...
>
> Say I had a file, foo.txt that I wanted to read from, only one time
> and only read.
>
> So what's the difference between this:
>
> mylis
On Apr 21, 10:48 am, Dave Angel wrote:
> (For some reason you posted your response before the message you were
> replying to. That's called Top-posting, and is bad form on these
> mailing lists)
>
>
>
> Sandy wrote:
> > Thanks for the replies.
>
> > Terry,
> > What does 'immediately' mean? I did
On 4/21/10 7:59 PM, Lawrence D'Oliveiro wrote:
In message, "Martin
v. Löwis" wrote:
Brian Blais wrote:
On Apr 12, 2010, at 16:36 , Martin v. Loewis is wrote:
If you are planning to build Python extension modules in the next five
years, I recommend that you obtain a copy of VS Express
Am I
I was reading something from a code review a little while ago and saw
something that's got my curiosity up...
Say I had a file, foo.txt that I wanted to read from, only one time
and only read.
So what's the difference between this:
mylist = Popen(["cat","foo.txt"], stdout=PIPE).communicate()[0].
I have noticed Python appearing in various news stories lately and
treated as a mainstream language, as one not needing explanation, just
like Java, etc.
http://arstechnica.com/open-source/guides/2010/04/tutorial-use-twitters-new-real-time-stream-api-in-python.ars
is a nice tutorial on how to
Chris Rebert wrote:
2010/4/22 Jo Chan :
Hi,friends.
I wanna ask if there is a function which is able to take a list as argument
and then return its top-k maximums?
I only know about max which is poorly a top-1 maximum function, now I want
more yet I am lazy enough that don't want to write one b
On Thu, 22 Apr 2010 15:04:01 +0100
Tim Golden wrote:
> > So please tell me if there is one or not. I really need this soon.
> > Appreciate a lot.
>
> Assuming top-k doesn't mean something obscurely statistical:
You really shouldn't do people's homework for them. It doesn't do
them any favours.
Hi Tim,
On Apr 22, 4:04 pm, Tim Golden wrote:
> On 22/04/2010 15:13, Infinity77 wrote:
> > [I] choose this file myself, the FileDialog (a window representing a file
> > selector dialog) will return something like this (let's ignore the
> > back/forward slashes, this is not an issue):
>
> > Y:/Fold
On Apr 22, 2010, at 10:49 AM, Zvezdan Petkovic wrote:
> libc.strdup.argtype = [ctypes.c_char_p]
Correcting my typo. This should be in plural:
libc.strdup.argtypes = [ctypes.c_char_p]
--
http://mail.python.org/mailman/listinfo/python-list
eb303 wrote:
On Apr 21, 12:45 pm, Rotwang wrote:
[...]
Just run your program directly, either from a terminal or a DOS
console or by double-clicking on it in a file manager if the proper
file associations have been defined (they are by default on Windows).
Thanks for the suggestion, but I
James Mills wrote:
On Wed, Apr 21, 2010 at 8:45 PM, Rotwang wrote:
[...]
From reading the documentation myself (pydoc)...
It would seem your only option is to make a thread
out of this (not my preferred way - I was hoping it was
possible to poll the Tk event system...).
Thanks, I don't
On 22/04/2010 15:13, Infinity77 wrote:
[I] choose this file myself, the FileDialog (a window representing a file
selector dialog) will return something like this (let's ignore the
back/forward slashes, this is not an issue):
Y:/Folder/FileName.txt
If my colleague does it, he will get:
Z:/Folde
On Apr 21, 2010, at 6:29 PM, Brendan Miller wrote:
> Here's the method I was using. Note that tmp_char_ptr is of type
> c_void_p. This should avoid the memory leak, assuming I am
> interpreting the semantics of the cast correctly. Is there a cleaner
> way to do this with ctypes?
>
>def get_p
On Fri, Apr 23, 2010 at 12:23 AM, D'Arcy J.M. Cain wrote:
> Now try returning the top two or four numbers.
>
>>> numbers = [1, 4, 5, 3, 7, 8]
>>> sorted(numbers)[-2:]
[7, 8]
>>> sorted(numbers)[-4:]
[4, 5, 7, 8]
I see what you mean. This is not as intuitive, is it?
Cheers,
Xav
--
http://mail
Hi friends,
Sania Mirza hot news & Download All software and
Videos
World number one weightest person News updated...
That Link is given Below :
Earn Rs.2000 daily. no investment.
wanted online internet job workers. job is only
through internet.work part time. you can earn
Rs.750-2000/- daily
On Fri, 23 Apr 2010 00:07:18 +1000
Xavier Ho wrote:
> > print (sorted (l, reverse=True)[:k])
>
> You don't really need to reverse sort there:
True but...
> >>> numbers = [1, 4, 5, 3, 7, 8]
> >>> sorted(numbers)[3:]
> [5, 7, 8]
Now try returning the top two or four numbers.
--
D'Arcy J.M. Cai
Hi All,
I apologize in advance if this sounds like a stupid question but I am
really no expert at all in network things, and I may be looking in the
wrong direction altogether.
At work we have a bunch of Linux servers, and we can connect to them
with our Windows PCs over a network. Now, let's ass
Yeah... but actually I need something more efficient, like heap.
Thank you for your help though.
Best regards,
Songjian
On Thu, Apr 22, 2010 at 10:04 PM, Tim Golden wrote:
> On 22/04/2010 14:57, Jo Chan wrote:
> > Hi,friends.
> >
> > I wanna ask if there is a function which is able to take a
Cool! Thanks a lot! That's exactly what I want.
Best regards,
Songjian
On Thu, Apr 22, 2010 at 10:04 PM, Chris Rebert wrote:
> 2010/4/22 Jo Chan :
> > Hi,friends.
> > I wanna ask if there is a function which is able to take a list as
> argument
> > and then return its top-k maximums?
> > I on
On Fri, Apr 23, 2010 at 12:04 AM, Tim Golden wrote:
> Assuming top-k doesn't mean something obscurely statistical:
>
> l = [1,2, 3, 4, 5]
> k = 3
> print (sorted (l, reverse=True)[:k])
>
You don't really need to reverse sort there:
>>> numbers = [1, 4, 5, 3, 7, 8]
>>> sorted(numbers)[3:]
[5, 7,
2010/4/22 Jo Chan :
> Hi,friends.
> I wanna ask if there is a function which is able to take a list as argument
> and then return its top-k maximums?
> I only know about max which is poorly a top-1 maximum function, now I want
> more yet I am lazy enough that don't want to write one by myself.
ht
On 22/04/2010 14:57, Jo Chan wrote:
> Hi,friends.
>
> I wanna ask if there is a function which is able to take a list as argument
> and then return its top-k maximums?
> I only know about max which is poorly a top-1 maximum function, now I want
> more yet I am lazy enough that don't want to writ
Hi,friends.
I wanna ask if there is a function which is able to take a list as argument
and then return its top-k maximums?
I only know about max which is poorly a top-1 maximum function, now I want
more yet I am lazy enough that don't want to write one by myself.
So please tell me if there is o
luca72 a écrit :
i get a string from a web server and i save it in to a file, that i
open the file and i read the string:
the string looks like :
http://lhti.gs/JKBTYD
after the read i use webbrowser open (sting), but i get the error
because at the end of the string are added '%0D%0A',
Python 2
Problem solved!
For those who wish to know, the actual problem was the following.
In my project, I had a package called "parser". I works fine on Linux
and Mac, but seems to conflict with other package on Windows.
So the module I wanted to load was not found. I had to rename the
package name...
D'o
I'm trying to move a wxPython application forward to 2.6, but although the app
runs fine in 2.6 when run directly when I build the app into an exe using py2exe
I get this popup message
"application failed to initialize properly (0xc142)"
when I try to run the built exe.
The same applicati
Emile van Sebille wrote:
> You're missing the point -- set-up and tear-down overhead is involved
> for both python and php cgi based web serving, and Bruno I'm sure would
> concur that python in this suffers similarly.
Well I wrote, "Each has its distinguishing features -- how efficiently
a web ap
* luca72:
i get a string from a web server and i save it in to a file, that i
open the file and i read the string:
the string looks like :
http://lhti.gs/JKBTYD
after the read i use webbrowser open (sting), but i get the error
because at the end of the string are added '%0D%0A', and if i ask for
i get a string from a web server and i save it in to a file, that i
open the file and i read the string:
the string looks like :
http://lhti.gs/JKBTYD
after the read i use webbrowser open (sting), but i get the error
because at the end of the string are added '%0D%0A', and if i ask for
the len of t
Dear Dave,
You are absolutely right!
I changed my code so many times that I got confused when writing the
post.
Actually, I tried "from mod import module1" and "import mod.module1".
Of course, they led to the same error: the one that Peter pointed.
Anyway, thanks a lot for your help!
Matthias.
(Yet
M.-H. Z wrote:
Hello dear Python hackers.
I have a pretty stupid problem that I cannot solve despite all my
efforts: Python cannot find my modules. I am sure the answer is
obvious, but I cannot find it.
The problem is simple, here is a toy example (which does not work).
I have a file:
---
import
Darn! That was it!
I was pretty stupid!
I swear I will stop drinking vodka before 8am.
However, it does not solve the problem on my main project (which was
not this toy example of course), since the names were correct there.
Keep on working.
Thanks a lot, Peter, for reading my long post and helping
On Apr 22, 12:10 am, candide wrote:
> Suppose a and b are lists.
>
> What is more efficient in order to extend the list a by appending all
> the items in the list b ?
>
> I imagine a.extend(b)to be more efficient for only appendinding the
> items from b while a+=b creates a copy of a before append
On Thu, 2010-04-22 at 12:53 +1200, Lawrence D'Oliveiro wrote:
> In message <4bc9aad...@dnews.tpgi.com.au>, Lie Ryan wrote:
> > Since in python nothing is guaranteed about implicit file close ...
> It is guaranteed that objects with a reference count of zero will be
> disposed. In my experiments, t
M.-H. Z wrote:
> the directory "mod". This directory contains "__init.py__" (empty) and
Rename "__init.py__" to "__init__.py".
--
http://mail.python.org/mailman/listinfo/python-list
Hello dear Python hackers.
I have a pretty stupid problem that I cannot solve despite all my
efforts: Python cannot find my modules. I am sure the answer is
obvious, but I cannot find it.
The problem is simple, here is a toy example (which does not work).
I have a file:
---
import sys
print sys.pat
On Thu, 22 Apr 2010 09:31:12 +0200, candide wrote:
> Alf P. Steinbach a écrit :
>> * candide:
>>> Suppose a and b are lists.
>>>
>>> What is more efficient in order to extend the list a by appending all
>>> the items in the list b ?
>>>
>>>
>>> I imagine a.extend(b)to be more efficient for only ap
Does anybody know a cross platform way to retrieve the default DNS
server IP address in python ?
Thanks !
João
--
http://mail.python.org/mailman/listinfo/python-list
On 20/04/2010 20:53, Lie Ryan wrote:
On 04/19/10 03:06, Martin P. Hellwig wrote:
On 04/18/10 12:49, Tim Diels wrote:
Hi
I was thinking of writing a GUI toolkit from scratch using a basic '2D
library'. I have already come across the Widget Construction Kit.
My main question is: Could I build a
Alf P. Steinbach a écrit :
* candide:
Suppose a and b are lists.
What is more efficient in order to extend the list a by appending all
the items in the list b ?
I imagine a.extend(b)to be more efficient for only appendinding the
items from b while a+=b creates a copy of a before appending,
candide wrote:
> Suppose a and b are lists.
>
> What is more efficient in order to extend the list a by appending all
> the items in the list b ?
>
>
> I imagine a.extend(b)to be more efficient for only appendinding the
> items from b while a+=b creates a copy of a before appending, right ?
No
candide, 22.04.2010 09:10:
Suppose a and b are lists.
What is more efficient in order to extend the list a by appending all
the items in the list b ?
I imagine a.extend(b)to be more efficient for only appendinding the
items from b while a+=b creates a copy of a before appending, right ?
Wrong
I'm Matthew Win Tibbals, pedophile. http://www.matthewtibbals.com
--
http://mail.python.org/mailman/listinfo/python-list
* candide:
Suppose a and b are lists.
What is more efficient in order to extend the list a by appending all
the items in the list b ?
I imagine a.extend(b)to be more efficient for only appendinding the
items from b while a+=b creates a copy of a before appending, right ?
No.
But in gener
Suppose a and b are lists.
What is more efficient in order to extend the list a by appending all
the items in the list b ?
I imagine a.extend(b)to be more efficient for only appendinding the
items from b while a+=b creates a copy of a before appending, right ?
--
http://mail.python.org/mail
71 matches
Mail list logo