Re: Python 3K or Python 2.9?

2007-09-12 Thread Ivan Voras
Bruno Desthuilliers wrote: TheFlyingDutchman a écrit : Python user and advocate Bruce Eckel is disappointed with the additions (or lack of additions) in Python 3: http://www.artima.com/weblogs/viewpost.jsp?thread=214112 I'd say Mr Eckel fails to graps some of the great points about Python's

Re: Parallel/Multiprocessing script design question

2007-09-13 Thread Ivan Voras
Amit N wrote: About 800+ 10-15MB files are generated daily that need to be processed. The processing consists of different steps that the files must go through: -Uncompress -FilterA -FilterB -Parse -Possibly compress parsed files for archival You can implement one of two easy straightforward

Python "with"

2007-09-16 Thread Ivan Voras
Hi, I'm looking for a construct that's similar to (Turbo) Pascal's "with" statement. I read about the Python's new "with" statement, but I was dissapointed to learn that it does something different (I still don't see how it's better than try..except..finally, but that's not my question). Is there

Re: Python "with"

2007-09-17 Thread Ivan Voras
Laurent Pointal wrote: The ugly part is the 'tmp' name, try to choose a name with a proper meaning about what it is really, and it become clean and readable: filerefs = some.big.structure.or.nested.object.with.file.references filerefs.encoding = "utf-8" filerefs.name = "MyFileName.txt" fileref

Embedding Python with Tkinter

2007-01-11 Thread Ivan Johansen
create a new dialog with Tkinter, I have to create it without a parent, which causes it to be shown in the task bar and I cannot make it modal. Does anyone know how to create a Tkinter window as a child of a window that was not created by Tkinter? Ivan Johansen -- http://mail.python.org/mailman

Re: Poor python and/or Zope performance on Sparc

2007-11-03 Thread Ivan Voras
joa2212 wrote: > We have a Sun T1000 with 8 cores and 8 GB of RAM. First, I installed > Solaris 10 because I know this OS better than Debian Linux. Result: > poor Performance. After that I decided to migrate to debian: Do you know the architecture of this machine? It's extremely streamlined for d

Re: Simple DAV server?

2006-04-18 Thread Ivan Voras
robert wrote: > For testing purposes I'm looking for a simple DAV server - best a python > thing serving a folder tree. Don't want to install/change/setup the > complex apache dav .. > You can try this one: http://ivoras.sharanet.org/projects/pandav.html It's been a while since I last updated

Re: Simple DAV server?

2006-04-19 Thread Ivan Voras
robert wrote: > > thanks, that's exactly to the point: > > python server.py 8080 mydavrootfolder Thanks for the patch, I assume it's free to incorporate it into the original archive? Also, see my reply to "Kyler Laird"... -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple DAV server?

2006-04-19 Thread Ivan Voras
Kyler Laird wrote: > I added the ability to create and delete collections (directories), > delete members (files), authenticate users, and run per-user setuid/ > setgid. It works well with Cadaver but I'm waiting for some MS users > to report how it works under Windows. > > The only thing on my

Re: Simple DAV server?

2006-04-20 Thread Ivan Voras
robert wrote: > maybe thats a good idea to put it on sf.net to boil out all bugs. > Yet I like it in that simple default manner, maybe switch on those > additional creation functions with commandline switches (or config class > instance passed to run..(config=None) ) I'm thinking of making a sm

Re: freebsd thread problem

2006-04-24 Thread Ivan Voras
Dorian Mcfarland wrote: > Hi there, > I have installed python(2.4.3) & trac(0.9.4) on freebsd(4.8) from the > ports collection and I seem to have an underlying problem with the > thread module. > Salling 'import thread' from the python prompt yields the same result. > > I have a 'threading.py'

Re: Simple DAV server?

2006-04-27 Thread Ivan Voras
Kyler Laird wrote: > Ivan's been working on a problem I've been experiencing with Windows XP > ("failure to launch"). He sent a new version my way today. I'm going > to test it tomorrow when I've got some XP users available. If it works > I'm going to work on putting my changes into a subclass.

Re: Wake on LAN and Shutdown for Windows and Linux

2006-05-03 Thread Ivan Shevanski
d probably write an easy batch file for windows. . .For Linux?  Maybe use the recipe.  Sorry its not in Python =D-- -Ivan -- http://mail.python.org/mailman/listinfo/python-list

Fastest quoting

2006-05-03 Thread Ivan Voras
What is the fastest way (execution speed) to backslash-escape characters from a specific set? Specifically: \r, \n and \0? (i.e. I need "some\r\nstring\0" to become "some\\r\\nstring\\0") -- http://mail.python.org/mailman/listinfo/python-list

Re: NaN handling

2006-05-05 Thread Ivan Vinogradov
> > NaNs are handled. Throwing an exception would be nice in regular Python (non-scipy). This works to catch NaN on OSX and Linux: # assuming x is a number if x+1==x or x!=x: #x is NaN But is expensive as a precautionary measure. Assert can be used for testing, if production code can

Re: ConfigParser and multiple option names

2006-05-05 Thread Ivan Vinogradov
Another option is to use a dedicated section and simply omit values for options: [dirs] /path/1: /long/path/2: /etc: Then get options for section dirs. This approach precludes using ':' or '=' in paths though. -- http://mail.python.org/mailman/listinfo/python-list

Re: NaN handling

2006-05-05 Thread Ivan Vinogradov
me, I need them to propagate quietly. Our programming expectations may differ, but an option to catch NaNs as an exception is a great idea. Regards, Ivan. -- http://mail.python.org/mailman/listinfo/python-list

Re: NaN handling

2006-05-05 Thread Ivan Vinogradov
versal Python install). Since numpy seems to be working on a variety of platforms/hardware, how hard would it be to extract this functionality from it to add to Python proper? Cheers, Ivan. -- http://mail.python.org/mailman/listinfo/python-list

