Friday, March 26, 2010

comp.lang.python - 25 new messages in 11 topics - digest

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

comp.lang.python@googlegroups.com

Today's topics:

* Classes as namespaces? - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/ddaed9721e7bbf45?hl=en
* Income for life ! - 2 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/67418a7e163fe7c0?hl=en
* EARN MONEY IN FREE TIME(DO MORE & EARN MORE) - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/2c9ff14721fa0f5e?hl=en
* Create a class at run-time - 4 messages, 4 authors
http://groups.google.com/group/comp.lang.python/t/c6539cb7e78776cc?hl=en
* python logging writes an empty file - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/d85aae7f2485a150?hl=en
* malloc error in PyDict_New - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/a8e55b21849aa115?hl=en
* OT: Meaning of "monkey" - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/9bb59d02c28e6ffb?hl=en
* Have you embraced Python 3.x yet? - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/aa1a1b6626b5b203?hl=en
* Revisiting Generators and Subgenerators - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/8c38b742691fcbc8?hl=en
* exec .exe - 3 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/80d3935c0212920b?hl=en
* sqlite version on windows - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/857a4917e564980d?hl=en

==============================================================================
TOPIC: Classes as namespaces?
http://groups.google.com/group/comp.lang.python/t/ddaed9721e7bbf45?hl=en
==============================================================================

== 1 of 3 ==
Date: Fri, Mar 26 2010 10:51 am
From: kj

Thanks for all your comments.

I see that modules are arguably Python's standard way for implementing
namespaces. I guess I tend to avoid modules primarily because of
lingering mental trauma over incidents of insane/bizarro import
bugs in the past. (It's not rational, I know; it's like when one
develops an aversion for some previously liked food after a bout
of food poisoning with it.) Now I postpone creating a new Python
module until the pain of not doing so forces me beyond my phobia.
(Yes, you got that right, I'm a basket case.)


== 2 of 3 ==
Date: Fri, Mar 26 2010 11:10 am
From: Philip Semanchuk

On Mar 26, 2010, at 1:51 PM, kj wrote:

> Thanks for all your comments.
>
> I see that modules are arguably Python's standard way for implementing
> namespaces. I guess I tend to avoid modules primarily because of
> lingering mental trauma over incidents of insane/bizarro import
> bugs in the past.

There can be good reasons (i.e. unrelated to trauma) not to use a one-
namespace-per-module rule.

For instance, The app I'm working on now has 43 classes defined in a
constants.py file. Each class is just a namespace for constants.
That's much more practical than 43 modules called foo_constants.py,
bar_constants.py, etc.

My Currency(type=CurrencyType.USD, value=decimal.Decimal(".02")),
Philip

== 3 of 3 ==
Date: Fri, Mar 26 2010 11:26 am
From: Luis M. González


On 26 mar, 11:49, kj <no.em...@please.post> wrote:
> What's the word on using "classes as namespaces"?  E.g.
>
> class _cfg(object):
>     spam = 1
>     jambon = 3
>     huevos = 2
>
> breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos)

I see no problem.
I wouldn't mix English, French and Spanish in the same recipe though...

==============================================================================
TOPIC: Income for life !
http://groups.google.com/group/comp.lang.python/t/67418a7e163fe7c0?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, Mar 26 2010 11:04 am
From: "www.ownbusiness.ws"


www.ownbusiness.ws

Change your life now.
Try, it really works.


== 2 of 2 ==
Date: Fri, Mar 26 2010 11:05 am
From: "www.ownbusiness.ws"


www.ownbusiness.ws

Change your life now.
Try, it really works.

==============================================================================
TOPIC: EARN MONEY IN FREE TIME(DO MORE & EARN MORE)
http://groups.google.com/group/comp.lang.python/t/2c9ff14721fa0f5e?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Mar 26 2010 11:04 am
From: PAVITHRA


http://cancerresearch-vijay.blogspot.com/
http://nutritionhealthnoni.blogspot.com/
http://vijay-forestenjoy.blogspot.com/
http://information-041.blogspot.com/
http://onlineworktamilnadu.blogspot.com/
http://vijay-onlinejob.blogspot.com/
http://online-trading111.blogspot.com/
http://hot-problem.blogspot.com/
http://vijay681.blogspot.com/
http://nutuernoni.blogspot.com/
http://nonisearch2008.blogspot.com

