Re: select.select and socket.setblocking

2008-12-31 Thread Hendrik van Rooyen
"Francesco Bochicchio" wrote: > but then, IIRC TCP guarantees that the packet is fully received by > hand-shaking at transport level between sender and receiver. Ad once the > packet is fully in the receiver buffer, why should recv choose to give > back to the application only a piece of it? T

Re: Why not Ruby?

2008-12-31 Thread sln
On Wed, 31 Dec 2008 23:16:41 -0500, Kenneth Tilton wrote: >Xah Lee wrote: >> Just spent 3 hours looking into Ruby today. Here's my short impression >> for those interested. >> >> * Why Not Ruby? >> http://xahlee.org/UnixResource_dir/writ/why_not_Ruby.html >> >> plain text version follows: >>

Re: Why not Ruby?

2008-12-31 Thread member thudfoo
2008/12/31 Giampaolo Rodola' : > On 31 Dic, 18:55, Xah Lee wrote: >> Just spent 3 hours looking into Ruby today. Here's my short impression [...] > --- Giampaolo > http://code.google.com/p/pyftpdlib > Hey, Giampaolo: I had gone to the trouble to filter out the posts from xah lee, but you have q

Re: Why not Ruby?

2008-12-31 Thread Kenneth Tilton
Xah Lee wrote: > Just spent 3 hours looking into Ruby today. Here's my short impression > for those interested. > > * Why Not Ruby? > http://xahlee.org/UnixResource_dir/writ/why_not_Ruby.html > > plain text version follows: > -- > > Why Not Ruby? > > Xah Le

Videocapture in python

2008-12-31 Thread koranthala
I face issues in videocapture in python. Cant find anyplace where we can raise bug reports, so mentioning here. Also help required if somebody has solved it earlier. On using videocapture (python 2.4), I am facing the following issues while creating a video sort of application. -> Pull out the usb

Re: greenlets and how they can be used

2008-12-31 Thread James Mills
On Thu, Jan 1, 2009 at 9:24 AM, Aaron Brady wrote: (snip) > I had a dream for a while that in a GUI framework, every event would > spawn a unique thread. The GUI would remain responsive even while > executing minor tasks. Of course, shaving a second off running time > isn't exactly mission-crit

Re: Easy-to-use Python GUI

2008-12-31 Thread Gerhard Häring
Dotan Cohen wrote: I have been following this thread with interest. Is there a way to build Qt apps with relative easy? I use KDE and would prefer the Qt toolkit for my GUI apps. Thanks. A few years ago, I've had bad experiences with wxPython (random things not actually working on Linux, only

multiprocessing BaseManager doesn't clean up net connections?

2008-12-31 Thread Chris Brooks
Hi, I'm trying to use remote managers in the multiprocessing module to listen for some events synchronously while my program goes off and does other things. I use the .start() method which forks a new process to handle communication. When I catch the sigint and call sys.exit() though, the netwo

Re: Why not Ruby?

2008-12-31 Thread Bruno Desthuilliers
Roger a écrit : On Dec 31, 12:55 pm, Xah Lee wrote: (snip) Who are you? His name is Xah Lee, and he's a well(hem)known troll. Just ignore him. -- http://mail.python.org/mailman/listinfo/python-list

Re: multiprocessing vs thread performance

