comp.lang.python - 25 new messages in 16 topics - digest
comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en
comp.lang.python@googlegroups.com
Today's topics:
* Python bindings tutorial - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/73dcf6c0b97465aa?hl=en
* subtraction is giving me a syntax error - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/f8017a980f728348?hl=en
* import antigravity - 4 messages, 4 authors
http://groups.google.com/group/comp.lang.python/t/131eab9e2bf84b60?hl=en
* datetime string conversion error - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/2944ba75fca9d570?hl=en
* Understanding the CPython dict implementation - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/150fc14dec65224b?hl=en
* to pass self or not to pass self - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/02e5000548314c86?hl=en
* Discount Wholesale Christian Audigier Jeans ( www.globlepurchase.com) - 1
messages, 1 author
http://groups.google.com/group/comp.lang.python/t/b97c13886122a7b4?hl=en
* C-API PyObject_Call - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/03c70fd75579881f?hl=en
* Searching for most pythonic/least stupid way to do something simple - 1
messages, 1 author
http://groups.google.com/group/comp.lang.python/t/428d06aafb5d0184?hl=en
* The first ASIC designed with MyHDL - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/5133fcd9c1a3b486?hl=en
* passing a socket to a subprocess in windows - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/54d432395cc76fa1?hl=en
* class inheritance - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/2512697a901d4752?hl=en
* Function that knows its argument's variable name - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/ed0c23c18ff2f584?hl=en
* highlight words by regex in pdf files using python - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/1a79df5ddb92fac5?hl=en
* Conditional based on whether or not a module is being used - 2 messages, 1
author
http://groups.google.com/group/comp.lang.python/t/ee22c223fa73a429?hl=en
* cycling through options - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/ca679f42c8db1572?hl=en
==============================================================================
TOPIC: Python bindings tutorial
http://groups.google.com/group/comp.lang.python/t/73dcf6c0b97465aa?hl=en
==============================================================================
== 1 of 2 ==
Date: Tues, Mar 16 2010 12:12 pm
From: "Gabriel Genellina"
En Tue, 16 Mar 2010 13:20:40 -0300, Johny <python@hope.cz> escribió:
> Is there any tutorial how to write a bindings for a exe ( dos)
> program?
> I would like to run it from a Python directly
> ( using import command and a particular function from the binding)
> not using os.system command.
Do you mean that you want to execute a particular function in the .exe
program?
That's not possible (ok, you *could* do that if you work hard enough, but
that's not how things are usually done)
--
Gabriel Genellina
== 2 of 2 ==
Date: Tues, Mar 16 2010 1:10 pm
From: Terry Reedy
On 3/16/2010 3:12 PM, Gabriel Genellina wrote:
> En Tue, 16 Mar 2010 13:20:40 -0300, Johny <python@hope.cz> escribió:
>
>> Is there any tutorial how to write a bindings for a exe ( dos)
>> program?
>> I would like to run it from a Python directly
>> ( using import command and a particular function from the binding)
>> not using os.system command.
>
> Do you mean that you want to execute a particular function in the .exe
> program?
> That's not possible (ok, you *could* do that if you work hard enough,
> but that's not how things are usually done)
If running a function within the .exe *is* what you want, then you
should compile to .dll instead of .exe and use swig or ctypes to do the
binding.
==============================================================================
TOPIC: subtraction is giving me a syntax error
http://groups.google.com/group/comp.lang.python/t/f8017a980f728348?hl=en
==============================================================================
== 1 of 2 ==
Date: Tues, Mar 16 2010 12:17 pm
From: Vito 'ZeD' De Tullio
Grant Edwards wrote:
>> As for not being able to see the difference between a hyphen and an
>> EN- dash, or minus sign, or whatever it is, yes but they are very
>> similar looking glyphs in virtually ever modern font. It would take a
>> good eye to see the difference between (say) ??? ??? and -.
>
> My point is that if it's an ASCII file,
source files aren't (necessary) ASCII files
--
By ZeD
== 2 of 2 ==
Date: Tues, Mar 16 2010 1:12 pm
From: Grant Edwards
On 2010-03-16, Vito 'ZeD' De Tullio <zak.mc.kraken@libero.it> wrote:
> Grant Edwards wrote:
>
>>> As for not being able to see the difference between a hyphen and an
>>> EN- dash, or minus sign, or whatever it is, yes but they are very
>>> similar looking glyphs in virtually ever modern font. It would take a
>>> good eye to see the difference between (say) ??? ??? and -.
>>
>> My point is that if it's an ASCII file,
>
> source files aren't (necessary) ASCII files
OK, if it's a file with encoding <whatever>, then characters that
aren't part of <whatever> shouldn't be rendered according so some
other arbitrary character set. Illegal characters should be flagged
and displayed in a manner that makes it obvious you have illegal
characters in in the file.
If the OP was using a source file with an encoding that isn't accepted
by Python, then he needs to pick a source file encoding that is
recognized by Python.
Using a source file encoding where there are semantically _different_
characters that render identically is just asking for pain...
--
Grant Edwards grant.b.edwards Yow! I guess you guys got
at BIG MUSCLES from doing too
gmail.com much STUDYING!
==============================================================================
TOPIC: import antigravity
http://groups.google.com/group/comp.lang.python/t/131eab9e2bf84b60?hl=en
==============================================================================
== 1 of 4 ==
Date: Tues, Mar 16 2010 12:30 pm
From: Hans Mulder
Ulrich Eckhardt wrote:
> Chris Rebert wrote:
>> You're a bit behind the times.
>> If my calculations are right, that comic is over 2 years old.
>
> import timetravel
I think you mean:
from __future__ import timetravel
-- HansM
== 2 of 4 ==
Date: Tues, Mar 16 2010 12:44 pm
From: "Martin P. Hellwig"
On 03/16/10 19:30, Hans Mulder wrote:
> Ulrich Eckhardt wrote:
>> Chris Rebert wrote:
>>> You're a bit behind the times.
>>> If my calculations are right, that comic is over 2 years old.
>>
>> import timetravel
>
> I think you mean:
>
> from __future__ import timetravel
>
>
> -- HansM
Well according to Marty it is:
from __back_to_the_future import DeLorean
--
mph
== 3 of 4 ==
Date: Tues, Mar 16 2010 1:44 pm
From: Mark Lawrence
Hans Mulder wrote:
> Ulrich Eckhardt wrote:
>> Chris Rebert wrote:
>>> You're a bit behind the times.
>>> If my calculations are right, that comic is over 2 years old.
>>
>> import timetravel
>
> I think you mean:
>
> from __future__ import timetravel
>
>
> -- HansM
Taking 1984 into account surely it should be
from __past__ import __future__ as future
But the question is, have we yet got to 1984, are we currently there or
have we already gone past it? Who actually *IS* running the time
machine? Are there any bugs??
Regards.
Mark Lawrence.
== 4 of 4 ==
Date: Tues, Mar 16 2010 4:48 pm
From: Michael Rudolf
Am 16.03.2010 21:44, schrieb Mark Lawrence:
> Who actually *IS* running the time machine? Are there any bugs??
My is. And as I'm a lazy hacker: sure. there are bugs. lets just call
them features and move on. nothing to see here ;)
==============================================================================
TOPIC: datetime string conversion error
http://groups.google.com/group/comp.lang.python/t/2944ba75fca9d570?hl=en
==============================================================================
== 1 of 2 ==
Date: Tues, Mar 16 2010 12:53 pm
From: MRAB
Jordan Apgar wrote:
> Hey all,
> I'm trying to convert a string to a date time object and all my fields
> convert except for month which seems to default to january.
>
> here's what I'm doing:
> date = "2010-03-16 14:46:38.409137"
> olddate = datetime.strptime(date,"%Y-%m-%j %H:%M:%S.%f")
>
> print date
> print olddate
>
> I get:
> 2010-03-16 14:46:38.409137
> 2010-01-16 14:46:38.409137
>
> notice the 01 in the second date from what I could tell everything is
> formatted correctly.
>
The problem seems to be related to your use of "%j", which parses the
day of the year.
If I use "%d" instead, which parses the day of the month (I think that's
what you intended!), then the month comes out as 3 as expected.
== 2 of 2 ==
Date: Tues, Mar 16 2010 4:31 pm
From: Josh English
On Mar 16, 11:56 am, Jordan Apgar <twistedphr...@gmail.com> wrote:
> here's what I'm doing:
> date = "2010-03-16 14:46:38.409137"
> olddate = datetime.strptime(date,"%Y-%m-%j %H:%M:%S.%f")
>
Due to circumstances, I'm using Python 2.5.4 on one machine (2.6 on
the other).
When I have a script as simple as this:
import datetime
datetime.datetime.strptime('2010-09-14', "%Y-%m-%d")
Running this script brings up a calendar, believe it or not. The
calendar displays March 2010, and shows the 22nd as a holiday. When I
dismiss the dialog box I get:
Traceback (most recent call last):
File "strptimetest.py", line 3, in <module>
datetime.datetime.strptime('2010-09-14', "%Y-%m-%d")
File "C:\Python25\lib\_strptime.py", line 272, in <module>
_TimeRE_cache = TimeRE()
File "C:\Python25\lib\_strptime.py", line 191, in __init__
self.locale_time = LocaleTime()
File "C:\Python25\lib\_strptime.py", line 74, in __init__
self.__calc_weekday()
File "C:\Python25\lib\_strptime.py", line 94, in __calc_weekday
a_weekday = [calendar.day_abbr[i].lower() for i in range(7)]
AttributeError: 'module' object has no attribute 'day_abbr'
err... what? Is this an old weirdness I don't remember from the 2.5
series?
I can select dates in the calendar, but nothing dismisses it but the
close box.
Josh English
Incredibly Confused
==============================================================================
TOPIC: Understanding the CPython dict implementation
http://groups.google.com/group/comp.lang.python/t/150fc14dec65224b?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 16 2010 1:04 pm
From: Terry Reedy
On 3/16/2010 7:46 AM, Steven D'Aprano wrote:
> On Sun, 14 Mar 2010 19:39:46 -0400, Terry Reedy wrote:
>
>> I found this PyCon2010 presentation to be excellent: The Mighty
>> Dictionary, Branden Craig Rhodes, 30 min.
Sorry,
http://pycon.blip.tv/file/3332763/
which plays fine in FF3.6 on windows
>> http://pycon.blip.tv/file/3264041/
wrong file number
> Unfortunately, that clip seems to be unwatchable, at least for me. It
> crashed the Netscape plugin in Konqueror, and crashed Firefox.
The flash version does not work for me. This is true of about 1/3 of the
Pycon 2010 videos that I have tried. The .ogv version of this and all
others that I have tried (hit Download under Comments) plays fine within
FF3.6 on my windows xp machine. Perhaps there is a linux-specific bug,
if that is what you are running under.
Terry Jan Reedy
==============================================================================
TOPIC: to pass self or not to pass self
http://groups.google.com/group/comp.lang.python/t/02e5000548314c86?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 16 2010 1:15 pm
From: Jonathan Gardner
On Tue, Mar 16, 2010 at 2:04 AM, Bruno Desthuilliers
<bruno.42.desthuilliers@websiteburo.invalid> wrote:
> lallous a écrit :
>>
>> What is the difference between the reference in 'F' and 'func_tbl' ?
>
> Answer here:
>
> http://wiki.python.org/moin/FromFunctionToMethod
>
Among all the things in the Python language proper, this is probably
the most confusing thing for new programmers. Heck, even experienced
programmers get tangled up because they project how they think things
should work on to the Python model.
The second most confusing thing is probably how objects get instantiated.
--
Jonathan Gardner
jgardner@jonathangardner.net
==============================================================================
TOPIC: Discount Wholesale Christian Audigier Jeans ( www.globlepurchase.com)
http://groups.google.com/group/comp.lang.python/t/b97c13886122a7b4?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 16 2010 1:17 pm
From: brandmarket
Discount Wholesale Affliction Jeans <free shipping paypal payment>
Discount Wholesale AK Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale Armani Jeans
Discount Wholesale Artful Dodger Jeans <free shipping paypal payment>
Discount Wholesale BAPE Jeans
Discount Wholesale BBC Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale Black Label Jeans
Discount Wholesale Cavalli Jeans
Discount Wholesale Christian Audigier Jeans
Discount Wholesale Coogi Jeans
Discount Wholesale Crown Holder Jeans ( http://www.globlepurchase.com/
)
Discount Wholesale D&G Jeans
Discount Wholesale Diesel Jeans
Discount Wholesale ECKO Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale ED Hardy Jeans
Discount Wholesale Evisu Jeans
Discount Wholesale G-STAR Jeans <free shipping paypal payment>
Discount Wholesale GUCCI Jeans
Discount Wholesale Iceberg Jeans
Discount Wholesale Kanji Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale Laguna Beach Jeans
Discount Wholesale Levi s Jeans
Discount Wholesale LRG Jeans <free shipping paypal payment>
Discount Wholesale LV Jeans
Discount Wholesale Prada Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale RMC Jeans
Discount Wholesale Roca Wear Jeans <free shipping paypal payment>
Discount Wholesale Rock&Republic Jeans
Discount Wholesale True Religion Jeans <free shipping paypal payment>
Discount Wholesale Versace Jeans
Discount Wholesale ZEN Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale Affliction Jeans <free shipping paypal payment>
Discount Wholesale AK Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale Armani Jeans
Discount Wholesale Artful Dodger Jeans <free shipping paypal payment>
Discount Wholesale BAPE Jeans
Discount Wholesale BBC Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale Black Label Jeans
Discount Wholesale Cavalli Jeans
Discount Wholesale Christian Audigier Jeans
Discount Wholesale Coogi Jeans
Discount Wholesale Crown Holder Jeans ( http://www.globlepurchase.com/
)
Discount Wholesale D&G Jeans
Discount Wholesale Diesel Jeans
Discount Wholesale ECKO Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale ED Hardy Jeans
Discount Wholesale Evisu Jeans
Discount Wholesale G-STAR Jeans <free shipping paypal payment>
Discount Wholesale GUCCI Jeans
Discount Wholesale Iceberg Jeans
Discount Wholesale Kanji Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale Laguna Beach Jeans
Discount Wholesale Levi s Jeans
Discount Wholesale LRG Jeans <free shipping paypal payment>
Discount Wholesale LV Jeans
Discount Wholesale Prada Jeans ( http://www.globlepurchase.com/ )
Discount Wholesale RMC Jeans
Discount Wholesale Roca Wear Jeans <free shipping paypal payment>
Discount Wholesale Rock&Republic Jeans
Discount Wholesale True Religion Jeans <free shipping paypal payment>
Discount Wholesale Versace Jeans
Discount Wholesale ZEN Jeans ( http://www.globlepurchase.com/ )
==============================================================================
TOPIC: C-API PyObject_Call
http://groups.google.com/group/comp.lang.python/t/03c70fd75579881f?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 16 2010 1:16 pm
From: Carl Banks
On Mar 16, 11:25 am, moerchendiser2k3 <googler.
1.webmas...@spamgourmet.com> wrote:
> Hi, currently I am not at home, I will post some stuff when I am back.
> Just the note: I throw an exception with the C API.
>
> Looks like that
>
> PyObject *result = PyObject_Call(my_isntance, "", NULL);
> if(result==NULL)
> {
> PyErr_Print(); //when this happens, the traceback is correct with
> information about the file/line
> return;
>
> }
>
> if(!PyXYZ_Check(result))
> {
> PyErr_SetString(PyExc_TypeError, "Wrong type, ....");
> PyErr_Print(); //missing information of the file/line.
> return;
> }
>
> Well, I expect, that there are no information about the line/file, so
> I know something is missing, but what is missing?
Python tracebacks only contain line/file information about Python
files, not C files. Here you raise an exception with a C statement,
and catch and print it in the very next line. The exception doesn't
exit from Python code so there are no lines to print.
What line/file data you do expect to see?
If you want to see C line/file informnation you have to use a debugger
like gdb, as Steve Holden said.
Carl Banks
==============================================================================
TOPIC: Searching for most pythonic/least stupid way to do something simple
http://groups.google.com/group/comp.lang.python/t/428d06aafb5d0184?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 16 2010 1:27 pm
From: david jensen
>If Gerard's code works, I would consider it far superior to your code
>here. Pythonic does not necessarily mean short and ugly
yes, I agree... and in my script i'm using something very like
Gerard's (thanks again, Gerard). I just posted the corrected version
of nn's because the original solved only half the problem.
thanks, all
dmj
==============================================================================
TOPIC: The first ASIC designed with MyHDL
http://groups.google.com/group/comp.lang.python/t/5133fcd9c1a3b486?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 16 2010 1:37 pm
From: aahz@pythoncraft.com (Aahz)
In article <4b9f7414$0$2887$ba620e4c@news.skynet.be>,
Jan Decaluwe <jan@jandecaluwe.com> wrote:
>
>I am proud to report on the first ASIC product designed with MyHDL
>(afaik).
>
>http://www.jandecaluwe.com/hdldesign/digmac.html
Congrats!
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/
"Many customs in this life persist because they ease friction and promote
productivity as a result of universal agreement, and whether they are
precisely the optimal choices is much less important." --Henry Spencer
==============================================================================
TOPIC: passing a socket to a subprocess in windows
http://groups.google.com/group/comp.lang.python/t/54d432395cc76fa1?hl=en
==============================================================================
== 1 of 1 ==
Date: Tues, Mar 16 2010 3:39 pm
From: "Gabriel Genellina"
En Tue, 16 Mar 2010 14:10:16 -0300, Daniel Platz
<mail.to.daniel.platz@googlemail.com> escribi�:
> I have a problem with passing a socket to a subprocess in windows. It
> works in Linux and for windows there is a workaround in the Python
> doc. However, this workaround does not work. It was already noted by
> other people and they Python issue tracker
>
> http://bugs.python.org/issue5879
Unfortunately I cannot test it at this moment, but around line 360 in
socketmodule.c:
#if defined(MS_WINDOWS) || defined(__BEOS__)
...
#define NO_DUP /* Actually it exists on NT 3.5, but what the heck... */
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home