==============================================================================
TOPIC: Create a class at run-time
http://groups.google.com/group/comp.lang.python/t/c6539cb7e78776cc?hl=en
==============================================================================

== 1 of 4 ==
Date: Fri, Mar 26 2010 11:41 am
From: Michel


Thanks Peter.

I searched a little bit more and wrote the following example:

------------------------------------
import types

class MyClass:

def test_toto(self):
print type(self)
print self.name

def test_toto(self):
print type(self)
print self.name

MyDynClass = types.ClassType("MyDynClass", (object, ), {})
MyDynClass.__module__ = "test.complex.hierarchy"
MyDynClass.test_toto = test_toto

t1 = MyDynClass()
t2 = MyDynClass()

t1.name = "Marcel"
t2.name = "Oscar"

t1.test_toto()
t2.test_toto()

c1 = MyClass()
c1.name = "Raoul"
c1.test_toto()
--------------------------------

the output is:

<class 'test.complex.hierarchy.MyDynClass'>
Marcel
<class 'test.complex.hierarchy.MyDynClass'>
Oscar
<type 'instance'>
Raoul

I'm wondering why the type of the self parameter is not 'instance' in
the calls
t1.test_toto() and t2.test_toto()

The rest of the behavior is correct though, so I guess it's just
internal Python stuff.

Thanks for your help,

Michel.

On Mar 26, 1:29 pm, Peter Otten <__pete...@web.de> wrote:
> Michel wrote:
> > Hi everyone,
>
> > I'm trying to dynamically create a class. What I need is to define a
> > class, add methods to it and later instantiate this class. Methods
> > need to be bound to the instance though, and that's my problem. Here
> > is what I have so far:
>
> > method_template = "def test_foo(self):\
> >     #actual test_foo\
> >     pass"
> > exec method_template
>
> > TestClass = types.ClassType("MyTestClass", (unittest.TestCase, ), {})
> > TestClass.__module__ = "test"
>
> > now what to do next?
>
> Just assign it:
>
> >>> import unittest
> >>> class MyTestClass(unittest.TestCase): pass
> ...
> >>> def test_foo(self):
>
> ...     self.assertEquals(1, 2)
> ...>>> MyTestClass.test_foo = test_foo # <----
> >>> unittest.main()
>
> F
> ======================================================================
> FAIL: test_foo (__main__.MyTestClass)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "<stdin>", line 2, in test_foo
> AssertionError: 1 != 2
>
> ----------------------------------------------------------------------
> Ran 1 test in 0.000s
>
> FAILED (failures=1)
>
> If you don't know the method name beforehand use
>
> setattr(MyTestClass, method_name, method), e. g:
>
> >>> import unittest
> >>> class MyTestClass(unittest.TestCase): pass
>
> ...                                          >>> def make_method(n):
>
> ...     def test(self): self.assertEquals(2, n)
> ...     return test                            
> ...>>> for i in range(3):
>
> ...     setattr(MyTestClass, "test_%d" % i, make_method(i))
> ...>>> unittest.main()
>
> FF.
> ======================================================================
> FAIL: test_0 (__main__.MyTestClass)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "<stdin>", line 2, in test
> AssertionError: 2 != 0
>
> ======================================================================
> FAIL: test_1 (__main__.MyTestClass)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "<stdin>", line 2, in test
> AssertionError: 2 != 1
>
> ----------------------------------------------------------------------
> Ran 3 tests in 0.000s
>
> FAILED (failures=2)
>
> Peter

== 2 of 4 ==
Date: Fri, Mar 26 2010 12:16 pm
From: Peter Otten <__peter__@web.de>


Michel wrote:

> Thanks Peter.
>
> I searched a little bit more and wrote the following example:
>
> ------------------------------------
> import types
>
> class MyClass:
>
> def test_toto(self):
> print type(self)
> print self.name
>
> def test_toto(self):
> print type(self)
> print self.name
>
> MyDynClass = types.ClassType("MyDynClass", (object, ), {})
> MyDynClass.__module__ = "test.complex.hierarchy"
> MyDynClass.test_toto = test_toto
>
> t1 = MyDynClass()
> t2 = MyDynClass()
>
> t1.name = "Marcel"
> t2.name = "Oscar"
>
> t1.test_toto()
> t2.test_toto()
>
> c1 = MyClass()
> c1.name = "Raoul"
> c1.test_toto()
> --------------------------------
>
> the output is:
>
> <class 'test.complex.hierarchy.MyDynClass'>
> Marcel
> <class 'test.complex.hierarchy.MyDynClass'>
> Oscar
> <type 'instance'>
> Raoul
>
> I'm wondering why the type of the self parameter is not 'instance' in
> the calls
> t1.test_toto() and t2.test_toto()
>
> The rest of the behavior is correct though, so I guess it's just
> internal Python stuff.

