Wednesday, March 3, 2010

comp.lang.python - 7 new messages in 7 topics - digest

comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en

comp.lang.python@googlegroups.com

Today's topics:

* Need bluez/python ( PyBluez) method to access BlueZ data- Please Help! - 1
messages, 1 author
http://groups.google.com/group/comp.lang.python/t/96ccf3081b502537?hl=en
* python 2.6: how to modify a PIL image from C without copying forth and back -
1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/c456d88ea2773a7e?hl=en
* Writing an assembler in Python - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/595a2db256807e85?hl=en
* timeout restart in pexpect - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/d365ef33b790cb6d?hl=en
* nonunique string replacements - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/78e04e7fd683fd61?hl=en
* case do problem - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/d73f6f6a59d3bbfd?hl=en
* cpan for python? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/ecd51ced8d24593e?hl=en

==============================================================================
TOPIC: Need bluez/python ( PyBluez) method to access BlueZ data- Please Help!
http://groups.google.com/group/comp.lang.python/t/96ccf3081b502537?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 2 2010 10:18 pm
From: "Isaac"


Hi,

I need to access data that is handled and stored in the BlueZ file system,
but is, unfortunately, not available via the current BlueZ D-Bus API.

That is, the data I need is parsed by BlueZ, but not provided in the current
D-Bus signal.

I need a method or interface that does not rely on the D-Bus API and can
directly access the BlueZ file system to get this parsed data.

Can PyBlueZ do this? If not, any suggestions would be immensely appreciated.

Thanks!
Isaac

==============================================================================
TOPIC: python 2.6: how to modify a PIL image from C without copying forth and
back
http://groups.google.com/group/comp.lang.python/t/c456d88ea2773a7e?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 2 2010 10:34 pm
From: Tim Roberts


News123 <news123@free.fr> wrote:
>
>I created a grayscale image with PIL.
>
>Now I would like to write a C function, which reads a;most all pixels
>and will modify a few of them.
>
>My current approach is:
>- transform the image to a string()
>- create a byte array huge enough to contain the resulting image
>- call my c_function, which copies over the entire image in order
> to modify a few pixels
>How can I achieve this with the least amount of copies?

If it were me, I'd be tempted to go peek at the source code for PIL, then
pass the Image object to my C routine and poke at the innards to find the
buffer with the pixels.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

==============================================================================
TOPIC: Writing an assembler in Python
http://groups.google.com/group/comp.lang.python/t/595a2db256807e85?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 2 2010 10:52 pm
From: Gregory Ewing


> In article <Xns9D28186AF890Cfdnbgui7uhu5h8hrnuio@127.0.0.1>,
> Giorgos Tzampanakis <gt67@hw.ac.uk> wrote:
>
>>I'm implementing a CPU that will run on an FPGA. I want to have a
>>(dead) simple assembler that will generate the machine code for
>>me. I want to use Python for that. Are there any libraries that
>>can help me with the parsing of the assembly code?

I wrote a PIC assembler in Python once. I didn't bother
with any parsing libraries. I used a regular expression
to split the input into tokens, then wrote ad-hoc
parsing code in Python.

--
Greg

==============================================================================
TOPIC: timeout restart in pexpect
http://groups.google.com/group/comp.lang.python/t/d365ef33b790cb6d?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 2 2010 11:03 pm
From: Pankaj


I am using pexpect to automate some procedures.

My procedures are time cosuming, some messages coming out from that,
in failure cases it will not output anything.

So I would like to give small timeout value but when some message is
received, it should restart the timeout, similar like
"restart_timeout_upon_receive" in perl.

Is it possible in Python using pexpect ?

==============================================================================
TOPIC: nonunique string replacements
http://groups.google.com/group/comp.lang.python/t/78e04e7fd683fd61?hl=en
==============================================================================

== 1 of 1 ==
Date: Tues, Mar 2 2010 11:06 pm
From: Ben Racine


All,

Say I have a string "l" ...

l = 'PBUSH 201005 K 1. 1. 1. 1. 1. 1.'

And I want to replace the first " 1." with a "500.2" and the second " 1." with " 5.2" ...

What pythonic means would you all recommend?

Note the whitespace is equal between the existing substring and the replacement string.

Many thanks,
Ben Racine
i3enhamin@gmail.com


==============================================================================
TOPIC: case do problem
http://groups.google.com/group/comp.lang.python/t/d73f6f6a59d3bbfd?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Mar 3 2010 12:09 am
From: Andre Engels


On Tue, Mar 2, 2010 at 6:46 PM, Tracubik <affdfsdfdsfsd@b.com> wrote:

> and, generally
> speaking, the try..except block slow down the execution of the program or
> not?

Try...except tends to be slow when the exception does occur, fast when
it does not. Apart from that, if these
fraction-of-a-fraction-of-a-second gains are important to you, Python
is not the programming language for you.

In Python, it seems to be common to do optimization after rather than
during the main coding, and then only when it is necessary and only
where it matters. That is:
1. Program your solution without looking much at speed issues
2. Check if it is fast enough. If so, ready.
3. If not, see which parts of the program are being slow
4. Optimize only those parts of the program that have been identified in step 3

--
André Engels, andreengels@gmail.com

==============================================================================
TOPIC: cpan for python?
http://groups.google.com/group/comp.lang.python/t/ecd51ced8d24593e?hl=en
==============================================================================

== 1 of 1 ==
Date: Wed, Mar 3 2010 12:23 am
From: TomF


On 2010-03-02 19:59:01 -0800, Lie Ryan <lie.1296@gmail.com> said:

> On 03/03/2010 09:47 AM, TomF wrote:
>> On 2010-03-02 13:14:50 -0800, R Fritz <rfritz@u.washington.edu> said:
>>
>>> On 2010-02-28 06:31:56 -0800, ssteinerX@gmail.com said:
>>>>
>>>> On Feb 28, 2010, at 9:28 AM, Someone Something wrote:
>>>>
>>>>> Is there something like cpan for python? I like python's syntax, but
>>>>> Iuse perl because of cpan and the tremendous modules that it has. --
>>>>
>>>> Please search the mailing list archives.
>>>>
>>>> This subject has been discussed to absolute death.
>>>
>>> But somehow the question is not in the FAQ, though the answer is. See:
>>>
>>> <http://www.python.org/doc/faq/library/#how-do-i-find-a-module-or-application-to-perform-task-x>


There
>>>
>> is also a program called cpan, distributed with Perl. It is used for
>> searching, downloading, installing and testing modules from the CPAN
>> repository. It's far more extensive than setuptools. AFAIK the python
>> community has developed nothing like it.
>
> python have easy_install

easy_install is part of setuptools. As I said, nothing like cpan.

-Tom

==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en

To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate