On Oct 20, 8:35 am, Michael Torrie wrote:
> On 10/19/2012 06:43 PM, Mark Lawrence wrote:
>
> > Good morning/afternoon/evening all,
>
> > Is there any possibility that we could find a way to prevent the double
> > spaced rubbish that comes from G$ infiltrating this ng/ml? For example,
> > does Pyt
On Oct 20, 8:27 am, Tim Chase wrote:
> On 10/19/12 17:14, Steven D'Aprano wrote:
>
> > Code never *needs* to be long, because it can always be shortened.
>
> I advocate one bit per line:
>
> 1
> 0
> 1
> 0
> 0
> 1
> 0
> 1
> 1
> 0
> 0
> 1
> 0
> 1
> 1
> 1
> 0
> 0
> 0
> 0
> 1
> 1
> 1
> 0
> 1
> 1
> 0
>
The dir() built-in does not show the __name__ attribute of a class:
>>> '__name__' in Foo.__dict__
False
>>> Foo.__name__
'Foo'
I implementd my custom __dir__, but the dir() built-in do not want to
call it:
>>> class Foo:
... @classmethod
... def __dir__(cls):
... return ['pyt
Jennie wrote:
> The dir() built-in does not show the __name__ attribute of a class:
>
> >>> '__name__' in Foo.__dict__
> False
> >>> Foo.__name__
> 'Foo'
>
> I implementd my custom __dir__, but the dir() built-in do not want to
> call it:
>
> >>> class Foo:
> ... @classmethod
> ... d
On Sat, 2012-10-20, Michael Torrie wrote:
> On 10/19/2012 06:43 PM, Mark Lawrence wrote:
>> Good morning/afternoon/evening all,
>>
>> Is there any possibility that we could find a way to prevent the double
>> spaced rubbish that comes from G$ infiltrating this ng/ml? For example,
>> does Python
On 10/20/2012 10:24 AM, Peter Otten wrote:
So if you want to customise dir(Foo) you have to modify the metaclass:
>>>class Foo:
... class __metaclass__(type):
... def __dir__(self): return ["python"]
...
>>>dir(Foo)
['python']
Hi Peter, thanks for your answer, but it doe
Hello!
I'm pleased to announce versions 1.3 2 and 1.2.4, minor bugfix releases
of SQLObject.
What is SQLObject
=
SQLObject is an object-relational mapper. Your database tables are described
as classes, and rows are instances of those classes. SQLObject is meant to be
easy to u
Jennie wrote:
> On 10/20/2012 10:24 AM, Peter Otten wrote:
>
>> So if you want to customise dir(Foo) you have to modify the metaclass:
>>
> >>>class Foo:
>> ... class __metaclass__(type):
>> ... def __dir__(self): return ["python"]
>> ...
> >>>dir(Foo)
>> ['python']
>>
>>
On Saturday, October 20, 2012 4:00:55 AM UTC+2, Chris Angelico wrote:
> On Sat, Oct 20, 2012 at 10:43 AM, lars van gemerden
>
> wrote:
>
> > Do you have any ideas about to what extend the "lambda" version of the code
> > (custom code is only the 'body' of the lambda function) has the same issue
On 10/20/2012 11:43 AM, Peter Otten wrote:
In Python 3 the way to specify the metaclass has changed:
class FooType(type):
... def __dir__(self): return ["python"]
...
class Foo(metaclass=FooType):
... pass
...
dir(Foo)
['python']
Thanks! :)
--
Jennie
--
http://mail.python.org/
"Tim Golden" wrote:
In general, you'll want to be using a mechanism such as pip:
http://pypi.python.org/pypi/pip
which will look things up on PyPI so you can just do "pip install
newmodule".
And if you have a pip.bat from some Perl installation sitting before
python's Scripts dir in your
Charger or laptop adapter is often damaged when the use and improper
storage. In fact, the adapter works for supplying power to the
laptop,
and if the conditions are not good can cause damage to your laptop.
Use the correct adapter will help reduce the risk of damage to your
laptop and keep money i
On 2012-10-20, Dennis Lee Bieber wrote:
> Strangely, we've gone from 80-character fixed width displays to
> who-knows-what (if I drop my font size I can probably get nearly 200
> characters across in full-screen mode)...
>
> But at the same time we've gone from 132-character line-prin
On 2012-10-20, Michael Torrie wrote:
> On 10/19/2012 06:43 PM, Mark Lawrence wrote:
>> Good morning/afternoon/evening all,
>>
>> Is there any possibility that we could find a way to prevent the double
>> spaced rubbish that comes from G$ infiltrating this ng/ml? For example,
>> does Python hav
On 20 October 2012 15:18, Grant Edwards wrote:
> On 2012-10-20, Dennis Lee Bieber wrote:
>
> > Strangely, we've gone from 80-character fixed width displays to
> > who-knows-what (if I drop my font size I can probably get nearly 200
> > characters across in full-screen mode)...
> >
> >
Hi,
I'm the author of sh.py, a subprocess module rewrite for Linux and OSX. It
serves as a powerful and intuitive interface to launching subprocesses
http://amoffat.github.com/sh/. It has been maintained on github
https://github.com/amoffat/sh for about 10 months and currently has about
25k inst
On Sat, Oct 20, 2012 at 3:10 PM, Dennis Lee Bieber
wrote:
> On Sat, 20 Oct 2012 14:18:47 + (UTC), Grant Edwards
> declaimed the following in
> gmane.comp.python.general:
>
>>
>> True, but nobody prints source code out on paper do they?
>>
>> Seriously -- I can't remember the last time I print
On Sat, 20 Oct 2012 14:18:47 +, Grant Edwards wrote:
> True, but nobody prints source code out on paper do they?
>
> Seriously -- I can't remember the last time I printed souce code...
I remember my first IT job - COBOL programming in the early 80's. The
rule was that every time we delivere
On Sat, 20 Oct 2012 01:43:03 +0100, Mark Lawrence wrote:
> Good morning/afternoon/evening all,
>
> Is there any possibility that we could find a way to prevent the double
> spaced rubbish that comes from G$ infiltrating this ng/ml? For example,
> does Python have anybody who works for G$ who cou
In article <5081d0c3$0$30003$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> Some code might be more conveniently written as a single long line. But I
> would argue that nearly never is code more easily *read* as a single long
> line, and since code is read much more than it is w
Hi,
I've noticed that the encoding of non-ascii filenames can be inconsistent
between platforms when using the built-in open() function to create files.
For example, on a Ubuntu 10.04.4 LTS box, the character u'ş' (u'\u015f') gets
encoded as u'ş' (u's\u0327'). Note how the two characters look
If I run the following code in the same module, it works correctly, but
if I import it I get the message:
Exception RuntimeError: 'generator ignored GeneratorExit' in object getNxtFile at 0x7f932f884f50> ignored
def getNxtFile (startDir, exts = ["txt", "utf8"]):
try:
forpathi
On 2012-10-20 21:03, Charles Hixson wrote:
If I run the following code in the same module, it works correctly, but
if I import it I get the message:
Exception RuntimeError: 'generator ignored GeneratorExit' in ignored
def getNxtFile (startDir, exts = ["txt", "utf8"]):
try:
for
the pattern `re.compile(".(?#nyh2p){0,1}")` , make me confused,
can you explain how it can match the first letter of every word?
2012/10/20 Dennis Lee Bieber
> On Sat, 20 Oct 2012 01:03:46 -0400, Zero Piraeus
> declaimed the following in gmane.comp.python.general:
>
> > :
> >
> > On 20 Octo
Hi, I'm fairly new to Python, and I'm trying to figure out how to use
SQLAlchemy to connect to a MySQL DB and use table reflection to set up
SQLAlchemy's tables. But the SQLAlchemy documentation is gigantic and
frankly kinda making my head spin, so I'm having trouble even finding
any information o
On Sat, Oct 20, 2012 at 2:03 PM, Charles Hixson
wrote:
> If I run the following code in the same module, it works correctly, but if I
> import it I get the message:
> Exception RuntimeError: 'generator ignored GeneratorExit' in object getNxtFile at 0x7f932f884f50> ignored
>
> def getNxtFile (star
On Sat, 20 Oct 2012 13:43:16 -0700, Julien Phalip wrote:
> I've noticed that the encoding of non-ascii filenames can be inconsistent
> between platforms when using the built-in open() function to create files.
>
> For example, on a Ubuntu 10.04.4 LTS box, the character u'ş' (u'\u015f')
> gets enc
On Sat, Oct 20, 2012 at 5:14 PM, contro opinion wrote:
> the pattern `re.compile(".(?#nyh2p){0,1}")` , make me confused,
> can you explain how it can match the first letter of every word?
It doesn't.
>>> pattern = re.compile(".(?#nyh2p){0,1}")
>>> pattern.findall("a test of capitalizing")
['a'
On 2012-10-21 00:14, contro opinion wrote:
the pattern `re.compile(".(?#nyh2p){0,1}")` , make me confused,
can you explain how it can match the first letter of every word?
It matches all of the characters, plus an empty string at the end. It's
equivalent to:
result = ""
for c in "a
On Sat, Oct 20, 2012 at 1:30 PM, Dennis Lee Bieber
wrote:
>> >>> for match in re.findall(pattern, "a test of capitalizing"):
>> ... result = f(result + match)
>
> result = result + f(match)
>
> Or closer... Don't both with f and str.capitalize
>
> result = result + match.
On 10/20/2012 04:28 PM, Ian Kelly wrote:
On Sat, Oct 20, 2012 at 2:03 PM, Charles Hixson
wrote:
If I run the following code in the same module, it works correctly, but if I
import it I get the message:
Exception RuntimeError: 'generator ignored GeneratorExit' in ignored
def getNxtFile (start
On 20Oct2012 16:41, Charles Hixson wrote:
| On 10/20/2012 04:28 PM, Ian Kelly wrote:
| > On Sat, Oct 20, 2012 at 2:03 PM, Charles Hixson
| >> try:
| >> fil=open (path, encoding = "utf-8-sig")
| >> yieldfil
| >> except:
[...]
|
On 21/10/12 01:41:37, Charles Hixson wrote:
> On 10/20/2012 04:28 PM, Ian Kelly wrote:
>> On Sat, Oct 20, 2012 at 2:03 PM, Charles Hixson
>> wrote:
>>> If I run the following code in the same module, it works correctly,
>>> but if I
>>> import it I get the message:
>>> Exception RuntimeError: 'ge
inshu chauhan wrote:
>
>but i want to calculate it for every 3 points not the whole data, but
>instead of giving me centre for every 3 data the prog is printing the
>centre 3 times...
>
>def main (data):
>j = 0
>for i in data[:3]:
>while j != 3:
> centre = CalcCentre(data)
On 17 October 2012 09:14, Mark Lawrence wrote:
> On 17/10/2012 05:16, 8 Dihedral wrote:
>
>> What you really want is b=a.copy()
>> not b=a to disentangle two objects.
>>
>> __eq__ is used in the comparison operation.
>>
>>
> The winner Smartest Answer by a Bot Award 2012 :)
Something seems
35 matches
Mail list logo