Slow network reading?

2006-05-10 Thread Ivan Voras
I have a simple network protocol client (it's a part of this: http://sqlcached.sourceforge.net) implemented in Python, PHP and C. Everything's fine, except that the Python implementation is the slowest - up to 30% slower than the PHP version (which implements exactly the same logic, in a class)

Re: Slow network reading?

2006-05-12 Thread Ivan Voras
Andrew MacIntyre wrote: > Comparative CPU & memory utilisation statistics, not to mention platform > and version of Python, would be useful hints... During benchmarking, all versions cause all CPU to be used, but Python version has ~1.5x more CPU time allocated to it than PHP. Python is 2.4.1

[ANN] PanDAV on SourceForge.net

2006-05-13 Thread Ivan Voras
Around three weeks ago there was a thread about Python WebDAV servers, and I mentioned my "PanDAV" work (old homepage: http://ivoras.sharanet.org/projects/pandav.html). There was some interest in continuing the development and merging patches made by its users, so I requested a SourceForge proj

Re: Slow network reading?

2006-05-13 Thread Ivan Voras
Andrew MacIntyre wrote: >> That's only because I need the .readline() function. In C, I'm using >> fgets() (with the expectation that iostream will buffer data). > > The readline method of the file object lookalike returned by makefile > implements all of the line splitting logic in Python code,

Re: Help needed

2008-01-10 Thread Ivan Novick
se work could someone please help me > thanks in advance. > > tijo So you want to write a program using sockets then? http://docs.python.org/lib/module-socket.html Regards, Ivan Novick http://www.0x4849.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Persistent HTTP Connections with Python?

2008-01-10 Thread Ivan Novick
s like the exact nature of the API being provided. I highly doubt HTTP persistent connections has anything to do with what you will need to connect to there service. Services like this normally come with example code, i recommend you get access to that. Regards, Ivan Novick http://www.0x4849.net --

Re: reading a specific column from file

2008-01-11 Thread Ivan Novick
one has any ideas. As for the just filtering out the third column, you have been given many suggestions already. Regards, Ivan Novick http://www.0x4849.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Events in Python

2008-01-30 Thread Ivan Illarionov
You may need Louie (http://louie.berlios.de) Django (http://djangoproject.com) does the same in django.dispatch - and Django version works about 33% faster. Note that all those signals/events are very slow in Python. --Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Events in Python

2008-01-30 Thread Ivan Illarionov
> Compared to what, did you measure something? As example, instantiation of Model classes in Django (Model.__init__) sends two signals (pre_init and post_init) - they are rarely used in practice - but they make instantiation about two times slower. Yes, I measured that. The creator of Louie (Patr

Re: REALLY simple xml reader

2008-01-30 Thread Ivan Illarionov
>>> from xml.etree import ElementTree as et >>> from decimal import Decimal >>> >>> root = et.parse('file/with/your.xml') >>> debits = dict((debit.attrib['category'], >>> Decimal(debit.find('amount').text)) for debit in root.findall('debit')) >>> >>> for cat, amount in debits.items(): ... print

Re: REALLY simple xml reader

2008-01-31 Thread Ivan Illarionov
> Also, for XML documents, they were probably thinking that the > documents will be machine-generated most of the time. As far as I can > tell, they were right in that. If anybody has to deal with human-generated XML/HTML in Python it may be better to use something like http://www.crummy.com/softw

SimpleXMLRPCServer to fastcgi via WSGI?

2008-02-01 Thread Ivan Voras
Hi, Is there a straightforward way to convert an XML-RPC server application (written for SimpleXMLRPCServer) to use WSGI so that it can be used as s fastcgi server? By "straightforward" I mean something simple, without using some external framework. Alternatively, I don't really care about WSGI,

Re: Does anyone else use this little idiom?

2008-02-03 Thread Ivan Illarionov
Plain Python function are very often more powerful than classes: >>> def go(count): ... if not hasattr(go, 'count'): ... go.count = count ... if go.count <= 0: ... del go.count ... return False ... go.count -= 1 ... return True ... >>> while go(3): ... print 'hello' ... hello

Re: fast method accessing large, simple structured data

2008-02-03 Thread Ivan Illarionov
> Is there some good format that is optimized for search for > just 1 attribute (title) and then returning the corresponding article? I would use Durus (http://www.mems-exchange.org/software/durus/) - simple pythonic object database - and store this data as persistent python dict with Title keys a

Re: Does anyone else use this little idiom?

2008-02-03 Thread Ivan Illarionov
On Feb 4, 12:56 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sun, 03 Feb 2008 05:33:16 -0800, Ivan Illarionov wrote: > > Plain Python function are very often more powerful than classes: > > >>>> def go(count): > > ... if not h

Re: Double underscores -- ugly?

2008-02-19 Thread Ivan Illarionov
I would like to see something like %init or &init to be converted to __init__ behind the scenes. And $something to be converted to self.something. But, unfortunately, most Python people would consider this ugly just because Perl uses too much syntactic sugar and anything Perl-like is considered ugl

Re: Hyphenation module PyHyphen-0.3 released

2008-02-24 Thread Ivan Illarionov
> I don't know if I'm just doing it wrong, or if I can't use extensions > compiled with mingw32 with the standard distribution Python > executable? I was able to install on Windows XP with mingw: setup.py build -c mingw32 setup.py install --skip-build It works fine with English dictionary, but h

Re: struct unpack

2008-03-17 Thread Ivan Illarionov
On Mar 17, 11:00 pm, brnstrmrs <[EMAIL PROTECTED]> wrote: > If I run: > > testValue = '\x02\x00' > junk = struct.unpack('h', testValue) > > Everything works but If I run > > testValue = raw_input("Enter Binary Code..:") inputting at the > console '\x02\x00' > junk = struct.unpack('h', testValue) >

Re: Interesting math problem

2008-03-17 Thread Ivan Illarionov
On Mar 18, 1:24 am, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote: > Here is an interesting math problem: > > You have a number X > 0 and another number Y > 0. The goal is to > divide X into a list with length Y. Each item in the list is an > integer. The sum of all integers is X. Each integer is eit

Re: Fast 2D Raster Rendering with GUI

2008-03-17 Thread Ivan Illarionov
ow-level access to their image memory buffers. PyGame is for multimedia applications, you probably need Tkinter, Qt, wx or GTK. And as long as you need such low-level things as custom drawing and anti-aliasing your API is plain old C malloc's, free's and raw memory addresses. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Ivan Illarionov
On Mar 19, 2:33 am, dave <[EMAIL PROTECTED]> wrote: > First I want to say thank you all for your timely replies. This is all > good food for thought. I've been programming more many years, but fast > graphics rendering is new territory for me. > > I'm hoping to fine something like a buffer_blit, wh

Re: Fast 2D Raster Rendering with GUI

2008-03-18 Thread Ivan Illarionov
> That's another new step for me. Any ideas where to start? http://docs.python.org/ext/simpleExample.html And look into the source of existing extensions. PIL and PyCairo are the best in your situation. -- http://mail.python.org/mailman/listinfo/python-list

Re: 'Import sys' succeeds in C++ embedded code, but module is not fully visible

2009-01-13 Thread Ivan Illarionov
ter, 0, path_python_str) -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: 'Import sys' succeeds in C++ embedded code, but module is not fully visible

2009-01-14 Thread Ivan Illarionov
rence sys from within the function? Ah, sorry for wrong guess. I would try to use ourNamespace_ dict for both globals and locals in PyRun_String call. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: 'Import sys' succeeds in C++ embedded code, but module is not fully visible

2009-01-14 Thread Ivan Illarionov
code to work, it may be a separate dictionary from globals though. >From what I know 'sys' module is related to builtins. My knowledge of Python internals is not so deep to explain the details of this relationship and answer your question about sys.path[0] though. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: 'Import sys' succeeds in C++ embedded code, but module is not fully visible

2009-01-14 Thread Ivan Illarionov
On Jan 14, 8:17 pm, Ivan Illarionov wrote: > On Jan 14, 8:00 pm, Ben Sizer wrote: > > > I will try it when I get home. However I would like to be able to > > treat them as separate dictionaries, as I want to be able to import > > some symbols and modules at a global lev

Re: v = json.loads("{'test':'test'}")

2009-01-26 Thread Ivan Illarionov
;>> yaml.load("{'test':'test'}") {'test': 'test'} >>> yaml.load("{test: test}") {'test': 'test'} If someone needs more forgiving and user-editable format, YAML might be a good choice. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Does the Python community really follow the philospy of "Community Matters?"

2009-01-30 Thread Ivan Illarionov
atred for Ruby and Perl seems to oppose natural Python forces, that's why you can't see community spirit. Let your hatred go and start flying already. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Catching Python exceptions in C

2008-12-09 Thread Ivan Illarionov
On Dec 8, 9:42 pm, Senthil Kumar <[EMAIL PROTECTED]> wrote: > Hi Pythoneers ! > Can somebody give a quick solution? > I am trying to raise exceptions in python and trying to handle it in > C. > I am able to raise exceptions successfully. However could not catch > those in C. > I am using the follow

Re: Catching Python exceptions in C

2008-12-09 Thread Ivan Illarionov
On Dec 9, 12:33 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On Dec 8, 9:42 pm, Senthil Kumar <[EMAIL PROTECTED]> wrote: > > > Hi Pythoneers ! > > Can somebody give a quick solution? > > I am trying to raise exceptions in python and trying to handle

Re: Beginner trying to understand functions.

2008-12-09 Thread Ivan Illarionov
On Dec 8, 9:02 pm, simonh <[EMAIL PROTECTED]> wrote: > Thanks for the many replies. Thanks especially to Pierre. This works > perfectly: > def getAge(): >     while True: >         try: >             age = int(input('Please enter your age: ')) >             return age > >         except ValueErr

Re: Memory leak when using a C++ module for Python

2008-12-16 Thread Ivan Illarionov
retrieved with Python/C API functions that return new references (like PyObject_GetAttrString). Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to modify a program while it's running?

2008-12-16 Thread Ivan Illarionov
On Dec 16, 11:25 pm, Joe Strout wrote: > Here's my situation: I'm making an AIM bot, but the AIM server will   > get annoyed if you log in too frequently (and then lock you out for a   > while).  So my usual build-a-little, test-a-little methodology doesn't   > work too well. > > So I'd like to re

Re: C API and memory allocation

2008-12-18 Thread Ivan Illarionov
ingObject, &pystr) ... Then you can use PyString_AS_STRING explicitly, and control ref. counts yourself. > How do you know its length to copy it into your own buffer? Use the "s#" format, as Gabriel has said. Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: C API and memory allocation

2008-12-18 Thread Ivan Illarionov
On 18 дек, 14:09, Ivan Illarionov wrote: > ... PyArg_ParseTuple(args, "O!", &PyStringObject, &pystr) ... Sorry, I must have said &PyString_Type, not &PyStringObject -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL - font kerning

2008-12-23 Thread Ivan Illarionov
een > glyphs. > > Can PIL do that or do I use another lib for that? > > Thx for any pointers & some nice xmas days to U all! > carsten No. PIL can't do that. I suggest combination of cairo/pango/pangocairo (pycairo and pygtk packages). Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL - font kerning

2008-12-23 Thread Ivan Illarionov
On Dec 23, 11:22 pm, Ivan Illarionov wrote: > On 23 дек, 16:44, carsn wrote: > > > Hey all, > > > anybody know, if there´s a way to specify the kerning of a font, when > > you draw text with PIL? > > > I´d like to achieve the same effect that you get, when yo

Re: Beep

2008-12-23 Thread Ivan Illarionov
gt; direction?  Thanks. > -- > Jeffrey Barish gnome-terminal (default terminal on Ubuntu) uses X11 bell for its beep. Try 'xset b on' to turn the beep on. See 'man xset' for more options. Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Custom C Exception Subclasses

2008-12-24 Thread Ivan Illarionov
any documentation for > it.  Does anyone know how to do this?  Thanks! When you raise an exception in C++ you can set it to ANY Python object via PyErr_SetObject and that object could store pointers to C++ classes. Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Custom C Exception Subclasses

2008-12-24 Thread Ivan Illarionov
On Dec 24, 10:43 pm, "Gabriel Genellina" wrote: > En Wed, 24 Dec 2008 15:48:34 -0200, Gabriel Genellina   > escribió: > > > En Wed, 24 Dec 2008 15:00:36 -0200, Ivan Illarionov   > > escribió: > > >> When you raise an exception in C++ you can set it to

Re: C API: array of floats/ints from python to C and back

2008-12-27 Thread Ivan Illarionov
On Dec 28, 12:45 am, "Daniel Fetchinson" wrote: > I'm trying to write an extension module in C which contains a single > function with the following prototype: > > void func( int N, int * arg1, int * arg2, int * ret ); > > Here arg1 and arg2 are length N arrays, and the function computes ret > whi

Re: More efficient array processing

2008-10-23 Thread Ivan Reborin
that would require an array of that size and that many dimensions, which couldn't be rewritten in a more efficient manner, to several smaller arrays. -- Ivan > >Thoughts on a more efficient work around? > > -- http://mail.python.org/mailman/listinfo/python-list

Re: More efficient array processing

2008-10-23 Thread Ivan Reborin
On Fri, 24 Oct 2008 00:32:11 +0200, Ivan Reborin <[EMAIL PROTECTED]> wrote: >On Thu, 23 Oct 2008 11:44:04 -0700 (PDT), "John [H2O]" ><[EMAIL PROTECTED]> wrote: > >> >>Thanks for the clarification. >> >>What is strange though, is that I hav

Re: Is there a programming language that is combination of Python and Basic?

2009-04-21 Thread Ivan Illarionov
-- This will execute your BASIC program. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Ivan Illarionov
; or "for i in range". Wikipedia agrees with me: http://en.wikipedia.org/wiki/For_loop Examples in wikipedia article use either "i" or "counter". It is established convention in almost every programming language and its origins are in mathematics (matrix indices).

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread Ivan Illarionov
fier naming convention is for the loop counter to use the variable names i, j and k (and so on if needed)" (from Wikipedia http://en.wikipedia.org/wiki/Loop_counter ) -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is using range() in for loops really Pythonic?

2008-05-12 Thread Ivan Illarionov
gt; Differentiating these use cases by appropriate naming is, IMO, worth the > effort of choosing a meaningful name. Even if the counter is not used inside the loop's body it's still in control of the whole loop and, IMO, any special discriminating and non- conventional name doe

Re: Is using range() in for loops really Pythonic?

2008-05-12 Thread Ivan Illarionov
mmy", "unused", "ignored" or "junk" can be confusing for some people and break the established conventions for counter variable names (and these conventions are reasonable and are taken from mathematics). "i" is still the best choice. And let's agree to disagree. It's clear that we have different opinions and it looks that this discussion is not going to change them. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get information of a running prog in python

2008-05-12 Thread Ivan Illarionov
perty(NET_WM_NAME, UTF8_STRING).value except AttributeError: continue if window_title.endswith('Audacious'): song = window_title.split(' - ')[:-1] if song: print song -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get information of a running prog in python

2008-05-12 Thread Ivan Illarionov
re's no requirement that the same API will > work for any other program of the same category, unless there is some > popular industry standard that most applications implement. > > In short, you'll get more helpful replies at the audacious newsgroup. > > HTH, > George George, have you read my post in this thread? What OP wants is actually possible and it's quite easy. X server is the "superprogram" that knows the names of all GUI window titles. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: usage of python

2008-05-13 Thread Ivan Illarionov
ny pointers would be appreciated > > Thanks, > Rajarshi Hi, Rajarshi, Besides the above comments, I want to highlight Django and other Python web frameworks and their ability to build simple dynamic web sites extremely fast. http://www.djangoproject.com/ -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Methods Vs Any Other Callable

2008-05-14 Thread Ivan Illarionov
def do_something(self): pass -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: addendum Re: working with images (PIL ?)

2008-05-16 Thread Ivan Illarionov
out if too much of >>it is whitespace from the dataset we're working with. I've been >>examining the Python Image Library and can not determine if it offers >>the needed functionality. Does anyone have suggestions of other image >>libraries I should be looking at it, or if PIL can do what I need? >> PIL will do this, use histogram() method of Image objects. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: writing python extensions in assembly

2008-05-16 Thread Ivan Illarionov
ake Python extensions look very promising although I haven't tried them yet. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Classmethods are evil

2008-05-16 Thread Ivan Illarionov
1. You mix instance-level and class-level functionality in one place making your code a mess. 2. They are slower than metaclass methods or plain functions. I really want to hear your opinions on the subject. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Classmethods are evil

2008-05-17 Thread Ivan Illarionov
On Sat, 17 May 2008 02:33:13 -0300, Gabriel Genellina wrote: > En Sat, 17 May 2008 01:01:50 -0300, Ivan Illarionov > <[EMAIL PROTECTED]> escribió: > >> After re-reading "Python is not Java" I finally came to conclusion that >> classmethods in Python are a

Re: morning in Python

2008-05-17 Thread Ivan Illarionov
out of their way to capture, objectify and reuse it >> (Stackless' microthreads, even moreso).  And Python seems to be >> well-noted for implementing some functional programming methodology, >> and as for passing parameters it's just as object-oriented as the rest >>

Re: morning in Python

2008-05-18 Thread Ivan Illarionov
ere. Everybody call it "Moscow" when they speak English and "Москва" when they speak Russian. Calling it "Москва" or "Moskva" in English would be simply not correct and confusing. -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: addendum Re: working with images (PIL ?)

2008-05-20 Thread Ivan Illarionov
d neighboring colors exceeds the threshold then reject the > image. I have examples where half the image appears black, but actually > varies throughout. > > Since my image is RGB I'm looping through a 768 element list. I suggest: 1. convert to greyscale 2. posterize 3. check the max(i

Re: Using Python for programming algorithms

2008-05-20 Thread Ivan Illarionov
On Mon, 19 May 2008 08:53:11 -0700, Henrique Dante de Almeida wrote: > On May 19, 6:52 am, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> Henrique Dante de Almeida a écrit : >> >> > On May 17, 7:32 pm, Vicent Giner <[EMAIL PROTECTED]> wrote: >> >> Hello. >> >> (snip) >> >> However, it is usuall

Re: Using Python for programming algorithms

2008-05-20 Thread Ivan Illarionov
On Mon, 19 May 2008 11:07:06 -0700, Vicent Giner wrote: [...] > > By the way, is it possible (and easy) to call a C function from a Python > program?? Yes. http://groups.google.com/group/comp.lang.python/msg/9d47913a265c348a -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Classmethods are evil

2008-05-20 Thread Ivan Illarionov
On Mon, 19 May 2008 13:53:31 -0700, [EMAIL PROTECTED] wrote: > On 17 mai, 11:50, Ivan Illarionov <[EMAIL PROTECTED]> wrote: >> On Sat, 17 May 2008 02:33:13 -0300, Gabriel Genellina wrote: >> > En Sat, 17 May 2008 01:01:50 -0300, Ivan Illarionov >> > <[EMAIL PRO

Re: Producing multiple items in a list comprehension

2008-05-22 Thread Ivan Illarionov
rst item as the initial > value instead of 0 when no initial value is specified. it would be a > little complex to do without putting a conditional in your main loop and > slowing it down, but it could be done. If you don't want the second parameter use reduce(): >>> reduce(operator.add, ([x, x*2] for x in xrange(4))) [0, 0, 1, 2, 2, 4, 3, 6] >>> reduce(operator.add, zip([1,2,3],[4,5,6])) (1, 4, 2, 5, 3, 6) or: >>> reduce(lambda x, y: x.extend(y) or x, ([x, x*2] for x in xrange(4))) [0, 0, 1, 2, 2, 4, 3, 6] -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: 2 different versions of python compiling files.

2008-05-23 Thread Ivan Illarionov
Python version? -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is slow

2008-05-23 Thread Ivan Illarionov
e. Pure Python has less raw speed than most compiled-to-machine-code languages, but it doesn't matter. Python can be extended easily and, most important, Python is smart. Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: can python do some kernel stuff?

2008-05-23 Thread Ivan Illarionov
f ev.type == X.KeyPress: key_code = ev.detail .... Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is slow

2008-05-24 Thread Ivan Illarionov
ww.alrond.com/en/2007/jan/25/performance-test-of-6-leading- frameworks/ PHP is the slowest. Python/Django is the fastest. 2x-35x times faster then PHP. Give us the real benchmarks or stop trolling. Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie Question: How to use a .pth file on a Macintosh

2008-05-25 Thread Ivan Illarionov
s.sysconfig import get_python_lib print get_python_lib() -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a set of lambda functions

2008-05-25 Thread Ivan Illarionov
t;>> funclist[0] == funclist[3] > False > > > Thanks in advance > > Martin Maybe make a set of code objects? func_code_set = set([f.func_code for f in funclist]) funclist = [] for fc in func_code_set: f = lambda x: x f.func_code = fc funclist.append(f) -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting a set of lambda functions

2008-05-25 Thread Ivan Illarionov
t;>> funclist[0] == funclist[3] > False > > > Thanks in advance > > Martin Maybe make a set of code objects? func_code_set = set([f.func_code for f in funclist]) funclist = [] for fc in func_code_set: f = lambda x: x f.func_code = fc funclist.append(f) -- Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: php vs python

2008-05-25 Thread Ivan Illarionov
y components for all these auth/auth, admin, comments, etc, etc, etc. Another reason is that Python and Django encourage very clean design while PHP is too often ends up in "spaghetti SQL wrapped in spaghetti PHP wrapped in spaghetti HTML". 2 man/year in PHP == 2 man/week in Python/Django. And there are Python/Django blog applications that already do almost everything (and maybe more) that WordPress does. http://byteflow.su/ is one of them (IMHO the most promising). Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: php vs python

2008-05-25 Thread Ivan Illarionov
d this influences everything written in it. Yes, it's possible to write something clean in PHP but it would require a lot more work. Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: php vs python

2008-05-25 Thread Ivan Illarionov
On Sun, 25 May 2008 17:09:43 -0400, Jerry Stuckle wrote: > Not at all. I do it every day. > > And BTW - yes, I write Python, also. But I find I can write better, > faster code in PHP. I find I can write better code in Python. Maybe it's just a matter of personal preference? > Do you write PHP

Re: php vs python

2008-05-25 Thread Ivan Illarionov
a concern. It's hard to me to write good PHP. I feel happy programming in Python and I felt very unhappy when I had to program in PHP. I'm glad that you have a different experience. Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: php vs python

2008-05-25 Thread Ivan Illarionov
Jerry Stuckle wrote: > As I've said before - good programmers can write good code in any > language. Yes, they can. But it may be harder to do for them in one language and easier in another. Ivan -- http://mail.python.org/mailman/listinfo/python-list

Re: php vs python

2008-05-25 Thread Ivan Illarionov
On Sun, 25 May 2008 20:53:28 -0400, Jerry Stuckle wrote: > Ivan Illarionov wrote: >> Jerry Stuckle wrote: >> >>> As I've said before - good programmers can write good code in any >>> language. >> >> Yes, they can. But it may be harder to do

Re: php vs python

2008-05-27 Thread Ivan Illarionov
On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: > Greetings, Ivan Illarionov. > In reply to Your message dated Monday, May 26, 2008, 04:47:00, > >>> As I've said before - good programmers can write good code in any >>> language. > >> Yes, they ca

Re: php vs python

2008-05-27 Thread Ivan Illarionov
On Wed, 28 May 2008 01:32:24 +, Ivan Illarionov wrote: > On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: > >> Greetings, Ivan Illarionov. >> In reply to Your message dated Monday, May 26, 2008, 04:47:00, >> >>>> As I've said before - go

Re: php vs python

2008-05-27 Thread Ivan Illarionov
On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: > Ivan Illarionov wrote: >> On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: >> >>> Greetings, Ivan Illarionov. >>> In reply to Your message dated Monday, May 26, 2008, 04:47:00, >>> >&g

Re: php vs python

2008-05-27 Thread Ivan Illarionov
On Tue, 27 May 2008 22:27:40 -0400, Jerry Stuckle wrote: > Ivan Illarionov wrote: >> On Tue, 27 May 2008 21:47:55 -0400, Jerry Stuckle wrote: >> >>> Ivan Illarionov wrote: >>>> On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: >>>> >>

Re: php vs python

2008-05-28 Thread Ivan Illarionov
On Wed, 28 May 2008 06:04:54 +, Tim Roberts wrote: > Ivan Illarionov <[EMAIL PROTECTED]> wrote: >>On Wed, 28 May 2008 05:10:20 +0400, AnrDaemon wrote: >>> In reply to Your message dated Monday, May 26, 2008, 04:47:00, >>> >>>>> As I've

need help with timezone conversion (unexpected side effect of time.mktime ??)

2008-06-03 Thread Ivan Velev
t gmtStamp: 1130631000.0 I have tried this on a couple of Linux machines and it was reproducible everyewhere. One of those machines has the following Python version (If needed I can provide more details) > Python 2.5 (r25:51908, Mar 26 2007, 23:34:03) Any idea what' happen

<    1   2   3   4   5   6   >