Consider this standard metaclass definition:
class MyMetaclass(type):
def __init__(cls, name, bases, dct):
super(MyMetaclass, cls).__init__(name, bases, dct)
# do meta-stuff
class Foo(object):
__metaclass__ = MyMetaclass
The call "super(MyMetaclass, cls)" should returns t
At first i have a python environment, after using virtualenv test
command, a new environment named test is created, in that directory
have some of the executable commands
such as python.exe, so can i program without the main installation of python?
--
http://mail.python.org/mailman/listinfo/python
You don't need doing something special, each decorator returns a new
function that and only the result function formed by all decorators will
be run. Consider this:
def clear_cache(func):
def decorator(*args, **kwargs):
print "cache cleared"
return func(*args, **kwargs)
On Fri, Aug 5, 2011 at 10:49 PM, Devraj wrote:
> Hi all,
>
> I am trying to simply my Web application handlers, by using Python
> decorators.
>
> Essentially I want to use decorators to abstract code that checks for
> authenticated sessions and the other that checks to see if the cache
> provider
env create by virtualenv will refer to the main env, how did it find
the main env, is there any configuration files, if yes, where is it?
2011/8/6 smith jack :
> At first i have a python environment, after using virtualenv test
> command, a new environment named test is created, in that directory
Devraj wrote:
> Hi all,
>
> I am trying to simply my Web application handlers, by using Python
> decorators.
>
> Essentially I want to use decorators to abstract code that checks for
> authenticated sessions and the other that checks to see if the cache
> provider (Memcache in this instance) has
On Sat, Aug 6, 2011 at 12:34 AM, Eli Bendersky wrote:
> Consider this standard metaclass definition:
>
> class MyMetaclass(type):
> def __init__(cls, name, bases, dct):
> super(MyMetaclass, cls).__init__(name, bases, dct)
> # do meta-stuff
>
> class Foo(object):
> __metaclass__
Eli Bendersky wrote:
> Consider this standard metaclass definition:
>
> class MyMetaclass(type):
> def __init__(cls, name, bases, dct):
> super(MyMetaclass, cls).__init__(name, bases, dct)
> # do meta-stuff
>
> class Foo(object):
> __metaclass__ = MyMetaclass
>
> The cal
On Sat, Aug 6, 2011 at 11:04, Chris Rebert wrote:
> On Sat, Aug 6, 2011 at 12:34 AM, Eli Bendersky wrote:
>> Consider this standard metaclass definition:
>>
>> class MyMetaclass(type):
>> def __init__(cls, name, bases, dct):
>> super(MyMetaclass, cls).__init__(name, bases, dct)
>>
sudo python /opt/Editra-0.6.58/setup.py install
Traceback (most recent call last):
File "/opt/Editra-0.6.58/setup.py", line 639, in
DoSourcePackage()
File "/opt/Editra-0.6.58/setup.py", line 498, in DoSourcePackage
DATA = GenerateSrcPackageFiles()
File "/opt/Editra-0.6.58/setup.py",
守株待兔 wrote:
> sudo python /opt/Editra-0.6.58/setup.py install
> Traceback (most recent call last):
> File "/opt/Editra-0.6.58/setup.py", line 639, in
> DoSourcePackage()
> File "/opt/Editra-0.6.58/setup.py", line 498, in DoSourcePackage
> DATA = GenerateSrcPackageFiles()
> File "/op
Hi,
I have wrapped a library from C++ to Python using SWIG. But when I
import it in Python, I am able to work fine with it, but it gives a
segmentation fault while exiting. Following is the log:
vipul@vipul-laptop:~/ossim-svn/src/pyossim/swig$ python
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:3
On Sat, Aug 6, 2011 at 11:35 AM, Vipul Raheja wrote:
> Hi,
>
> I have wrapped a library from C++ to Python using SWIG. But when I
> import it in Python, I am able to work fine with it, but it gives a
> segmentation fault while exiting. Following is the log:
The most likely cause of this is that y
Hi Chris,
Thanks for the reply.
However, the error occurs even if I don't do anything, that is, even if I
simply import the library and exit() after that.
I created a file a.py whose contents were the following:
import pyossim
exit()
Upon execution, the log was as follows:
vipul@vipul-laptop:
On Sat, Aug 6, 2011 at 12:16 PM, Vipul Raheja wrote:
> Hi Chris,
> Thanks for the reply.
> However, the error occurs even if I don't do anything, that is, even if I
> simply import the library and exit() after that.
> I created a file a.py whose contents were the following:
> import pyossim
> exit
Looking for a Python Developer with
·
Database (Oracle or SQL server ) – MUST
have Capital Market Experience - Fixed Income Market / Trading
Systems
·
Java/.Net as the base development
expertise
Please let me know if any one is interested
The subnet behind my router is 192.168.1.0/24, my pc ip is 192.168.1.9,
the server written with python is hosted on 192.168.1.3 on port 1033,
i can connect to this server from my pc
But cannot connect to this server when outside of this subnet? why?
I have made port translate on router, that is 1
On 08/06/2011 02:49 AM, Chris Rebert wrote:
On Fri, Aug 5, 2011 at 10:49 PM, Devraj wrote:
My question, how do I chain decorators that end up executing the
calling method, but ensure that it's only called once.
That's how it works normally; decorators stack (and order is therefore
important).
On Sat, Aug 6, 2011 at 11:20 AM, smith jack wrote:
> The subnet behind my router is 192.168.1.0/24, my pc ip is 192.168.1.9,
> the server written with python is hosted on 192.168.1.3 on port 1033,
> i can connect to this server from my pc
>
> But cannot connect to this server when outside of this
Hi,
I did look out for the problem's solution but have been struggling with it
ever since. I also asked around on IRC too but haven't quite progressed
towards the solution. Here is the link to the swig-generated .cxx file which
we need to look into for the answers. Could you please have a look at
I have little reason to doubt that it's related to referencing counting,
but:
http://stromberg.dnsalias.org/~dstromberg/checking-early.html
On Sat, Aug 6, 2011 at 3:35 AM, Vipul Raheja wrote:
> Hi,
>
> I have wrapped a library from C++ to Python using SWIG. But when I
> import it in Python, I a
On Sat, Aug 6, 2011 at 2:34 PM, Vipul Raheja wrote:
> Here's the link: www.geofemengineering.it/data/master_wrap.cxx
> Thanks and Regards,
> Vipul Raheja
Ugh. Unfortunately that file is somewhat lengthy... I hate to say
"tl;dr" to people, but... is there any way to simplify that down?
Perhaps th
if a list L is composed with tuple consists of two elements, that is
L = [(a1, b1), (a2, b2) ... (an, bn)]
is there any simple way to divide this list into two separate lists , such that
L1 = [a1, a2... an]
L2=[b1,b2 ... bn]
i do not want to use loop, any methods to make this done?
--
http://mai
On Sat, Aug 6, 2011 at 6:07 PM, smith jack wrote:
> if a list L is composed with tuple consists of two elements, that is
> L = [(a1, b1), (a2, b2) ... (an, bn)]
>
> is there any simple way to divide this list into two separate lists , such
> that
> L1 = [a1, a2... an]
> L2=[b1,b2 ... bn]
>
> i do
On 08/06/2011 10:07 AM, smith jack wrote:
if a list L is composed with tuple consists of two elements, that is
L = [(a1, b1), (a2, b2) ... (an, bn)]
is there any simple way to divide this list into two separate lists , such that
L1 = [a1, a2... an]
L2=[b1,b2 ... bn]
i do not want to use loop, a
On 8/6/2011 10:07 AM smith jack said...
if a list L is composed with tuple consists of two elements, that is
L = [(a1, b1), (a2, b2) ... (an, bn)]
is there any simple way to divide this list into two separate lists , such that
L1 = [a1, a2... an]
L2=[b1,b2 ... bn]
>>> L = [('a1', 'b1'), ('a2'
No.
L1, L2 = zip(*L)
2011/8/7 Chris Angelico
> On Sat, Aug 6, 2011 at 6:07 PM, smith jack wrote:
> > if a list L is composed with tuple consists of two elements, that is
> > L = [(a1, b1), (a2, b2) ... (an, bn)]
> >
> > is there any simple way to divide this list into two separate lists ,
> su
:
> if a list L is composed with tuple consists of two elements, that is
> L = [(a1, b1), (a2, b2) ... (an, bn)]
>
> is there any simple way to divide this list into two separate lists , such
> that
> L1 = [a1, a2... an]
> L2=[b1,b2 ... bn]
How about this?
>>> L = [("a1", "b1"), ("a2", "b2"), (
My ISP (Bluehost) does not yet support Python version 3, but gave me shell
access (no sudo) so that I can install Python 3 myself on my server account
(running Apache). So I uploaded the standard Python.org installation package
(Python 3.2.1 for Linux) and followed instructions, starting with
./con
On Sun, 07 Aug 2011 01:07:00 +0800, smith jack wrote:
> if a list L is composed with tuple consists of two elements, that is L =
> [(a1, b1), (a2, b2) ... (an, bn)]
>
> is there any simple way to divide this list into two separate lists ,
> such that L1 = [a1, a2... an]
> L2=[b1,b2 ... bn]
>
> i
On Aug 1, 5:33 pm, aliman wrote:
> I've read the recipe at [1] and understand that the way to sort a
> large file is to break it into chunks, sort each chunk and write
> sorted chunks to disk, then use heapq.merge to combine the chunks as
> you read them.
Or just memory map the file (mmap.mmap)
On Sat, 06 Aug 2011 10:24:10 -0700, Emile van Sebille wrote:
> On 8/6/2011 10:07 AM smith jack said...
>> if a list L is composed with tuple consists of two elements, that is L
>> = [(a1, b1), (a2, b2) ... (an, bn)]
>>
>> is there any simple way to divide this list into two separate lists ,
>> suc
On Sat, Aug 6, 2011 at 7:21 PM, bud wrote:
> Nice. :) I forgot about zip, still learning Python myself.
>
> I'll have to check up on the *L - is that a reference?
> I
It expands the list into the arguments. It's the parallel to:
def func(*args):
which collapses the args into a list.
ChrisA
--
On 08/06/2011 09:38 AM, smith jack wrote:
> At first i have a python environment, after using virtualenv test
> command, a new environment named test is created, in that directory
> have some of the executable commands
> such as python.exe, so can i program without the main installation of python?
On 08/06/2011 09:51 AM, smith jack wrote:
> env create by virtualenv will refer to the main env, how did it find
> the main env, is there any configuration files, if yes, where is it?
>
> 2011/8/6 smith jack :
>> At first i have a python environment, after using virtualenv test
>> command, a new e
On 08/06/2011 09:51 AM, smith jack wrote:
> env create by virtualenv will refer to the main env, how did it find
> the main env, is there any configuration files, if yes, where is it?
>
> 2011/8/6 smith jack :
>> At first i have a python environment, after using virtualenv test
>> command, a new e
On 08/06/2011 08:13 PM, bud wrote:
> On Sun, 07 Aug 2011 01:07:00 +0800, smith jack wrote:
>
>> if a list L is composed with tuple consists of two elements, that is L =
>> [(a1, b1), (a2, b2) ... (an, bn)]
>>
>> is there any simple way to divide this list into two separate lists ,
>> such that L1
On 2:59 PM, smith jack wrote:
> if a list L is composed with tuple consists of two elements, that is
> L = [(a1, b1), (a2, b2) ... (an, bn)]
>
> is there any simple way to divide this list into two separate lists , such
> that
> L1 = [a1, a2... an]
> L2=[b1,b2 ... bn]
>
> i do not want to use loop
On 2:59 PM, smith jack wrote:
> if a list L is composed with tuple consists of two elements, that is
> L = [(a1, b1), (a2, b2) ... (an, bn)]
>
> is there any simple way to divide this list into two separate lists , such
> that
> L1 = [a1, a2... an]
> L2=[b1,b2 ... bn]
>
> i do not want to use loop
Hi all: i am new to python. i am working with lm-sensors to monitor the cpu fan
speed, temperature and voltages. i have to use python code to get integer
value of cpu temperature from lm sensors. please help me how i do that i shall
be gratefullAahan --
h
On Sat, Aug 6, 2011 at 1:23 PM, Kabie wrote:
> No.
> L1, L2 = zip(*L)
Not quite. That makes L1 & L2 tuples.
L1, L2 = zip(*L)
L1 = list(L1)
L2 = list(L2)
???
--
http://mail.python.org/mailman/listinfo/python-list
I'm developing a Windows version of a Mac/Python app and I'd like to add
a scripting interface to it. On the Mac I do this via Apple Events--this
is an Apple technology that allows applications to drive other
applications and query them for data using a message-passing interface.
Each applicati
In article
,
John S James wrote:
> My ISP (Bluehost) does not yet support Python version 3, but gave me shell
> access (no sudo) so that I can install Python 3 myself on my server account
> (running Apache). So I uploaded the standard Python.org installation package
> (Python 3.2.1 for Linux) an
I'll be a lot easier for you to get help, if you take a shot at it yourself
first, then post a link to what you have here, along with any error messages
you may be getting.
On Sat, Aug 6, 2011 at 1:38 PM, aahan noor wrote:
>
> Hi all:
> i am new to python. i am working with lm-sensors to monito
On Sat, Aug 6, 2011 at 10:33 PM, Kevin Walzer wrote:
> The main complaint I've seen about DDE is that it is very old.
I can't speak about COM, as I have not used it to any great extent,
but DDE has a number of things going for it. Firstly though, "old"
does not need to be a criticism. How many ne
Gelonida N wrote:
> Asuming you [Bud] are not an alias of Jack Smith and assuming you did
> not see Jack's thread asking the same question:
That's a strange thing to say when Bud *answered* Jack's question.
> x,y = unzip(*L)
What's unzip? It doesn't exist in any version of Python between 1.5
bud wrote:
> I'll have to check up on the *L - is that a reference?
No, as Chris already answered, unary * is used for packing and unpacking
positional arguments to functions; unary ** is similarly used for
collecting keyword arguments.
> I know in Perl, you can assign the lhs to a list,
> belo
Chris Angelico wrote:
> On Sat, Aug 6, 2011 at 6:07 PM, smith jack wrote:
>> if a list L is composed with tuple consists of two elements, that is
>> L = [(a1, b1), (a2, b2) ... (an, bn)]
>>
>> is there any simple way to divide this list into two separate lists ,
>> such that L1 = [a1, a2... an]
>
smith jack wrote:
>
>if a list L is composed with tuple consists of two elements, that is
>L = [(a1, b1), (a2, b2) ... (an, bn)]
>
>is there any simple way to divide this list into two separate lists , such that
>L1 = [a1, a2... an]
>L2=[b1,b2 ... bn]
>
>i do not want to use loop, any methods to m
On Sun, Aug 7, 2011 at 1:58 AM, Tim Roberts wrote:
> I did momentarily consider the following slimy solution:
> L1 = dict(L).keys()
> L2 = dict(L).values()
> but that reorders the tuples. They still correspond, but in a different
> order.
>
Which can be overcome with collections.OrderedDict. B
Im trying to use the most basic of cx_Freeze in a dos window and I receive the
following error (see below). I suspect I have some kind of path issue, but am
at a loss as to how to proceed. I am trying to execute this in the Scripts
directory and have both the cxfreeze bat and also the .py file
Chris Angelico wrote:
> On Sun, Aug 7, 2011 at 1:58 AM, Tim Roberts wrote:
>> I did momentarily consider the following slimy solution:
>> L1 = dict(L).keys()
>> L2 = dict(L).values()
>> but that reorders the tuples. They still correspond, but in a different
>> order.
>>
>
> Which can be overcom
Thought I knew how to provide a dynamic __name__ on instances of a
class. My first try was to use a non-data descriptor:
# module base.py
class _NameProxy(object):
def __init__(self, oldname):
self.oldname = oldname
def __get__(self, obj, cls):
if obj is None:
Eric Snow wrote:
> Thought I knew how to provide a dynamic __name__ on instances of a
> class. My first try was to use a non-data descriptor:
Perhaps you should explain what you are trying to do. If you want to give
instances their own name, why not just give them an instance
attribute "name"? D
smith jack writes:
> if a list L is composed with tuple consists of two elements, that is
> L = [(a1, b1), (a2, b2) ... (an, bn)]
>
> is there any simple way to divide this list into two separate lists , such
> that
> L1 = [a1, a2... an]
> L2=[b1,b2 ... bn]
>
> i do not want to use loop, any meth
David Robinow wrote:
> On Sat, Aug 6, 2011 at 1:23 PM, Kabie wrote:
>> No.
>> L1, L2 = zip(*L)
>
> Not quite. That makes L1 & L2 tuples.
>
> L1, L2 = zip(*L)
> L1 = list(L1)
> L2 = list(L2)
> ???
L1, L2 = map(list, zip(*L))
--
By ZeD
--
http://mail.python.org/mailman/listinfo/python-list
56 matches
Mail list logo