In Python 2.x there are "classic" and "newstyle" classes. In practice the
main differences are that classic classes are more likely to call
__getattr__() and that only newstyle classes support properties correctly.

By inheriting from object you make MyDynClass a newstyle class:

>>> classic = types.ClassType("A", (), {})
>>> newstyle = types.ClassType("A", (object,), {})

>>> type(classic()), type(classic)
(<type 'instance'>, <type 'classobj'>)

>>> type(newstyle()), type(newstyle)
(<class '__main__.A'>, <type 'type'>)

Classic classes exist for backwards compatibility and because most
programmers are too lazy to have their classes inherit from object when the
difference doesn't matter. When you create a class dynamically I recommend
that you use the type() builtin instead of types.ClassType(). This will
always create a newstyle class -- even when you don't inherit from object
explicitly:

>>> type(type("A", (), {}))
<type 'type'>
>>> type("A", (), {}).__bases__
(<type 'object'>,)

Peter

== 3 of 4 ==
Date: Fri, Mar 26 2010 12:19 pm
From: Steve Holden


Michel wrote:
> Thanks Peter.
>
> I searched a little bit more and wrote the following example:
>
> ------------------------------------
> import types
>
> class MyClass:
>
> def test_toto(self):
> print type(self)
> print self.name
>
> def test_toto(self):
> print type(self)
> print self.name
>
> MyDynClass = types.ClassType("MyDynClass", (object, ), {})
> MyDynClass.__module__ = "test.complex.hierarchy"
> MyDynClass.test_toto = test_toto
>
> t1 = MyDynClass()
> t2 = MyDynClass()
>
> t1.name = "Marcel"
> t2.name = "Oscar"
>
> t1.test_toto()
> t2.test_toto()
>
> c1 = MyClass()
> c1.name = "Raoul"
> c1.test_toto()
> --------------------------------
>
> the output is:
>
> <class 'test.complex.hierarchy.MyDynClass'>
> Marcel
> <class 'test.complex.hierarchy.MyDynClass'>
> Oscar
> <type 'instance'>
> Raoul
>
> I'm wondering why the type of the self parameter is not 'instance' in
> the calls
> t1.test_toto() and t2.test_toto()
>
> The rest of the behavior is correct though, so I guess it's just
> internal Python stuff.
>
Yes, it's just that MyClass is an old-style class (its type is <type
'classobj'>) whereas MyDynClass is a new-style class (its type is <type
'type'>, because it inherits from object).

It's as though you had written

class MyClass:
...

class MyDynClass(object):
...

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
See PyCon Talks from Atlanta 2010 http://pycon.blip.tv/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/

== 4 of 4 ==
Date: Fri, Mar 26 2010 1:46 pm
From: I V


On Fri, 26 Mar 2010 08:54:11 -0700, Michel wrote:

> I want to add a method to a class such that it can be invoked on
> specifics instances.
> You solution works (as well as Patrick's one), thanks ! I still have a
> question though. If I print the type of the self object I get when my
> method is
> called, I get "<class 'test.TestClass'>". I guess this is because the
> method is defined as a class method.
> This is ok in my case, but just out of curiosity, what should I do to
> change this method to an instance method?

It already is an instance method. When you create a TestClass instance,
the type of that instance is TestClass (the type of TestClass itself is
"type").

==============================================================================
TOPIC: python logging writes an empty file
http://groups.google.com/group/comp.lang.python/t/d85aae7f2485a150?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, Mar 26 2010 12:09 pm
From: Vinay Sajip


On Mar 26, 4:26 pm, Ovidiu Deac <ovidiud...@gmail.com> wrote:
> Anyway, thanks for the first part.
>
> Anybody else has any idea why using the same configuration file works
> when running the tests with nosetests and doesn't work withlogging.config.fileConfig() ?

It's probably because the fileConfig code is intended to *replace* any
existing configuration. This means disabling any existing loggers
which are not named explicitly, or not descendants of loggers named
explicitly, in the configuration.

Make sure you call logging.config.fileConfig() before any loggers have
been instantiated in your code, or else ensure that all the top-level
parents of those loggers (i.e. just below the root logger) are defined
in the configuration.

If you have version 2.6 or newer of Python, the fileConfig call has an
optional keyword parameter disable_existing_loggers which has a
default value of True, but which you can set to False to avoid
disabling the existing loggers.

Regards,

Vinay Sajip


== 2 of 2 ==
Date: Fri, Mar 26 2010 1:08 pm
From: Ovidiu Deac


It worked. Setting disable_existing_loggers=False fixed my problem.

Thanks to both of you!
Ovidiu

On Fri, Mar 26, 2010 at 9:09 PM, Vinay Sajip <vinay_sajip@yahoo.co.uk> wrote:
> On Mar 26, 4:26 pm, Ovidiu Deac <ovidiud...@gmail.com> wrote:
>> Anyway, thanks for the first part.
>>
>> Anybody else has any idea why using the same configuration file works
>> when running the tests with nosetests and doesn't work withlogging.config.fileConfig() ?
>
> It's probably because the fileConfig code is intended to *replace* any
> existing configuration. This means disabling any existing loggers
> which are not named explicitly, or not descendants of loggers named
> explicitly, in the configuration.
>
> Make sure you call logging.config.fileConfig() before any loggers have
> been instantiated in your code, or else ensure that all the top-level
> parents of those loggers (i.e. just below the root logger) are defined
> in the configuration.
>
> If you have version 2.6 or newer of Python, the fileConfig call has an
> optional keyword parameter disable_existing_loggers which has a
> default value of True, but which you can set to False to avoid
> disabling the existing loggers.
>
> Regards,
>
> Vinay Sajip
> --
> http://mail.python.org/mailman/listinfo/python-list
>

==============================================================================
TOPIC: malloc error in PyDict_New
http://groups.google.com/group/comp.lang.python/t/a8e55b21849aa115?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, Mar 26 2010 12:10 pm
From: "Jonas H."


Hi there,

I'm currently diving into Python C programming and I have a problem with
`PyDict_New`.

My application receives a SIGABRT from malloc every time I execute
`PyDict_New`. malloc throws the following error:

malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr)
(((char *) &((av)->bins[((1) - 1) * 2])) [snip]' failed.

gdb gives me the following traceback:

Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
(gdb) bt full
#0 0x0012d422 in __kernel_vsyscall ()
#5 0x003fef8c in malloc () from /lib/tls/i686/cmov/libc.so.6
#6 0x001b129c in new_arena (nbytes=3221223842) at ../Objects/obmalloc.c:534
i = <value optimized out>
numarenas = 16
arenaobj = 0x0
excess = 16
#7 PyObject_Malloc (nbytes=3221223842) at ../Objects/obmalloc.c:794
bp = <value optimized out>
pool = <value optimized out>
next = <value optimized out>
size = 4983326
#8 0x001baef5 in PyString_FromString (str=0x2964bf "<dummy key>") at
../Objects/stringobject.c:138
op = 0x0
#9 0x001a9d55 in PyDict_New () at ../Objects/dictobject.c:227
mp = <value optimized out>
#10 0x08048fc0 in Transaction_new () at bjoern.c:32
transaction = 0x80503a0
#11 0x08049309 in on_sock_accept (mainloop=0x13a120,
accept_watcher=0xbffff770, revents=1) at bjoern.c:109
[snip]
#12 0x00130594 in ev_invoke_pending () from /usr/lib/libev.so.3
#13 0x00135774 in ev_loop () from /usr/lib/libev.so.3
#14 0x080496e0 in main (argcount=1, args=0xbffff864) at bjoern.c:207
[snip]


I have walked millions of Google pages but I couldn't find any
explanation what causes the allocation error. I tried to put the
`PyDict_New` somewhere else to let it be invoked earlier/later. The only
effect I got is a "memory corruption" reported by glibc.


Could anybody tell me what exactly I'm doing wrong? It is quite possible
that I fscked up some pointers or memory ranges as this is my first C
project.

You can find the whole source at github:
http://github.com/jonashaag/bjoern

