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
> 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
>>> 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
> 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
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
> 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
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
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
> 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
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)
>
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
On Mar 18, 4:36 am, dave <[EMAIL PROTECTED]> wrote:
> Hi All. I've been formulating in my head a simple image editor. I
> actually started prototyping is some time ago in Java, but am liking
> Python more and more. My editor will be nowhere near the level of Gimp/
> Photoshop, but I do need fast pi
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
> 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
Ben Sizer wrote:
> What am I doing wrong?
What are you trying to achieve?
If you want to modify sys.path I suggest using Python/C API directly:
(boilerplate removed)
PyImport_ImportModule("sys")
PyObject_GetAttrString(sysmod_pointer, "path")
PyList_Insert(pathobj_pointer, 0, path_python_str)
--
On Jan 14, 1:49 pm, Ben Sizer wrote:
> No, I don't want to do anything with sys.path apart from see it. I
> just wanted my original question answered, not a guess at my intent
> and a solution for something I'm not doing. ;) Thanks though!
>
> Again - why can I not reference sys from within the f
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 level, but be able to clear out
> objects introduced at the local level on a periodi
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
Diez wrote:
> gert schrieb:
> > Single quotes works in every browser that support json so i
> > recommended python should support it too, besides it looks much
> > cleaner
> > {'test': 'test'}
> > {"test": "test"}
>
> > It can not be that hard to support both notation can it ?
>
> It's not hard, bu
r wrote:
> Where are the community projects supporting Python? -- besides the
> core devlopment. Seem s that nobody is interested unless their pay-pal
> account is involved. I find this all quite disappointing.
Hi r,
Can you just type
import antigravity
and join us up there?
Hatred for Ruby
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
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
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
On Dec 11, 8:35 pm, Jaume Bonet wrote:
> //Here we take the info coming from python and transform it
> into a vector (will allow us to work with numbers instead of
> // strings) and shareInt which is an array of sets (form
> std::set)
> vector translator = string2int
> (sh
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
On 18 дек, 03:51, Aaron Brady wrote:
(snip)
> How did you get a reference to the original
> string object, with which to increment its reference count?
Use the "O!" format instead of "s":
PyObject *pystr;
... PyArg_ParseTuple(args, "O!", &PyStringObject, &pystr) ...
Then you can use PyString_AS
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
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 you set a
> negative kerning in Gimp/Photshop - ie. reduce the spacing between
> glyphs.
>
> Can
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
On Dec 22, 3:16 am, Jeffrey Barish wrote:
> I use sys.stdout.write('\a') to beep. It works fine on Kubuntu, but not on
> two other platforms (one of which is Ubuntu). I presume that the problem
> is due to a system configuration issue. Can someone point me in the right
> direction? Thanks.
> -
On Dec 24, 6:42 pm, Ross wrote:
> For a project that I am doing, it would be useful to have an exception
> class that stores some additional data along with the message.
> However, I want to be able to store a couple pointers to C++ classes,
> so I can't just use an exception created with PyExc_Ne
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
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
On Apr 18, 3:39 pm, BJörn Lindqvist wrote:
> I first started programming basic and i don't think it has hurt me much.
>
> I can somewhat sympathise with the op, neither python nor any other
> mainstream language can still do this:
>
> SCREEN 13
> PSET 160,100,255
This is not true. It's trivial wi
On Sun, 11 May 2008 18:52:48 -0700, Carl Banks wrote:
> On May 11, 6:44 pm, Ben Finney <[EMAIL PROTECTED]>
> wrote:
>> In such cases, the name 'dummy' is conventionally bound to the items
>> from the iterator, for clarity of purpose::
>>
>> for dummy in range(10):
>> # do stuff that ma
>> In such cases, the name 'dummy' is conventionally bound to the items
>> from the iterator, for clarity of purpose
[..]
> If a value isn't used, then I think the most clear name for it is
> "unused".
[...]
Maybe my brain works differently, but I find both "dummy" and "unused"
are extremely conf
On Mon, 12 May 2008 16:24:23 +1000, Ben Finney wrote:
[...]
> That is also regrettably common in Python code. It still suffers from
> being unnecessarily ambiguous, since there are *also* plenty of loops
> using 'i', 'j', etc. where the loop counter *is* used.
>
> Differentiating these use cases b
>> On Mon, 12 May 2008 16:24:23 +1000, Ben Finney wrote: [...]
>> > That is also regrettably common in Python code. It still suffers from
>> > being unnecessarily ambiguous, since there are *also* plenty of loops
>> > using 'i', 'j', etc. where the loop counter *is* used.
>> >
>> > Differentiating
On Mon, 12 May 2008 19:19:05 -0700, Jimmy wrote:
> Well, i know it may be a little non-python thing, however, I can think
> of no place better to post this question :)
>
> can anyone tell me, in python, how to obtain some information of a
> running program?
> paticularly, if i am playing some mus
On Mon, 12 May 2008 20:29:46 -0700, George Sakkis wrote:
> On May 12, 11:02 pm, Jimmy <[EMAIL PROTECTED]> wrote:
>> On May 13, 10:36 am, "Dan Upton" <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> > On Mon, May 12, 2008 at 10:19 PM, Jimmy <[EMAIL PROTECTED]>
>> > wrote:
>> > > Well, i know it may be a litt
On 13 май, 21:10, Rajarshi <[EMAIL PROTECTED]> wrote:
> Hi, I teach an introductory programming course in Python. As part of
> the introduction I'd like to highlight the usage of Python in
> industry. The idea is to show that there are big players using Python
> for a variety of tasks. Given that t
On Wed, 14 May 2008 09:21:10 -0700, vbgunz wrote:
> [...]
> when you see
> one, what is the first thing that comes to mind? When you write one,
> what was the first thing on your mind? Other than "similar to static-
> methods", at what point will you be glad you used one? To sum it up,
> what is t
On Wed, 14 May 2008 14:35:25 -0400, Poppy wrote:
> I've put together some code to demonstrate what my goal is though
> looping pixel by pixel it's rather slow.
>
> import Image
>
> def check_whitespace():
> im = Image.open("server\\vol\\temp\\image.jpg")
>
> size = im.size
>
>
On Fri, 16 May 2008 10:13:04 -0400, inhahe wrote:
> Can anyone give me pointers/instructions/a template for writing a Python
> extension in assembly (or better, HLA)?
Look up pygame sources. They have some hot inline MMX stuff.
I experimented with this rescently and I must admit that it's etremel
After re-reading "Python is not Java" I finally came to conclusion that
classmethods in Python are a very Bad Thing.
I can't see any use-case of them that couldn't be re-written more clearly
with methods of metaclass or plain functions.
They have the following issues:
1. You mix instance-level
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
On Sat, 17 May 2008 02:57:08 -0700, castironpi wrote:
> Full day later, I think it, to emphasize state, would prioritize
> context. The reason for the huge ramble was, believe it or not,
> namespace conflict... as though any other states around here might nose
> in. And thanks to 'inhahe' for co
On Sun, 18 May 2008 11:15:06 +0200, Martin v. Löwis wrote:
> There is also the issue of aliases. Some call it Moscow, some Moskau,
> when it is really called Москва. Of course, the same issue exists for
> states: some call it Kalifornien, others California.
I don't see any issues here. Everybody
On Mon, 19 May 2008 10:18:00 -0400, Poppy wrote:
> Thanks, since posting I figured out how to interpret the histogram
> results, which seems to be the consensus in responses. I wrote a check
> image program and have been periodically calling it against a folder
> where I make a copy of our images
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
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
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
On Thu, 22 May 2008 15:29:42 -0400, inhahe wrote:
> "Joel Koltner" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Is there an easy way to get a list comprehension to produce a flat list
>> of, say, [x,2*x] for each input argument?
>>
>> E.g., I'd like to do something like:
>>
>>
> The original .py will always be there but you know what, multiple python
> versions from different computers do access that one library at the same
> time.
>
> Anyone know a possible solution ?
What about subversion or mercurial and separate copies of your library
for each Python version?
--
On 23 май, 02:20, Brad <[EMAIL PROTECTED]> wrote:
> cm_gui wrote:
> > Python is slow.
>
> It ain't C++, but it ain't a punch card either... somewhere in between.
> I find it suitable for lots of stuff. I use C++ when performance really
> matters tho... right tool for the job. Learn a good interp
On 23 май, 22:32, Jimmy <[EMAIL PROTECTED]> wrote:
[...]
> however, how can I just simply know a key is pressed?
If you are on Linux, use XLib
http://python-xlib.sourceforge.net/
You need to catch the KeyPress or KeyRelease X events.
while 1:
ev = display.next_event()
if ev.type == X.KeyP
On Fri, 23 May 2008 22:56:57 -0700, cm_gui wrote:
> i am not comparing Python with C or C++ which are of course compiled
> languages.
>
> if there is any consolation to Python lovers here, Python is still
> faster than Microsoft ASP/ASPX.
>
> i'm not trying to 'troll' here. it's not just me. m
Robbie wrote:
> I can't seem to figure out where to put this file so that Python will
> recognize it when I start it up.
You need to put this file in your site-packages directory.
To get the location of your site-packages directory, type in Python
interactive shell:
from distutils.sysconfig impo
On Sun, 25 May 2008 13:43:15 +0200, Martin Manns wrote:
> Hi,
>
> I try to get a set of lambda functions that allows me executing each
> function code exactly once. Therefore, I would like to modify the set
> function to compare the func_code properties (or the lambda functions to
> use this prop
On Sun, 25 May 2008 13:43:15 +0200, Martin Manns wrote:
> Hi,
>
> I try to get a set of lambda functions that allows me executing each
> function code exactly once. Therefore, I would like to modify the set
> function to compare the func_code properties (or the lambda functions to
> use this prop
Jerry Stuckle wrote:
> Lie wrote:
> > On May 22, 12:28 pm, NC <[EMAIL PROTECTED]> wrote:
> >> On May 21, 1:10 pm, notbob <[EMAIL PROTECTED]> wrote:
> >>> So, here's my delimna: I want to start a blog. Yeah, who doesn't.
> >>> Yet, I want learn the guts of it instead of just booting up some
> >>> w
On Sun, 25 May 2008 13:28:25 -0700, NC wrote:
[...]
> A quick look at the revision log:
>
> http://byteflow.su/log/
>
> reveals that the initial commit of 60 or so files has been done on
> 08/14/07
> (10 months ago), a second developer came on board 12/01/07 (seven+
> months ago),
> a third one,
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
On Sun, 25 May 2008 16:23:12 -0700, NC wrote:
>> I didn't say that it's not possible to write good code in PHP,
>
> Indeed you didn't. You did, however, say that development in Python/
> Django is inherently faster than development in PHP (your exact words
> were, "2 man/year in PHP == 2 man/wee
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
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
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
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
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
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:
>>>>
>>
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
On Wed, 04 Jun 2008 00:25:19 -0700, Jesse Aldridge wrote:
> I've got a module that I use regularly. I want to make some extensive
> changes to this module but I want all of the programs that depend on the
> module to keep working while I'm making my changes. What's the best way
> to accomplish t
On Mon, 02 Jun 2008 00:32:33 -0700, gianluca wrote:
> Hy, I've a problem with may python library generated with swig from C
> code. I works and I can access all function but a simèple function that
> print a string don't work's.
> The function is like this:
> int PrintTEST()
> {
> printf("TE
On Wed, 04 Jun 2008 05:57:20 -0700, spectrumdt wrote:
> Hello.
>
> I am trying to extend Python with some C code. I made a trivial
> "Hello World" program in C that I am trying to wrap in "boilerplate" for
> inclusion in a Python program. But I can't compile the C code. The C
> compiler cannot
On Wed, 04 Jun 2008 14:10:51 +, Ivan Illarionov wrote:
> On Mon, 02 Jun 2008 00:32:33 -0700, gianluca wrote:
>
>> Hy, I've a problem with may python library generated with swig from C
>> code. I works and I can access all function but a simèple function
>> tha
On Wed, 04 Jun 2008 09:41:07 -0500, Grant Edwards wrote:
>>> The answer is yes. IPC and py-pf are examples. If you don't think of
>>> packet filtering as kernel coding, I can understand. But clearly the
>>> Python interfaces to fork(), waitpid(), signal(), alarm() and so forth
>>> are forays int
On Wed, 04 Jun 2008 09:12:18 -0700, spectrumdt wrote:
> Hello.
>
> I am trying to extend my Python program with some C code.
>
> This thread is sort of a follow-up to another thread of mine, linked
> below. I don't know what the conventions are in this newsgroup about
> creating new threads
On Wed, 04 Jun 2008 09:12:18 -0700, spectrumdt wrote:
> Hello.
>
> I am trying to extend my Python program with some C code.
>
> This thread is sort of a follow-up to another thread of mine, linked
> below. I don't know what the conventions are in this newsgroup about
> creating new threads
On Wed, 04 Jun 2008 09:12:18 -0700, spectrumdt wrote:
> Hello.
>
> I am trying to extend my Python program with some C code.
>
> This thread is sort of a follow-up to another thread of mine, linked
> below. I don't know what the conventions are in this newsgroup about
> creating new threads
On Wed, 04 Jun 2008 11:24:11 -0500, Grant Edwards wrote:
>> I can't understand why somebody might want to do kernel stuff in
>> Python.
>
> we choose to put Python in kernel-space and do the other things, not
> because they are easy, but because they are hard, because that goal
> will
On 5 июн, 01:57, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi Everyone,
>
> i have another question. What if i wanted to make n tuples, each with
> a list of coordinates. For example :
>
> coords = list()
> for h in xrange(1,11,1):
>for i in xrange(1, 5, 1) :
> for j in xrange(1, 5
On 5 июн, 18:19, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Jun 5, 3:49 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 5 ÉÀÎ, 01:57, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hi Ev
On 5 июн, 18:19, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Jun 5, 3:49 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 5 ÉÀÎ, 01:57, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hi Ev
On 5 июн, 18:56, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> On 5 июн, 18:19, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > On Jun 5, 3:49 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
>
> > > On 5 ÉÀÎ, 01:57, &quo
On 5 июн, 19:38, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Jun 5, 11:21 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 5 июн, 18:56, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
>
> > > On 5 июн, 18:19, "[EMAIL PROTECTED]" &l
On 5 июн, 21:22, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Jun 5, 11:48 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 5 июн, 19:38, George Sakkis <[EMAIL PROTECTED]> wrote:
>
> > > On Jun 5, 11:21 am, Ivan Illarionov <[EMAIL
On Thu, 05 Jun 2008 07:10:56 +, Tim Roberts wrote:
> Thomas Guettler <[EMAIL PROTECTED]> wrote:
>>
>>I tried PIL for image batch processing. But somehow I don't like it
>> - Font-Selection: You need to give the name of the font file. -
>> Drawing on an image needs a different object that pas
On Wed, 11 Jun 2008 01:05:45 +, asdf wrote:
>> Well, there's a few ways you could approach it.
>>
>> You could create a cgi program from your script - this is probably the
>> solution you're looking for.
>>
>>
> Output from the script does come up very often. There is a new output
> every 1
On 20 июн, 11:31, Duncan Booth <[EMAIL PROTECTED]> wrote:
> Terry Reedy <[EMAIL PROTECTED]> wrote:
> >> [['Fizz', 'Buzz', 'FizzBuzz', str(i)][62/(pow(i, 4, 15) + 1)%4] for i
> >> in xrange(1, 101)]
>
> > These make the lookup table variable, so it has to be recalculated for
> > each i.
>
> So what?
On Apr 10, 9:57 am, Paul Anton Letnes <[EMAIL PROTECTED]>
wrote:
[...]
> , but as I mentioned, it seems to be a bit complicated to wrap heavy
> data structures like arrays.
Hello,
I suggest that you might take a look at how other people solved the
same problems. The great example is path.c insi
On Apr 10, 9:22 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I have an array, and I would like to get the indice value.
>
> a = array([13,14,15,16])
>
> I would like something like a.getindice(15)
>
> If I want 15 it would return 2
>>> a = array('i', [13,14,15,16])
>>> a.index(15)
2
--
ht
On Apr 10, 2:33 am, Jose <[EMAIL PROTECTED]> wrote:
> I have a module named math.py in a package with some class
> definitions. I am trying to import the standard python math module
> inside of math.py but It seems to be importing itself. Is there any
> way around this problem without renaming my
On Apr 11, 12:31 am, Ivan Illarionov <[EMAIL PROTECTED]>
wrote:
> On Apr 10, 2:33 am, Jose <[EMAIL PROTECTED]> wrote:
>
> > I have a module named math.py in a package with some class
> > definitions. I am trying to import the standard python math module
> >
On Apr 11, 2:14 pm, bdsatish <[EMAIL PROTECTED]> wrote:
> The built-in function round( ) will always "round up", that is 1.5 is
> rounded to 2.0 and 2.5 is rounded to 3.0.
>
> If I want to round to the nearest even, that is
>
> my_round(1.5) = 2# As expected
> my_round(2.5) = 2# Not
On Apr 11, 5:49 pm, hdante <[EMAIL PROTECTED]> wrote:
> On Apr 11, 9:45 am, bdsatish <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Apr 11, 5:33 pm, bdsatish <[EMAIL PROTECTED]> wrote:
>
> > > HI Gerard,
>
> > > I think you've taken it to the best possible implementation. Thanks !
> > > On Apr 11, 5:14 pm
itialized to NULs, because only 3 bytes
> # are filled but 6 bytes are written.
> os.write(_fd, buf)
> buf_ret = os.read(_fd, 6)
>
> --
> Gabriel Genellina
The easiest way is to use struct:
START = 0x33
RETURN_START = 0x22
ADDR = 0x01
WRITE_CMD = 0x03
ALL_CMD = 0xFF
buf = struct.pack('3b3x', START, ADDR, WRITE_CMD)
os.write(_fd, buf)
buf_ret = os.read(_fd, 6)
And, definitely, no need for ctypes here.
--
Ivan Illarionov
--
http://mail.python.org/mailman/listinfo/python-list
27;s string inside function definition, and exec it.
You might want to disable words like `import`, `exec` and `eval` in
user's code because it's a big security risk.
--
Ivan Illarionov
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 19, 2:17 pm, "BJörn Lindqvist" <[EMAIL PROTECTED]> wrote:
> On Mon, Mar 17, 2008 at 11:57 PM, Arnaud Delobelle
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > > def make_slope(distance, parts):
> > > step = distance / float(parts)
> > > intstep = int(step)
> > > floatstep = step - int
On Apr 13, 8:20 pm, Bryan Oakley <[EMAIL PROTECTED]> wrote:
> Ivan Illarionov wrote:
> > You don't need to envoke another interpreter.
> > Python can interpret arbitrary python code with exec statement.
> > Wrap user's string inside function definition, and exe
On 15 апр, 07:46, Brian Vanderburg II <[EMAIL PROTECTED]>
wrote:
[...]
> C has the advantage that it does not to anything behind your back. This
> is very useful especially for any form of system development or where
> you must know exactly what is going on. It is still possible to do
> 'object o
1 - 100 of 143 matches
Mail list logo