2008-12-31 Thread Aaron Brady
On Dec 31, 6:19 pm, Paul Rubin wrote: > Aaron Brady writes: > > I had an idea.  You could use 'multiprocessing' for synchronization, > > and just use an mmap for the actual communication.  (I think it's a > > good idea.) > > Are you reinventing POSH?  (http://poshmod

Re: multiprocessing vs thread performance

2008-12-31 Thread Philip Semanchuk
On Dec 31, 2008, at 7:19 PM, Paul Rubin wrote: Aaron Brady writes: I had an idea. You could use 'multiprocessing' for synchronization, and just use an mmap for the actual communication. (I think it's a good idea.) Are you reinventing POSH? (http://poshmodule.sourceforge.net) Or sysv_ip

Re: why cannot assign to function call

2008-12-31 Thread Aaron Brady
On Dec 31, 1:39 am, Tim Roberts wrote: > Aaron Brady wrote: > > >I think the problem goes deeper than just English.  In any language > >that has a plural, the propositions in question come out as, 'one > >thing is two things' or 'two things are one thing'.  According to some > >rules, these are u

Re: multiprocessing vs thread performance

2008-12-31 Thread Paul Rubin
Aaron Brady writes: > I had an idea. You could use 'multiprocessing' for synchronization, > and just use an mmap for the actual communication. (I think it's a > good idea.) Are you reinventing POSH? (http://poshmodule.sourceforge.net) -- http://mail.python.org/mailman/listinfo/python-list

Re: SQL, lite lite lite

2008-12-31 Thread Aaron Brady
On Dec 30, 2:52 pm, Bruno Desthuilliers wrote: > Aaron Brady a écrit : > > > On Dec 30, 11:16 am, prueba...@latinmail.com wrote: > (snip) > >> You really do like to reinvent the wheels do you? :-) Nothing wrong > >> with that. Just be aware that most people that really need what you > >> are propo

Re: Graphics Library with Standard Interaction Features, 2D and 3D

2008-12-31 Thread Mirage
On Dec 31, 6:18 am, Stef Mientki wrote: > Maybe VPython (Visual) or Panda fits your needs. > cheers, > Stef I second that. Panda3D is awesome in so many ways. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pass by reference

2008-12-31 Thread Aaron Brady
On Dec 31, 5:30 am, iu2 wrote: > Hi, > > Is it possible somehow to change a varible by passing it to a > function? > > I tried this: > > def change_var(dict0, varname, val): >   dict0[varname] = val > > def test(): >   a = 100 >   change_var(locals(), 'a', 3) >   print a > > But test() didn't work

Re: type conversion

2008-12-31 Thread Benjamin Kaplan
On Wed, Dec 31, 2008 at 5:26 PM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Wed, 31 Dec 2008 12:35:20 -0800, Hamish McKenzie wrote: > > > sometimes I want to be able to initialize an instance with a variety of > > different data types. > > Type conversion is a bit of a mis

Re: How to initialize an array with a large number of members ?

2008-12-31 Thread Scott David Daniels
David Lemper wrote: ... Python. Using version 3.0 # script23 from array import array < see failed initialization attempts below > tally = array('H',for i in range(75) : [0]) tally = array('H',[for i in range(75) : 0]) tally = array('H',range(75) : [0]) tally = array('H',range

Re: Easy-to-use Python GUI

2008-12-31 Thread Aaron Brady
On Dec 29, 5:49 pm, "Joel Koltner" wrote: > Thanks to everyone who responded; I'll be checking out the various toolkits > people have listed! > > ---Joel There is wxFormBuilder, which stores a GUI design in XML format. It may be lengthy, but your data reside in a data structure, and your program

Re: greenlets and how they can be used

2008-12-31 Thread Aaron Brady
On Dec 30, 9:40 pm, "James Mills" wrote: > Hey all, > > The "greenlet" fromhttp://codespeak.net/py/dist/greenlet.html > is a rather interesting way of handling flow of control. > > I can't seem to find anything else on the subject > except for the above link and the most recent version > 0.2 and i

Re: multiprocessing vs thread performance

2008-12-31 Thread Aaron Brady
On Dec 29, 9:29 am, mk wrote: > Christian Heimes wrote: > > mk wrote: > >> Am I doing smth wrong in code below? Or do I have to use > >> multiprocessing.Pool to get any decent results? > > > You have missed an important point. A well designed application does > > neither create so many threads nor

Re: math module for Decimals

2008-12-31 Thread Steven D'Aprano
On Sun, 28 Dec 2008 06:38:32 -0800, Mark Dickinson wrote: > On Dec 28, 7:28 am, Steven D'Aprano cybersource.com.au> wrote: >> Ah crap, I forgot that from_float() has been left out of the decimal >> API. That's very annoying. > > Agreed. It's maybe even annoying enough that a feature request at

Re: type conversion

2008-12-31 Thread Steven D'Aprano
On Wed, 31 Dec 2008 12:35:20 -0800, Hamish McKenzie wrote: > sometimes I want to be able to initialize an instance with a variety of > different data types. Type conversion is a bit of a misleading subject line. You're not really converting different types, just initialising from different types

Re: Creating an application for Linux

2008-12-31 Thread Mike Driscoll
On Dec 31, 3:36 pm, lkcl wrote: > hiya mike: where do i know you from?  i've heard your name somewhere > and for the life of me can't remember where!  anyway... onwards. > I don't know...while your username looks vaguely familiar, I don't think I've communicated with you recently. I spend most of

PyS60, GPS and SMS

2008-12-31 Thread makobu
# Send an SMS with your current GPS co-ordinates using a # Nokia SmartPhone and PyS60 # # Timothy Makobu, 01-01-2009 import positioning import messaging import appuifw import sys # G

Re: Creating an application for Linux

2008-12-31 Thread lkcl
hiya mike: where do i know you from? i've heard your name somewhere and for the life of me can't remember where! anyway... onwards. your simplest bet is to take advantage of the .deb install system, which, if you follow that, will allow you to pull in all of the dependencies _without_ screwing a

Re: Creating an application for Linux

2008-12-31 Thread Benjamin Kaplan
On Wed, Dec 31, 2008 at 4:06 PM, Mike Driscoll wrote: > Hi, > > My boss wants me to port one of my applications to Ubuntu. I > successfully ported it without too many headaches but now I need a way > to distribute it to people that may or may not already have the > dependencies my application req

Creating an application for Linux

2008-12-31 Thread Mike Driscoll
Hi, My boss wants me to port one of my applications to Ubuntu. I successfully ported it without too many headaches but now I need a way to distribute it to people that may or may not already have the dependencies my application requires. I'm a newb with Linux so I'm not even sure what they call th

type conversion

2008-12-31 Thread Hamish McKenzie
sometimes I want to be able to initialize an instance with a variety of different data types. as an obvious example I might want to initialize a 4x4 matrix with either 16 floats, a list/tuple or 16 floats, another matrix or a quaternion. is there any other way to do it other than putting case s

Re: Why not Ruby?

2008-12-31 Thread Tim Greer
Giampaolo Rodola' wrote: > This is not a Ruby group. > I recommend you to go waste your time there. That poster has a frequent habit of cross posting to multiple, irrelevant news groups. There's no rhyme or reason to it. It's best to just filter the guy's posts. -- Tim Greer, CEO/Founder/CTO,

Re: PIL on 3.x?

2008-12-31 Thread Daniel Fetchinson
> Does anyone know if PIL will be ported to the 3.x branch? Actually, Guilherme Polo has ported PIL 1.1.6 to python 3.0: http://mail.python.org/pipermail/image-sig/2008-December/005338.html Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.or

Re: Why not Ruby?

2008-12-31 Thread Giampaolo Rodola'
On 31 Dic, 18:55, Xah Lee wrote: > Just spent 3 hours looking into Ruby today. Here's my short impression > for those interested. > > * Why Not Ruby? > http://xahlee.org/UnixResource_dir/writ/why_not_Ruby.html > > plain text version follows: > -- > > Why Not Ru

[ANN] Builds of PyWebkitGtk and Webkit-Glib-Gtk (r39359+#16401.master) for Debian i386, Debian AMD64 and Macports MacOSX 10.4

2008-12-31 Thread Luke Kenneth Casson Leighton
webkit-glib-gtk provides gobject bindings to webkit's DOM model. pywebkitgtk provides python bindings to the gobject bindings of webkit's DOM model. files are available for download at: https://sourceforge.net/project/showfiles.php?group_id=236659&package_id=290457&release_id=650548 separate pre-

Re: Why not Ruby?

2008-12-31 Thread Roger
On Dec 31, 12:55 pm, Xah Lee wrote: > Just spent 3 hours looking into Ruby today. Here's my short impression > for those interested. > Who are you? In case no one tells you, you are a cocky, egotistical windbag with opinions that border constructive but never gets there. Why would anyone care

Re: select.select and socket.setblocking

2008-12-31 Thread Francesco Bochicchio
Saju Pillai ha scritto: On Dec 31, 7:48 pm, Francesco Bochicchio wrote: Is this correct ? IIRC even in blocking mode recv() can return with less bytes than requested, unless the MSG_WAITALL flag is supplied. Blocking mode only guarantees that recv() will wait for a message if none is available

Re: select.select and socket.setblocking

2008-12-31 Thread Scott David Daniels
Jean-Paul Calderone wrote: ... On a LAN, it's likely that you'll generally get the exact number of bytes which the sender passed to one call of send (until the sender starts to pass really huge strings to send, then it'll get split up) just because the network has lots of capacity compared to the

Re: MemoryError when list append... plz help

2008-12-31 Thread Gabriel Genellina
En Wed, 31 Dec 2008 06:34:48 -0200, Steven D'Aprano escribió: Each time you are appending to the list, you append a tuple: ((i, j), sim) where sim is a float and i and j are ints. How much memory does each of those take? sys.getsizeof( ((0, 1), 1.1) ) 32 (On Windows, 32 bits, I get 36)

Re: How to initialize an array with a large number of members ?

2008-12-31 Thread bearophileHUGS
MRAB: >  >>> # With a list >  >>> tally = array('H', [0] * 75) >  >>> >  >>> # With a generator >  >>> tally = array('H', (0 for i in range(75))) Time ago we have had a long discussion about this, the right way is: tally = array(someformat, [0]) * 75 (If you need to initialize it to something th

Re: How to get back a list object from its string representation?

2008-12-31 Thread Gabriel Genellina
En Wed, 31 Dec 2008 04:27:01 -0200, Steven D'Aprano escribió: On Wed, 31 Dec 2008 03:08:29 -0200, Gabriel Genellina wrote: eval is like Pandora´s box, all kind of bad things can come from it. Do not use it with any user-supplied string. If you can restrict the values to be just constants, t

Re: SQL, lite lite lite

2008-12-31 Thread Joel Koltner
"Gerhard Häring" wrote in message news:6rvgihf3je6...@mid.uni-berlin.de... > Using an ORM when you don't grasp the relational model and/or the SQL query > language is futile. You'd probably be surprised just how many people there are out there using SQLlite (and other databases) who have no mo

Why not Ruby?

2008-12-31 Thread Xah Lee
Just spent 3 hours looking into Ruby today. Here's my short impression for those interested. * Why Not Ruby? http://xahlee.org/UnixResource_dir/writ/why_not_Ruby.html plain text version follows: -- Why Not Ruby? Xah Lee, 2008-12-31 Spent about 3 hours look

Re: Desktop/File management support on MS Windows

2008-12-31 Thread r
On Dec 31, 11:08 am, "riklau...@gmail.com" wrote: > Are there any Python libraries that can trash files (move to Trash, > not delete) or for example return a list of applications that can open > given file? I can't find anything related to this for Windows. try pywin32 http://python.net/crew/mham

RE: error on windows with commands.getstatusoutput

2008-12-31 Thread Lee Harr
> Anyhow, I've replaced it with this: > > > from subprocess import Popen, PIPE, STDOUT > p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, > stderr=STDOUT, close_fds=True) > output, unused = p.communicate() > status = p.returncode > > > Does that look more

Desktop/File management support on MS Windows

2008-12-31 Thread riklau...@gmail.com
Are there any Python libraries that can trash files (move to Trash, not delete) or for example return a list of applications that can open given file? I can't find anything related to this for Windows. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to initialize an array with a large number of members ?

2008-12-31 Thread MRAB
da...@bag.python.org wrote: Thanks to those who have helped a beginner in Python. Using version 3.0 # script23 from array import array < see failed initialization attempts below > tally = array('H',for i in range(75) : [0]) tally = array('H',[for i in range(75) : 0]) tally =

Solved. was: Memory leak problem (while using tkinter)

2008-12-31 Thread André
On Dec 31, 12:21 am, André wrote: > I have written a small program (my first Tkinter-based app) to play > around the idea mentioned on > http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mo... > and, in doing so, have encountered a memory leak problem.   I have > seen mentions on

Re: Graphics Library with Standard Interaction Features, 2D and 3D

2008-12-31 Thread Grant Edwards
On 2008-12-31, Benjamin Blundell wrote: > Hi all. I've had a look around the forums and the we and im looking > for a library (or a set of libraries) for dealing with Visualisation > and Interaction in Python. Have you looked at VTK? http://www.vtk.org/ I've only used some of the numerical s

Re: select.select and socket.setblocking

2008-12-31 Thread Grant Edwards
On 2008-12-31, Francesco Bochicchio wrote: > Grant Edwards ha scritto: >> On 2008-12-30, Francesco Bochicchio wrote: >> >>> 3. AFAIK (sorry, I feel acronym-ly today ;), there is no difference in >>> select between blocking and non-blocking mode. The difference is in the >>> recv (again, assumin

How to initialize an array with a large number of members ?

2008-12-31 Thread David
Thanks to those who have helped a beginner in Python. Using version 3.0 # script23 from array import array < see failed initialization attempts below > tally = array('H',for i in range(75) : [0]) tally = array('H',[for i in range(75) : 0]) tally = array('H',range(75) : [0])

Re: change only the nth occurrence of a pattern in a string

2008-12-31 Thread Tim Chase
I would like to change only the nth occurence of a pattern in a string. The problem with "replace" method of strings, and "re.sub" is that we can only define the number of occurrences to change from the first one. v="coucou" v.replace("o","i",2) 'ciuciu' import re re.sub( "o", "i", v,2) 'c

Re: change only the nth occurrence of a pattern in a string

2008-12-31 Thread Steven D'Aprano
On Wed, 31 Dec 2008 15:40:32 +0100, TP wrote: > Hi everybody, > > I would like to change only the nth occurence of a pattern in a string. > The problem with "replace" method of strings, and "re.sub" is that we > can only define the number of occurrences to change from the first one. > v="co

Re: select.select and socket.setblocking

2008-12-31 Thread Jean-Paul Calderone
On Wed, 31 Dec 2008 15:48:50 +0100, Francesco Bochicchio wrote: < ... > Uhm. In my experience, with TCP protocol recv only returned less than the required bytes if the remote end disconnects. I always check the What if the sending end actually sent less than you asked for ? -srp In blocki

Re: change only the nth occurrence of a pattern in a string

2008-12-31 Thread Roy Smith
In article <0scs26-7a5@rama.fbx.proxad.net>, TP wrote: > Hi everybody, > > I would like to change only the nth occurence of a pattern in a string. It's a little ugly, but the following looks like it works. The gist is to split the string on your pattern, then re-join the pieces using the

Re: select.select and socket.setblocking

2008-12-31 Thread Karen Tracey
On Wed, Dec 31, 2008 at 5:39 AM, Francesco Bochicchio wrote: > Francesco Bochicchio ha scritto: > >> >>> No, in blocking mode it will wait to receive _some_ data (1 or >>> more bytes). The "requested" amount is strictly an upper >>> limit: recv won't return more than the requested number of >>> b

Re: Parsing Excel spreadsheets

2008-12-31 Thread John Machin
On Dec 31 2008, 4:02 pm, brooklineTom wrote: > andyh...@gmail.com wrote: > > Hi, > > > Can anybody recommend an approach for loading and parsing Excel > > spreadsheets in Python. Any well known/recommended libraries for this? > > > The only thing I found in a brief search > > washttp://www.lexico

Re: select.select and socket.setblocking

2008-12-31 Thread Saju Pillai
On Dec 31, 7:48 pm, Francesco Bochicchio wrote: > < ... > > > >> Uhm. In my experience, with TCP protocol recv only returned less than > >> the required bytes if the remote end disconnects. I always check the > > > What if the sending end actually sent less than you asked for ? > > > -srp > > In b

Re: select.select and socket.setblocking

2008-12-31 Thread Francesco Bochicchio
< ... > Uhm. In my experience, with TCP protocol recv only returned less than the required bytes if the remote end disconnects. I always check the What if the sending end actually sent less than you asked for ? -srp In blocking mode and with TCP protocol, the recv waits until more bytes a

change only the nth occurrence of a pattern in a string

2008-12-31 Thread TP
Hi everybody, I would like to change only the nth occurence of a pattern in a string. The problem with "replace" method of strings, and "re.sub" is that we can only define the number of occurrences to change from the first one. >>> v="coucou" >>> v.replace("o","i",2) 'ciuciu' >>> import re >>> re

Re: Graphics Library with Standard Interaction Features, 2D and 3D

2008-12-31 Thread Stef Mientki
Maybe VPython (Visual) or Panda fits your needs. cheers, Stef -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: list indices must be integers

2008-12-31 Thread John Machin
On Dec 31 2008, 3:26 pm, dubux wrote: > thanks for help everyone. it turned out the function itself worked > fine.. it was the way i was calling it that was messing everything up. > i ended up re-doing the whole thing as follows, and it now works > perfectly. > > def news(x,y): >         news_file

Re: Pass by reference

2008-12-31 Thread Chris Rebert
On Wed, Dec 31, 2008 at 5:04 AM, iu2 wrote: > For the 2 targets I have the variables comm1 and comm2. They are of > some class I wrote, representing many properties of the communication, > including the IP address. > There is one function that sends data, and it receives a commX var > (comm1 or c

Re: Graphics Library with Standard Interaction Features, 2D and 3D

2008-12-31 Thread Benjamin Blundell
On Dec 31, 12:55 pm, Python wrote: > On 31 dec 2008, at 13:37, Benjamin Blundell wrote: > > > > > Hi all. I've had a look around the forums and the we and im looking > > for a library (or a set of libraries) for dealing with Visualisation > > and Interaction in Python. At the moment i've been usin

Re: Pass by reference

2008-12-31 Thread iu2
On Dec 31, 1:48 pm, "Chris Rebert" wrote: ... > > Not really, or at the very least it'll be kludgey. Python uses > call-by-object (http://effbot.org/zone/call-by-object.htm), not > call-by-value or call-by-reference. > > Could you explain why you have to set so many variables to the same > value (

Re: Graphics Library with Standard Interaction Features, 2D and 3D

2008-12-31 Thread Python
On 31 dec 2008, at 13:37, Benjamin Blundell wrote: Hi all. I've had a look around the forums and the we and im looking for a library (or a set of libraries) for dealing with Visualisation and Interaction in Python. At the moment i've been using Flash with the Five3D library to do most of the wo

Graphics Library with Standard Interaction Features, 2D and 3D

2008-12-31 Thread Benjamin Blundell
Hi all. I've had a look around the forums and the we and im looking for a library (or a set of libraries) for dealing with Visualisation and Interaction in Python. At the moment i've been using Flash with the Five3D library to do most of the work. Sadly this isnt an option anymore but it is a good

Re: Pass by reference

2008-12-31 Thread Bruno Desthuilliers
iu2 a écrit : Hi, Is it possible somehow to change a varible by passing it to a function? For which definition of "change a variable" ? I tried this: def change_var(dict0, varname, val): dict0[varname] = val Ok, this is mutating dict0, so it works. def test(): a = 100 change_var(

Re: Pass by reference

2008-12-31 Thread Chris Rebert
On Wed, Dec 31, 2008 at 3:30 AM, iu2 wrote: > Hi, > > Is it possible somehow to change a varible by passing it to a > function? > > I tried this: > > def change_var(dict0, varname, val): > dict0[varname] = val > > > def test(): > a = 100 > change_var(locals(), 'a', 3) > print a > > > But test(

Pass by reference

2008-12-31 Thread iu2
Hi, Is it possible somehow to change a varible by passing it to a function? I tried this: def change_var(dict0, varname, val): dict0[varname] = val def test(): a = 100 change_var(locals(), 'a', 3) print a But test() didn't work, the value a remains 100. I have several variables init

Re: select.select and socket.setblocking

2008-12-31 Thread Saju Pillai
On Dec 31, 2:01 pm, Francesco Bochicchio wrote: > Grant Edwards ha scritto: > > > On 2008-12-30, Francesco Bochicchio wrote: > > >> 3. AFAIK (sorry, I feel acronym-ly today ;), there is no difference in > >> select between blocking and non-blocking mode. The difference is in the > >> recv (again,

Re: Easy-to-use Python GUI

2008-12-31 Thread Dotan Cohen
I have been following this thread with interest. Is there a way to build Qt apps with relative easy? I use KDE and would prefer the Qt toolkit for my GUI apps. Thanks. -- Dotan Cohen http://what-is-what.com http://gibberish.co.il א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת ا-ب-ت-ث-ج-ح

Re: select.select and socket.setblocking

2008-12-31 Thread Francesco Bochicchio
Francesco Bochicchio ha scritto: No, in blocking mode it will wait to receive _some_ data (1 or more bytes). The "requested" amount is strictly an upper limit: recv won't return more than the requested number of bytes, but it might return less. Uhm. In my experience, with TCP protocol recv o

Re: select.select and socket.setblocking

2008-12-31 Thread Francesco Bochicchio
Jean-Paul Calderone ha scritto: On Tue, 30 Dec 2008 19:19:08 +0100, Francesco Bochicchio wrote: [snip] If you are interested in socket errors, you should also fill the third 'fd-set' in the select call, and after select returns check that fd is not in it anymore: ready = select.select( [fd]

Re: select.select and socket.setblocking

2008-12-31 Thread Francesco Bochicchio
Grant Edwards ha scritto: On 2008-12-30, Francesco Bochicchio wrote: 3. AFAIK (sorry, I feel acronym-ly today ;), there is no difference in select between blocking and non-blocking mode. The difference is in the recv (again, assuming that you use TCP as protocol, that is AF_INET, SOCK_STREAM)

Re: MemoryError when list append... plz help

2008-12-31 Thread bearophileHUGS
[BON]: > above sim is floating type. > s.append is totally coducted 60,494,500 times. > but this code raise MemoryError. > > My computer has 4G RAM. > i think it's enough. but it doesn't... Try creating it in a more clean way, here an array of doubles: >>> from array import array >>> a = array("d

Re: Memory leak problem (while using tkinter)

2008-12-31 Thread Marc 'BlackJack' Rintsch
On Tue, 30 Dec 2008 20:21:06 -0800, André wrote: > I have written a small program (my first Tkinter-based app) to play > around the idea mentioned on > http://rogeralsing.com/2008/12/07/genetic-programming-evolution-of-mona- lisa/ > and, in doing so, have encountered a memory leak problem. I hav

Re: MemoryError when list append... plz help

2008-12-31 Thread Steven D'Aprano
On Tue, 30 Dec 2008 22:02:49 -0800, [BON] wrote: > == > s=[] > for i in range(11000-1): > for j in range(i+1, 11000): > > s.append(((i,j),sim)) > == > above sim is floating type. > s.append is totally coducted 60,494,500 times. but t

Re: MemoryError when list append... plz help

2008-12-31 Thread Francesco Bochicchio
[BON] ha scritto: == s=[] for i in range(11000-1): for j in range(i+1, 11000): s.append(((i,j),sim)) == above sim is floating type. s.append is totally coducted 60,494,500 times. but this code raise MemoryError. My computer has

Re: string in files

2008-12-31 Thread Glauco
Steven D'Aprano ha scritto: On Tue, 30 Dec 2008 11:53:17 +0100, Glauco wrote: thanks brother i mean how do i particularly assign (u = this) (y = is) in the strings up there. i have been able to split strings with any character sign. If i'm not wrong t

Re: New Python 3.0 string formatting - really necessary?

2008-12-31 Thread r
You know, it is so much easier to find my posts now that someone has been thoughtful enough to mark them for me. Thank you kind chaps, i shall leave a shiny new nickel for you, just send me your name, address, and phone numbers. I'll get them in the mail right away. -- http://mail.python.org/mailma