The call to `PyDict_New` is here:
http://github.com/jonashaag/bjoern/blob/master/bjoern.c#L32


Thanks for your help!

Jonas


== 2 of 2 ==
Date: Fri, Mar 26 2010 12:41 pm
From: Stefan Behnel


Jonas H., 26.03.2010 20:10:
> I'm currently diving into Python C programming and I have a problem with
> `PyDict_New`.
>
> My application receives a SIGABRT from malloc every time I execute
> `PyDict_New`. malloc throws the following error:
>
> malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *)
> &((av)->bins[((1) - 1) * 2])) [snip]' failed.

In case this code is not called from within Python but from some kind of
network layer callback (maybe in a thread created by C code?), you will
have to set up a Python interpreter environment for such a thread first.
See the PyInterpreterState and PyThreadState functions here:

http://docs.python.org/c-api/init.html

Stefan


==============================================================================
TOPIC: OT: Meaning of "monkey"
http://groups.google.com/group/comp.lang.python/t/9bb59d02c28e6ffb?hl=en
==============================================================================

== 1 of 3 ==
Date: Fri, Mar 26 2010 12:44 pm
From: Phlip


On Mar 26, 6:14 am, Luis M. González <luis...@gmail.com> wrote:
> Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey,
> Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc...
>
> Monkeys everywhere.
> Sorry for the off topic question, but what does "monkey" mean in a
> nerdy-geek context??
>
> Luis

Better at typing than thinking.


== 2 of 3 ==
Date: Fri, Mar 26 2010 1:18 pm
From: Mensanator


On Mar 26, 2:44 pm, Phlip <phlip2...@gmail.com> wrote:
> On Mar 26, 6:14 am, Luis M. González <luis...@gmail.com> wrote:
>
> > Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey,
> > Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc...
>
> > Monkeys everywhere.
> > Sorry for the off topic question, but what does "monkey" mean in a
> > nerdy-geek context??
>
> > Luis
>
> Better at typing than thinking.

Really? I thought it was more of a reference to Eddington, i.e., given
enough time even a monkey can type out a program.


== 3 of 3 ==
Date: Fri, Mar 26 2010 3:09 pm
From: Emile van Sebille


On 3/26/2010 1:18 PM Mensanator said...
> On Mar 26, 2:44 pm, Phlip<phlip2...@gmail.com> wrote:
>> On Mar 26, 6:14 am, Luis M. González<luis...@gmail.com> wrote:
>>
>>> Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey,
>>> Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc...
>>
>>> Monkeys everywhere.
>>> Sorry for the off topic question, but what does "monkey" mean in a
>>> nerdy-geek context??
>>
>>> Luis
>>
>> Better at typing than thinking.
>
> Really? I thought it was more of a reference to Eddington, i.e., given
> enough time even a monkey can type out a program.

I like the quote that went along the lines of 'here we are, and no we
haven't'


==============================================================================
TOPIC: Have you embraced Python 3.x yet?
http://groups.google.com/group/comp.lang.python/t/aa1a1b6626b5b203?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, Mar 26 2010 1:07 pm
From: Mensanator


On Mar 26, 8:23 am, Harishankar <v.harishan...@gmail.com> wrote:
> Have you people embraced Python 3.x or still with 2.5 or 2.6?

3.1.

The only module I use regularly is gmpy and that's one that has
been updated.


== 2 of 2 ==
Date: Fri, Mar 26 2010 4:43 pm
From: Terry Reedy


On 3/26/2010 9:23 AM, Harishankar wrote:
> Have you people embraced Python 3.x?

Yes. My current work only needs the stdlib and I much prefer the
streamlined language.


==============================================================================
TOPIC: Revisiting Generators and Subgenerators
http://groups.google.com/group/comp.lang.python/t/8c38b742691fcbc8?hl=en
==============================================================================

== 1 of 2 ==
Date: Fri, Mar 26 2010 2:34 pm
From: Winston


On Mar 26, 7:29 am, Sebastien Binet <seb.bi...@gmail.com> wrote:
> > Proposal for a new Generator Syntax in Python 3K--
> > A Baton object for generators to allow subfunction to yield, and to
> > make
> > them symetric.
>
> isn't a Baton what CSP calls a channel ?
>
> there is this interesting PyCSP library (which implements channels
> over greenlets, os-processes (via multiprocessing) or python threads)http://code.google.com/p/pycsp
>
> cheers,
> sebastien.

