fredbasset1...@gmail.com wrote:
> I'm writing a C extension for Python, is it possible to define
> constants in the C code and have them visible from Python?
Have you looked at Cython? It allows you to define e.g. enums as "public"
and will generate the rest for you.
http://cython.org
Stefan
--
On Feb 28, 10:50 am, "Rhodri James"
wrote:
> On Sat, 28 Feb 2009 05:17:41 -, wrote:
> > I am trying to download a file from the server, I am getting this
> > error,what does this mean
>
> >localFile = open(localFileName, 'wb')
> > TypeError: coercing to Unicode: need string or buffer, typ
collin wrote:
For example, if I were to have the code
randomlist = ["1", "2", "3", "4"]
And I want to count the distance between strings "1" and "4" which is
3, what command can I use to do this?
--
http://mail.python.org/mailman/listinfo/python-list
randomlist.index("4") - randomlist.inde
On Feb 28, 4:17 pm, zaheer.ag...@gmail.com wrote:
> I am trying to download a file from the server, I am getting this
> error,what does this mean
>
> localFile = open(localFileName, 'wb')
> TypeError: coercing to Unicode: need string or buffer, type found
the name localFileName is bound to a ty
On Sat, 28 Feb 2009 05:17:41 -, wrote:
I am trying to download a file from the server, I am getting this
error,what does this mean
localFile = open(localFileName, 'wb')
TypeError: coercing to Unicode: need string or buffer, type found
The rest of the traceback and enough of your code
[Steve Holden]
> A sort of premature pessimization, then.
QOTW!
_ ~
@ @
\_/
Raymond
--
http://mail.python.org/mailman/listinfo/python-list
I am trying to download a file from the server, I am getting this
error,what does this mean
localFile = open(localFileName, 'wb')
TypeError: coercing to Unicode: need string or buffer, type found
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 27, 7:21 pm, Sammo wrote:
> Given that execfile has been removed in py3k, I want to understand
> exactly why.
>
> Okay, I get that execfile is bad from the following thread:
>
> On Jul 29 2007, 2:39 pm, Steven D'Aprano
>
>
>
> wrote:
> > (1) Don't use eval, exec or execfile.
>
> > (2) If y
Dennis Lee Bieber wrote:
> On Fri, 27 Feb 2009 15:39:13 -0800 (PST), mmcclaf
> declaimed the following in gmane.comp.python.general:
>
>> This came in the Python groups, and I put one up in the database
>> group, since I will later have to use Python to access the SQL file,
[...]
>> The relationa
Given that execfile has been removed in py3k, I want to understand
exactly why.
Okay, I get that execfile is bad from the following thread:
On Jul 29 2007, 2:39 pm, Steven D'Aprano
wrote:
> (1) Don't use eval, exec or execfile.
>
> (2) If you're an expert, don't use eval, exec or execfile.
>
> (
On Feb 28, 8:08 am, ntwrkd wrote:
> I am interested in writing an application that functions like a Unix
> or Linux top in the way it displays data.
> It should be command-line based but dynamically refreshing.
>
> I'm not sure what I should take into account or how I might go about
> implementing
Steve Holden wrote:
Gabriel Genellina wrote:
En Tue, 24 Feb 2009 22:52:20 -0200, Ethan Furman
escribió:
Steve Holden wrote:
Brian Allen Vanderburg II wrote:
One idea to make constants possible would be to extend properties to be
able to exist at the module level as well as the class le
On Feb 25, 11:57 pm, Lukas Hetzenecker wrote:
> Hello,
>
> I created a QTextEdit where I wanted to display log messages.
> A logging.Handler should do this job.
>
> It worked with one thread well, but when I start a QThread the text on all
> widgets is removed and I get many errors in my konsole:
On Fri, 27 Feb 2009 23:55:43 -, Ethan Furman
wrote:
I'm not Mark, but you did post to the whole group!
[snippety snip]
Specifically, how is a new name (pbr) different, in Python, from a new
name initialized as if by assignment (pbv)? It seems to me than you end
up with the same thin
On Feb 25, 11:57 pm, Lukas Hetzenecker wrote:
> Hello,
>
> I created a QTextEdit where I wanted to display log messages.
> A logging.Handler should do this job.
>
> It worked with one thread well, but when I start a QThread the text on all
> widgets is removed and I get many errors in my konsole:
Mark Wooding wrote:
Steven D'Aprano wrote:
>
On the one hand, some people (me and possibly rurpy) consider "this is
pass-by-foo" to be a statement about behaviour directly visible to the
programmer. We have a set of behavioral traits in mind, and if a language
exhibits those behaviours, then
This came in the Python groups, and I put one up in the database
group, since I will later have to use Python to access the SQL file,
so therefore tackling one thing at a time. Also, there were no answers
that were coming up in the .database group.
On top of that:
>Really? You can have shi
Thanks. These are all great suggestions.
On Fri, Feb 27, 2009 at 2:35 PM, Tim Chase
wrote:
>> I am interested in writing an application that functions like a Unix
>> or Linux top in the way it displays data.
>> It should be command-line based but dynamically refreshing.
>
> You might look at the
I am interested in writing an application that functions like a Unix
or Linux top in the way it displays data.
It should be command-line based but dynamically refreshing.
You might look at the sourcecode for "iotop"[1] which would make
a good example (it's a "top"-like program written in Python
On Feb 27, 4:08 pm, ntwrkd wrote:
> I am interested in writing an application that functions like a Unix
> or Linux top in the way it displays data.
> It should be command-line based but dynamically refreshing.
>
> I'm not sure what I should take into account or how I might go about
> implementing
ntwrkd writes:
> I'm not sure what I should take into account or how I might go about
> implementing this?
Maybe the curses module. http://docs.python.org/library/curses.html
--
http://mail.python.org/mailman/listinfo/python-list
Tim Rowe writes:
> We were told in the original question: more than 15 million records,
> and it won't all fit into memory. So your observation is pertinent.
That is not terribly many records by today's standards. The knee-jerk
approach is to sort them externally, then make a linear pass skippin
I am interested in writing an application that functions like a Unix
or Linux top in the way it displays data.
It should be command-line based but dynamically refreshing.
I'm not sure what I should take into account or how I might go about
implementing this?
Any suggestions are appreciated.
--
htt
fredbasset1...@gmail.com wrote:
> I'm writing a C extension for Python, is it possible to define
> constants in the C code and have them visible from Python?
There's an API function to create a module-level name with a given value,
e.g.
PyModule_AddIntConstant (module, "S_IRUSR", S_IRUSR); //
On 2009-02-27 14:54, fredbasset1...@gmail.com wrote:
I'm writing a C extension for Python, is it possible to define
constants in the C code and have them visible from Python?
In your init function, create Python objects from the constants
and insert them into the module using PyModule_AddObjec
I'm writing a C extension for Python, is it possible to define
constants in the C code and have them visible from Python?
--
http://mail.python.org/mailman/listinfo/python-list
Falcolas wrote:
> On Feb 27, 10:07 am, Steve Holden wrote:
>> Assuming no duplicates, how does this help? You still have to verify
>> collisions.
>
> Absolutely. But a decent hashing function (particularly since you know
> quite a bit about the data beforehand) will have very few collisions
> (th
On Feb 27, 6:42 am, "steven.oldner" wrote:
> Just learning Python and have a project to create a weekly menu and a
> shopping list from the menu.
> Question: How should I set up the data? I'm looking at maybe 70 menu
> items and maybe 1000 items for the shopping list. I need to be able
> to
On Feb 27, 10:07 am, Steve Holden wrote:
> Assuming no duplicates, how does this help? You still have to verify
> collisions.
Absolutely. But a decent hashing function (particularly since you know
quite a bit about the data beforehand) will have very few collisions
(theoretically no collisions, a
On Fri, Feb 27, 2009 at 12:20 PM, Scott David Daniels
wrote:
> (1) Please do not top post in comp.lang.python, it violates conventions.
>
> Brett Hedges (should have written):
>> bearophile wrote: ...
>>>
>>> You can also keep track of the absolute position of the lines in the
>>> file, etc, or st
On 27 Feb., 15:14, Vlastimil Brom wrote:
> 2009/2/27 alex :
>
> > Hi all
> > I have a gridsizer consisting of two vertically stacked panels, one
> > with a StaticBox and the other with a TextCtrl.
> > I would like that the TextCtrl expands at program start fully to the
> > allocated panel size (lo
On Feb 27, 8:19 am, Vlastimil Brom wrote:
> >> 2009/2/27 Greg Miller :
> >> > I am working on a program that controls a piece of equipment. The GUI/
> >> > control software is written with Python2.5/wxPython. I would like to
> >> > know if there is a way of starting the GUI without the DOS windo
2009/2/27 Steve Holden :
> Assuming no duplicates, how does this help? You still have to verify
> collisions.
>
>> Pretty brutish and slow, but it's the first algorithm which comes to
>> mind. Of course, I'm assuming that the list items are long enough to
>> warrant using a hash and not the values
Does anyone know of sample code showing how the marching cubes
algorithm may be implimented using Python?
Ref:- http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/
I can set up the cubes and test to see if their vertices are inside
the isosurface.
I can produce a resulting "metaball" but
How big of a list are we talking about? If the list is so big that the
entire list cannot fit in memory at the same time this approach wont
work e.g. removing duplicate lines from a very large file.
We were told in the original question: more than 15 million records,
and it won't all fit into me
2009/2/27 venutaurus...@gmail.com :
> Thanks for the reply,,
> I am trying to use the above application using psexec()in
> command line.But it failed returning the error message
>
> exited with error code 255.
>
> But when I ran the application normally it worked
> fine.Do
(1) Please do not top post in comp.lang.python, it violates conventions.
Brett Hedges (should have written):
> bearophile wrote: ...
You can also keep track of the absolute position of the lines in the file, etc, or step
>> back looking for newlines, etc, but it's not handy
How would I ke
Falcolas wrote:
> On Feb 27, 8:33 am, Tim Rowe wrote:
>> 2009/2/27 odeits :
>>
>>> How big of a list are we talking about? If the list is so big that the
>>> entire list cannot fit in memory at the same time this approach wont
>>> work e.g. removing duplicate lines from a very large file.
>> We we
Brett,
I'm not sure what exactly you're trying to do, but you can keep track
of line numbers using itertools.
import itertools
for lineIndex, line in itertools.izip(itertools.count(1), open('text.txt')):
print lineIndex, line
Here is sample code for breaking on a word and returning the prev
On Thu, Feb 26, 2009 at 3:47 PM, Gabriel Genellina
wrote:
>> I'm looking for a function in the standard library or pywin32 package
>> that will block until a certain condition is met or it is interrupted
>> by Ctrl-C. For example, time.sleep() would have been perfect for my
>> needs if thread.inte
On Feb 27, 8:33 am, Tim Rowe wrote:
> 2009/2/27 odeits :
>
> > How big of a list are we talking about? If the list is so big that the
> > entire list cannot fit in memory at the same time this approach wont
> > work e.g. removing duplicate lines from a very large file.
>
> We were told in the orig
Brett Hedges:
> How would I keep track of the absolute position of the lines?
You may have to do all things manually (tell, seek and looking for
newlines manually, iterating chars), that's why I have said it's not
handy. The other solutions are simpler.
Bye,
bearophile
--
http://mail.python.org/m
On Fri, Feb 27, 2009 at 5:59 AM, Ravi wrote:
> Is it possible in python to create a property with the same name as
> the member variable name of the class. e.g.
No, because accessing the property and the instance variable are
*syntactically identical* (it's the raison detre of properties) so
ther
> You can also keep track of the absolute position of the lines in the file,
> etc, or step back looking for newlines, etc, but it's not handy.
How would I keep track of the absolute position of the lines? I have tried to
use the files.seek() command with the files.tell() command and it does n
Muddy Coder wrote:
> cgi module can easily acquire the all fields of data input from client
> side, through a form. Then, a simple line of code:
>
> form_dict = cgi.FieldStorage()
>
> grabs all data into a dictionary form_dict. The rest becomes a piece
> of cake by querying the form_dict. Nice!
>
On Feb 27, 8:40 am, pyt...@bdurham.com wrote:
> Rainy,
>
> Great stuff! Thanks for your examples with the community!!
>
> Regards,
> Malcolm
Let me add my thanks! I using it now...
--
http://mail.python.org/mailman/listinfo/python-list
2009/2/27 odeits :
> How big of a list are we talking about? If the list is so big that the
> entire list cannot fit in memory at the same time this approach wont
> work e.g. removing duplicate lines from a very large file.
We were told in the original question: more than 15 million records,
and
Steve Holden:
> A sort of premature pessimization, then.
Maybe not, the save in memory may lead to higher speed anyway. So you
need to test it to know the overall balance. And in data structures
with general purpose you want all the speed you can get.
Bye,
bearophile
--
http://mail.python.org/mai
Thanks, I'm looking for something I can integrate into a simple game I'm
working on that will run in Linux.
-Original Message-
From: Shane Geiger [mailto:sgei...@councilforeconed.org]
Sent: Friday, February 27, 2009 9:09 AM
To: Support Desk
Cc: python-list@python.org
Subject: Re: Capture
>> 2009/2/27 Greg Miller :
>> > I am working on a program that controls a piece of equipment. The GUI/
>> > control software is written with Python2.5/wxPython. I would like to
>> > know if there is a way of starting the GUI without the DOS window
>> > having to launch? I would like only the app
Here's one option:
http://pykeylogger.sourceforge.net/wiki/index.php/PyKeylogger:FAQ
Support Desk wrote:
Does anybody know of a way to capture keystrokes form a wireless USB
keyboard using python?
--
http://
Does anybody know of a way to capture keystrokes form a wireless USB
keyboard using python?
--
http://mail.python.org/mailman/listinfo/python-list
Giampaolo Rodola' wrote:
It seems to work fine on posix but we still got problems on Windows
where it seems that waiting for pid to show up in the system process
list is not enough for considering the process effectively
initialized.
Anyway, I think it's a problem in our code.
Thanks for your hel
On 26 Feb, 21:59, Jean-Paul Calderone wrote:
> On Thu, 26 Feb 2009 12:27:26 -0800 (PST), Giampaolo Rodola'
> wrote:
> >Hi,
> >I'm working on a Python module called psutil [1] for reading process
> >information in a cross-platform way.
> >I'm having a problem with psutil test suite.
> >Almost all
Rainy,
Great stuff! Thanks for your examples with the community!!
Regards,
Malcolm
--
http://mail.python.org/mailman/listinfo/python-list
Greg Miller wrote:
> I would like to know if there is a way of starting the GUI
> without the DOS window having to launch?
Use pythonw.exe instead of python.exe.
Uli
--
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
--
http://mail.python.org/mailman/listinf
On Feb 27, 9:12 am, Greg Miller wrote:
> I am working on a program that controls a piece of equipment. The GUI/
> control software is written with Python2.5/wxPython. I would like to
> know if there is a way of starting the GUI without the DOS window
> having to launch? I would like only the ap
I am working on a program that controls a piece of equipment. The GUI/
control software is written with Python2.5/wxPython. I would like to
know if there is a way of starting the GUI without the DOS window
having to launch? I would like only the application itself to appear,
no DOS window. Than
2009/2/27 alex :
> Hi all
> I have a gridsizer consisting of two vertically stacked panels, one
> with a StaticBox and the other with a TextCtrl.
> I would like that the TextCtrl expands at program start fully to the
> allocated panel size (lower panel of gridSizer).
> Instead of like now, fully ex
Loretta SALINO wrote:
Tim Golden wrote:
Thomas Guettler wrote:
Hi,
this is a bit off topic.
In our company we have several SVN repositories.
According to [1] Trac by default only handles one
repository.
Of course Trac links like changeset [1234] would not work anymore.
You would need [repr
Is it possible in python to create a property with the same name as
the member variable name of the class. e.g.
Class X:
...
self.i = 10 # marker
...
property(fget = get_i, fset = set_i)
Please tell me how I can do so. Because if I do so, for the statement
at marker I get stack ov
Python-by-example http://pbe.lightbird.net/index.html";>http://
pbe.lightbird.net has some new modules added: pickle, shelve,
sqlite3, gzip, csv, configparser, optparse, logging. I also changed
over to using excellent sphinx package to generate documentation, this
will allow me to add pdf and windo
Tim Golden wrote:
> Thomas Guettler wrote:
>> Hi,
>>
>> this is a bit off topic.
>>
>> In our company we have several SVN repositories.
>>
>> According to [1] Trac by default only handles one
>> repository.
>>
>> Of course Trac links like changeset [1234] would not work anymore.
>> You would n
On Fri, Feb 27, 2009 at 5:10 AM, Steve Holden wrote:
> Chris Rebert wrote:
>> On Thu, Feb 26, 2009 at 10:26 PM, odeits wrote:
> [...]
>>> while 'a' in L:
>>> L.remove('a')
>>>
>>> not the most efficient but it works
>>
>> "Not the most efficient"; it's terribly inefficient! It's 2*O(M*N) [M
>>
steven.oldner wrote:
> Just learning Python and have a project to create a weekly menu and a
> shopping list from the menu. This is something I do manually now, so
> I'm automating it.
>
> What I'd like is a list of menu choices, such as:
> CODE- Description - Est Cost
>
> 'B01 - Pancakes, Saus
Anjanesh Lekshminarayanan wrote:
>> How do we know that from the what the OP posted?
> Its CGI alright.
> spaces = form.has_key('spaces') and form.getvalue('spaces') == '1'
>
> But I just dont see how
> spaces = (form.has_key('spaces') ? form.getvalue('spaces') == 1 ?
> True: False : False)
> is c
Chris Rebert wrote:
> On Thu, Feb 26, 2009 at 10:26 PM, odeits wrote:
[...]
>> while 'a' in L:
>> L.remove('a')
>>
>> not the most efficient but it works
>
> "Not the most efficient"; it's terribly inefficient! It's 2*O(M*N) [M
> = number of 'a's in L], versus just N. And that's not even accoun
lameck kassana wrote:
> At last i did it it was this wrong line file_count += len(files) ---it
> supposed to be file_count+=1
> but thanks for help ya python masters .Steven Holden thanks very
> very much for your tip about raw string
>
Lameck:
Please note that
file_count = 0
for files in
bearophileh...@lycos.com wrote:
> Paul Rubin:
>> I don't see how to delete a randomly chosen node if you use that trick,
>> since the hash lookup doesn't give you two consecutive nodes in the linked
>> list to xor together.<
>
> Thank you, I think you are right, I am sorry.
> So on 32-bit CPUs y
Dennis Lee Bieber wrote:
[...]
> {Oh, and since I saw, at work, a later post with a bunch of nested UNION
> statements: UNION requires all the tables to have the same number/type
> of columns -- you don't have that}
A rather fine point, but technically all that's required is the the
united *querie
En Fri, 27 Feb 2009 10:10:39 -0200, MRAB
escribió:
Gabriel Genellina wrote:
En Fri, 27 Feb 2009 09:29:16 -0200, Ulrich Eckhardt
escribió:
I have a socket from which I would like to parse some data, how would
I do
that? Of course, I can manually read data from the socket until
unpack(
On Feb 27, 1:18 am, Stefan Behnel wrote:
> bearophileh...@lycos.com wrote:
> > odeits:
> >> How big of a list are we talking about? If the list is so big that the
> >> entire list cannot fit in memory at the same time this approach wont
> >> work e.g. removing duplicate lines from a very large fil
Hi all
I have a gridsizer consisting of two vertically stacked panels, one
with a StaticBox and the other with a TextCtrl.
I would like that the TextCtrl expands at program start fully to the
allocated panel size (lower panel of gridSizer).
Instead of like now, fully expanding in the width but not
Just learning Python and have a project to create a weekly menu and a
shopping list from the menu. This is something I do manually now, so
I'm automating it.
What I'd like is a list of menu choices, such as:
CODE- Description - Est Cost
'B01 - Pancakes, Sausage,and Eggs - $5.80,
'L01 - Tuna Fis
lameck kassana wrote:
> now it is working but i wonder it brings higher number of count as if it
> counts files in wholes computer can you check in my code and correct me
>
> import glob
> import os
> file_count=0
> for files in glob.glob(r"\\192.16
Gabriel Genellina wrote:
En Fri, 27 Feb 2009 09:29:16 -0200, Ulrich Eckhardt
escribió:
I have a socket from which I would like to parse some data, how would
I do
that? Of course, I can manually read data from the socket until unpack()
stops complaining about a lack of data, but that sounds r
En Fri, 27 Feb 2009 09:29:16 -0200, Ulrich Eckhardt
escribió:
I have a socket from which I would like to parse some data, how would I
do
that? Of course, I can manually read data from the socket until unpack()
stops complaining about a lack of data, but that sounds rather inelegant.
Any be
On Feb 27, 2:17 am, "Gabriel Genellina"
wrote:
> En Fri, 27 Feb 2009 07:33:44 -0200, pranav escribió:
>
> > Greeting fellow pycoders,
>
> > I have a script that browses large codes and replaces certain text
> > with some other text. Of lately i observed an issue.Some of the
> > original text were
Hi!
I have a socket from which I would like to parse some data, how would I do
that? Of course, I can manually read data from the socket until unpack()
stops complaining about a lack of data, but that sounds rather inelegant.
Any better suggestions?
Uli
--
Sator Laser GmbH
Geschäftsführer: Tho
En Fri, 27 Feb 2009 00:06:47 -0200, Astan Chee
escribió:
I want to factor (red, green and blue at the same time) an image using
wx but without any GUI display or windows but it keeps crashing
What do you mean? Really crashing? Or do you get a Python stack trace?
and if I set the checks to i
Paul Rubin:
>I don't see how to delete a randomly chosen node if you use that trick, since
>the hash lookup doesn't give you two consecutive nodes in the linked list to
>xor together.<
Thank you, I think you are right, I am sorry.
So on 32-bit CPUs you need to add 8 bytes to each value.
On 64-b
En Fri, 27 Feb 2009 07:33:44 -0200, pranav escribió:
Greeting fellow pycoders,
I have a script that browses large codes and replaces certain text
with some other text. Of lately i observed an issue.Some of the
original text were like
,N'#attributes.SOFTPREREQ#'
My module does scan this
At last i did it it was this wrong line file_count += len(files) ---it
supposed to be file_count+=1
but thanks for help ya python masters .Steven Holden thanks very very
much for your tip about raw string
On Fri, Feb 27, 2009 at 12:43 PM, Gabriel Genellina
wrote:
> En Fri, 27 Feb 2009 07:02
pranav a écrit :
Greeting fellow pycoders,
I have a script that browses large codes and replaces certain text
with some other text. Of lately i observed an issue.Some of the
original text were like
,N'#attributes.SOFTPREREQ#'
My module does scan this code and suggests replacement to this
On Feb 27, 10:58 am, Chris Rebert wrote:
> On Fri, Feb 27, 2009 at 1:45 AM, Aj wrote:
> > Hi all,
>
> > I am trying to convert a list to string.
> > example [80, 89,84,72,79,78,0] is my input. I could make it to just
> > [0x50,0x59,0x54,0x48,0x4F,0x4E,0x00].
> > but I wanted it to be like "PYTHON
On Fri, Feb 27, 2009 at 1:45 AM, Aj wrote:
> Hi all,
>
> I am trying to convert a list to string.
> example [80, 89,84,72,79,78,0] is my input. I could make it to just
> [0x50,0x59,0x54,0x48,0x4F,0x4E,0x00].
> but I wanted it to be like "PYTHON".
> I couldnt even convert 0x50 to 'P'. Is there any
Hi all,
I am trying to convert a list to string.
example [80, 89,84,72,79,78,0] is my input. I could make it to just
[0x50,0x59,0x54,0x48,0x4F,0x4E,0x00].
but I wanted it to be like "PYTHON".
I couldnt even convert 0x50 to 'P'. Is there any library api available
to do this? it will be really helpf
Hi All,
I am looking to use win32com to set-up a Microsoft Message Queue
(MSMQ) between two or more computers connected on a LAN.
I have found this posting:
http://groups.google.co.uk/group/comp.lang.python/browse_thread/thread/80b42375ae84e3d7/989b864575997a9e?hl=en&lnk=gst&q=msmq#989b864575997
En Fri, 27 Feb 2009 07:02:57 -0200, lameck kassana
escribió:
now it is working but i wonder it brings higher number of count as if it
counts files in wholes computer can you check in my code and correct me
import glob
import os
file_count=0
fo
Greeting fellow pycoders,
I have a script that browses large codes and replaces certain text
with some other text. Of lately i observed an issue.Some of the
original text were like
,N'#attributes.SOFTPREREQ#'
My module does scan this code and suggests replacement to this code.
But when i u
You can hook the it on the main thread and just pass it. And let the threads
execute.
On Thu, Feb 26, 2009 at 10:47 PM, Gabriel Genellina
wrote:
> En Thu, 26 Feb 2009 16:17:42 -0200, Maxim Khitrov
> escribió:
>
>
> I'm looking for a function in the standard library or pywin32 package
>> that wi
bearophileh...@lycos.com wrote:
> odeits:
>> How big of a list are we talking about? If the list is so big that the
>> entire list cannot fit in memory at the same time this approach wont
>> work e.g. removing duplicate lines from a very large file.
>
> If the data are lines of a file, and keeping
bearophileh...@lycos.com writes:
> So using the XOR (or subtraction) trick to use only 1 pointer for
> each key-value may be useful to keep performance not too much far
> from the normal python dicts: http://en.wikipedia.org/wiki/XOR_linked_list
I don't see how to delete a randomly chosen node if
now it is working but i wonder it brings higher number of count as if it
counts files in wholes computer can you check in my code and correct me
import glob
import os
file_count=0
for files in
glob.glob(r"\\192.168.0.45\loader\Files\file_log\v20090
odeits:
> How big of a list are we talking about? If the list is so big that the
> entire list cannot fit in memory at the same time this approach wont
> work e.g. removing duplicate lines from a very large file.
If the data are lines of a file, and keeping the original order isn't
important, then
Chris Rebert:
> That seems to just be an overly complicated way of writing:
>
> spaces = bool(form.has_key('spaces') and form.getvalue('spaces') == 1)
Better:
spaces = bool(('spaces' in form) and form.getvalue('spaces') == 1)
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger:
>Paul Rubin:
>>another (messy) approach would be to write a C
>>extension that uses a doubly linked list some day.
>
> That seems like an ideal implementation to me.
This was my Python implementation, where the delete too is O(1), but
it's slow:
http://code.activestate.com/recip
Ah, I get it.
Thanks for clearing that up, guys.
--
http://mail.python.org/mailman/listinfo/python-list
Luis Zarrabeitia schrieb:
...
> It's quite good (and easy to install, unlike gforge), but the developers are
> moving on to a version 2.0 that you can find around here:
>
> http://basieproject.org/ (yeah, the website is ugly).
Is uses django. That's nice since I know it.
But the page looks
99 matches
Mail list logo