Thanks for the link. After reading about Greenlets, it seems my Baton
is a Greenlet. It is not passed in to the new greenlet as I wrote
above, but both sides use it to pass execution to the other, and to
send a value on switching.

I'm glad my thinking is matching other people's thinking. Now I have
to search for a greenlet written for Jython.

And thanks to others for their thoughts on this subject.

-Winston


== 2 of 2 ==
Date: Fri, Mar 26 2010 3:28 pm
From: Cameron Simpson


On 26Mar2010 07:29, Sebastien Binet <seb.binet@gmail.com> wrote:
| On Mar 25, 10:39 pm, Winston <winst...@stratolab.com> wrote:
| > A Baton object for generators to allow subfunction to yield, and to
| > make them symetric.
|
| isn't a Baton what CSP calls a channel ?

I was thinking about this (roughly) in the shower this morning before
seeing this message.

One difference is that a Channel or zero-storage Queue lets the putter
continue execution after the put (or at least the other side's get). A
co-routine won't proceed until later, no? So a co-routine setup will do
lazier computation than a similar threaded setup.

Cheers,
--
Cameron Simpson <cs@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

Principles have no real force except when one is well fed. - Mark Twain

==============================================================================
TOPIC: exec .exe
http://groups.google.com/group/comp.lang.python/t/80d3935c0212920b?hl=en
==============================================================================

== 1 of 3 ==
Date: Fri, Mar 26 2010 2:58 pm
From: wukong


newbie question, how do you run a .exe generated by MSVC++ in python
in windows?


== 2 of 3 ==
Date: Fri, Mar 26 2010 3:10 pm
From: Irmen de Jong


On 26-3-2010 22:58, wukong wrote:
> newbie question, how do you run a .exe generated by MSVC++ in python
> in windows?

Use the subprocess module, for instance:
subprocess.call(["notepad.exe", "d:/file.txt"])

irmen


== 3 of 3 ==
Date: Fri, Mar 26 2010 3:48 pm
From: wukong


On Mar 26, 3:10 pm, Irmen de Jong <irmen-NOSP...@xs4all.nl> wrote:
> On 26-3-2010 22:58, wukong wrote:
>
> > newbie question, how do you run a .exe generated by MSVC++ in python
> > in windows?
>
> Use the subprocess module, for instance:
> subprocess.call(["notepad.exe", "d:/file.txt"])
>
> irmen

worked like a charm, :-) thanks irmen.

==============================================================================
TOPIC: sqlite version on windows
http://groups.google.com/group/comp.lang.python/t/857a4917e564980d?hl=en
==============================================================================

== 1 of 1 ==
Date: Fri, Mar 26 2010 3:05 pm
From: Lawrence D'Oliveiro


In message <mailman.1215.1269608278.23598.python-list@python.org>, Philip
Semanchuk wrote:

> On Mar 26, 2010, at 5:57 AM, Laszlo Nagy wrote:
>>
>> On my Linux system: Python version: 2.6.2 sqlite3.sqlite_version:
>> 3.6.10
>> On my Windows system: Python version: 2.6.5 sqlite3.sqlite_version:
>> 3.5.9
>>
>> Why is that?
>
> The few Linux distros that I checked are much more aggressive about
> bundling newer versions of SQLite. For instance, Ubuntu 8.04 has
> Python 2.5.2 with SQLite 3.4.2, while Ubuntu 8.10 has the same version
> of Python but offers SQLite 3.5.9.
>
> You asked "why" and I don't know. I imagine it comes down to
> philosophical differences or maybe just a lack of time to test when
> building new WIndows distros for Python.org.

Maybe the issues are more practical than philosophical. Linux distros use an
integrated package manager and are maintained by a cohesive community. What
that means is that the SQLite package isn't just used by Python, but by a
bunch of other stuff as well. So all the maintainers of those packages have
an interest in making sure that SQLite doesn't break them.

Whereas on Windows, the Python download has to include _all_ its
dependencies, it cannot rely on a system-integrated package manager to
automatically provide them. And the same is true for every other open-source
package that anyone tries to pre-build for Windows. So they all have to
provide their own installation routines, their own updates, their own
testing ... in short, a lot of duplication of effort. This is expensive.


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

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