Twisted [1] includes lots of support for asyncronous concurrency,
using deferreds. There is also the possiblity of PEP 342's [2]
concurrency through enhanced generators, and being able to pass data
to the generator every iteration. There are ways to simulate this, as
well. I've written a recipe
The choice is GUI toolkits is largely seperate from Python. Consider
that they are just bindings to libraries that are developed completely
seperate of the language. GUI is should be seperate from the language,
and thus not bound to same expectations and desires as elements of the
language itself.
On 7/29/05, Dark Cowherd [EMAIL PROTECTED] wrote:
I am new to Python. I tried it out and think it is fantastic.
Congrats and have fun learning all there is to learn.
I really loved this from import this statements:
There should be one-- and preferably only one --obvious way to do it.
But
did you try to put the filename in quotes?
On 30 Jul 2005 03:33:14 -0700, Lad [EMAIL PROTECTED] wrote:
Hello,
I am running Python on XP and have a problem with
a program if its name consists '-' for example:
my-program.py
When I try to run a program with such name
I get the error :
On 28 Jul 2005 10:41:54 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Asynchrony is not concurrency. If you have to turn your code inside
out, (that is, if you have to write your code such that the library
calls your code, rather than vice versa) it's very much *not*
concurrency: it's
On 1 Aug 2005 05:12:47 -, Gurpreet Sachdeva
[EMAIL PROTECTED] wrote:
Hi,
Is there any provision in python which allows me to make my own operators?
My problem is that I need to combine two dictonaries with their keys and I
don't want to use any of the existing operators like
On 7/31/05, James Dennett [EMAIL PROTECTED] wrote:
Peter Hansen wrote:
Steven D'Aprano wrote:
Given that ZODB and PySQLite are simply Python extension modules, which
get bundled by your builder tool and are therefore installed
transparently along with your app by your installer, this
On 8/10/05, Grant Edwards [EMAIL PROTECTED] wrote:
On 2005-08-10, John Machin [EMAIL PROTECTED] wrote:
Perhaps the one bit is an exponent -- some kind of floating point
based format? That matches the doubling of all digits.
That would just be sick. I can't imagine anybody on an 8-bit
I'm trying to find the best way to use PyUnit and organize my test scripts.
What I really want is to separate all my tests into 'test' directories
within each module of my project. I want all the files there to define a
'suite' callable and to then all all those suites from all those test
Each module is only 'aware' of the built-ins and the modules it itself
imports. So, all you need to do is add this line to my_imported_mod:
from my_main_mod import myfun
This is a fully intentional feature. Modules stand on their own.
James Stroud wrote:
Say I have a module, we'll call it
I've been working on a small test runner script, to accumulate my test
scripts (all python files in the 'test' sub-directories of my source tree).
Things were going well, but I'm still having trouble loading the modules,
once I have a path to the python source file. This is the error I am
getting:
Of course, remember that there are benefits to this, as well. Redefining the
built-ins can be useful in some interesting cases.
Klaus Neuner wrote:
Hello,
Python has one feature that I really hate: There are certain special
names like 'file' and 'dict' with a predefined meaning. Yet, it is
I call it an obvious misuse and misunderstanding of why you'd use a class in
the first place. Either create an instance and not make these things
classmethods or just share the stuff in a module-level set of variables. But
the instantiating is the best options. Your class attributes might not be
If you are getting to the point where your data is large enough to
really care about the speed of cPickle, then maybe its time you moved
past pickles for your storage format? 2.5 includes sqlite, so you
could persist them in a nice, indexed table or something. Just a
suggestion.
On Jun
On Jun 13, 2008, at 11:17 AM, Jason R. Coombs wrote:
I see a new function in (python 2.6) lib/collections called
namedtuple. This is a great function. I can see many places in my
code where this will be immensely useful.
I have a couple of suggestions.
My first suggestion is to use
On Jun 13, 2008, at 11:56 AM, [EMAIL PROTECTED] wrote:
On Jun 13, 11:48 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] schrieb:
On Jun 13, 11:21 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] schrieb:
I have twenty-five checkboxes I need to create
The point here is that eval() use is general frowned upon. If you
don't understand it or the alternatives, then you probably don't
understand it well enough to make the call on using it or not.
If you need just look up an attribute where the name of the attribute
is in a variable, use
That smells bad the same was the eval() usage in the thread Hard to
understand 'eval'. This is only one pythoners opinion, of course.
On Jun 13, 2008, at 3:29 PM, Jason Scheirer wrote:
for x in xrange(1, 26):
setattr(self, 'checkbox_%i' % x, ...)
--
The sets module is no longer needed, as we have the built-in sets
type. Its even getting a literal syntax soon.
As for the original problem, I agree on the homework smell.
On Jun 15, 2008, at 9:31 PM, takayuki wrote:
Dennis,
thanks for your reply. unfortunately i accidentally posted only
This gets my +1, for what its worth.
I don't really see a good reason not to include the insert() method,
however. I don't see that it would complicate things much, if at all.
d = odict([('a', 42), ('b', 23)])
d.insert(1, ('c', 19))
d
collections.odict([('a', 42), ('c', 19), ('b', 23)])
On Jun 16, 2008, at 12:58 PM, Ethan Furman wrote:
Greetings.
The strip() method of strings works from both ends towards the middle.
Is there a simple, built-in way to remove several characters from a
string no matter their location? (besides .replace() ;)
For example:
.strip --
On Jun 17, 2008, at 2:34 PM, Eduardo Henrique Tessarioli wrote:
Hi,
I am running a very simple python application and I noted that the
memory allocation is something like 4,5M.
This is a problem in my case, because I have to run 2 thousand
process at the same time.
The memory I need is
Upload, wait, and google them.
Seriously tho, aside from using a real indexer, I would build a set
of the words I'm looking for, and then loop over each file, looping
over the words and doing quick checks for containment in the set. If
so, add to a dict of file names to list of words found
I am looking to start a meetup in or near Charlotte. I already have a
couple people interested, and I see some folks subscribing to new
python groups on meetup. If I can find a few more people, it could be
worth it.
Is anyone in the area and interested in a group? Anyone who might want
to do a
Holy crap, did I forget to mention the state and country? I could be a
moron, at times.
This would be Charlotte, North Carolina, the United States of America.
On 7/18/07, Wildemar Wildenburger [EMAIL PROTECTED] wrote:
Calvin Spealman wrote:
I am looking to start a meetup in or near Charlotte
I announced the idea earlier, but forgot to mention the state. I
started a mailing list, and I want to find who in the area might be
interested. Join if you can, even if you don't know you'll stick. We
need to see what kind of interest there is in the area.
If you are in the area, even if you
On 7/22/07, Paul McNett [EMAIL PROTECTED] wrote:
Paul Rubin wrote:
Frank Millman [EMAIL PROTECTED] writes:
Any suggestions will be much appreciated.
Why on earth don't you write the whole thing as a web app instead of
a special protocol? Then just use normal html tags to put images
Look in Modules/_collectionsmodule.c
Pretty much any built-in module will be named thusly.
On 7/22/07, Gordon Airporte [EMAIL PROTECTED] wrote:
I was going to try tweaking defaultdict, but I can't for the life of me
find where the collections module or its structures are defined. Python 2.5.
I was talking to some other people, who all were working on different
schedulers and such for coroutines. We decided to work out a common
API to give coroutines, and common rules to passing data between them,
etc. I am wondering now if there is already work on this, or some
schedulers I'm not
The term scripting language is a pretty misunderstood one these
days. I hold the opinion that what it is supposed to mean can, today,
apply to any language. C, even, is a scripting language. All any of
our software today is doing is calling out to some other component
and simply acting as
My first reaction is that if you have this and dont know how to get
the list from it then maybe you are not as sure as you could be that
you want to have such a string in the first place. Why do you have
this list in a string?
On Dec 11, 2007, at 5:14 PM, katie smith wrote:
How on earth
Why would you do this? How to do it, if its even possible, is far
less important than if you should even attempt it in the first place.
On Dec 11, 2007, at 3:51 PM, Nishkar Grover wrote:
I'm trying to replace a built-in exception type and here's a
simplified
example of what I was hoping
construct the hierarchy of
subclasses, so for example, my subclass of OSError is a subclass of
the built-in OSError and a subclass of my subclass of
EnvironmentError. The only thing left to do is find a way to
replace the built-in exception types with my custom ones.
- Nishkar
Calvin
Don't do that, for a number of reasons. String concatenation is
really never a good idea and formatting your own query strings is
exactly what leads to things like sql injection. Let the db library
handle it for you:
cur.execute('insert into seq(id,sequence) values(3, %s)', (content,))
I agree that the behavior should be more consistant, but you also
should not be calling __init__ more than once on any given instance
and that in and of itself should probably constitute undefined behavior.
On Dec 12, 2007, at 3:22 PM, Neil Cerutti wrote:
List and deque disagree on what
I still hold my vote that if you need to reverse the
stringification of a list, you shouldn't have stringified the list
and lost hold of the original list in the first place. That is the
solution above all others.
On Dec 12, 2007, at 10:26 AM, Paul McGuire wrote:
On Dec 12, 7:25 am, Lee
On Dec 12, 2007, at 11:01 AM, Emin.shopper Martinian.shopper wrote:
Dear Experts,
I love the pickle module, but I occasionally have problems pickling
a function. For example, if I create an instance g of class f and
assign g.x to a function, then I cannot pickle g (example code
On Dec 12, 2007, at 4:05 PM, Neil Cerutti wrote:
On 2007-12-12, Calvin Spealman [EMAIL PROTECTED] wrote:
I agree that the behavior should be more consistant, but you
also should not be calling __init__ more than once on any
given instance and that in and of itself should probably
On Dec 12, 2007, at 11:26 AM, [EMAIL PROTECTED] wrote:
I don't understand what I don't understand in the following:
You also don't understand how to ask for help properly. Your example
is too large, for one. You want a minimal working example (http://
If you need multiple factories you can do so but to do what you're
asking requires both a factory and an instance method initializer,
just like __new__ is a class method and __init__ is an instance
method. One creates and one initializes what is already created.
On Dec 12, 2007, at 12:49
I always recommend the subprocess module for any needs like this.
Read up on it and it should provide everything you need.
On Dec 13, 2007, at 2:41 AM, Caleb Marcus wrote:
I'm writing something that has to invoke an external program, and
every time the external program prints something,
On Dec 12, 2007, at 10:57 PM, katie smith wrote:
Traceback (most recent call last):
File C:\Python25\empire\Empire Strategy.pyw, line 322
Maty = Searched(number)
Look, you're calling Searched right here with Searched(number)
TypeError: 'list' object is not callable
...
Maty
I think we are a ways off from the point where any of the solutions
are well used, matured, and trusted to promote as a Python standard
module. I'd love to see it happen, but even worse than it never
happening is it happening too soon.
On Dec 27, 2007 8:52 AM, Emin.shopper Martinian.shopper
On Thu, Jul 17, 2008 at 7:45 AM, mk [EMAIL PROTECTED] wrote:
Hello everyone,
I'm storing functions in a dictionary (this is basically for cooking up my
own fancy schmancy callback scheme, mainly for learning purpose):
def f2(arg):
... return f2 + arg
...
def f1(arg):
... return
On Thu, Jul 17, 2008 at 2:56 AM, karthikbalaguru
[EMAIL PROTECTED] wrote:
Hi,
I am new to python. I am trying to use the python files given to me
for bringing up a setup.
I get the following error while trying to use a python file -
AttributeError : Classroom instance has no attribute
BeautifulSoup. You need a good html parsing, not some one-shot code to
handle one tiny unflexable pattern.
On Thu, Jul 17, 2008 at 3:07 AM, Alexnb [EMAIL PROTECTED] wrote:
Hello
Lets say I have a string:
--a href=/browse/brick--brick--/a--
The -- needs to be replaced with or where
its a good point you make. if its not _technically_ immutable, why use
__new__ when __init__ would work just as fine? well, if it should be
treated as immutable, then we should do what we can to follow that,
even in internal code that knows otherwise. Besides, maybe down the
road, protections will
This came up again and I was taking a look at it. There seems to still
be no resolution. I have a patch that can add a kwarg to skip this
behavior if you know you need otherwise. Right now its a simple
boolean flag, but is this enough?
Are there any use cases anyone has to define how this case is
dont quote me but i do think this check is being removed.
On Sun, Aug 10, 2008 at 3:42 PM, Patrick Mullen [EMAIL PROTECTED] wrote:
How about:
class A:
def add(self,x,y):
return x+y
class B(A):
pass
print B().add(1, 2)
This also works:
class A:
def add(self, x, y):
for k in foo:
foo[k] += bar.get(k, 0)
On Mon, Aug 11, 2008 at 3:27 AM, Brandon [EMAIL PROTECTED] wrote:
Hi all,
I am not altogether experienced in Python, but I haven't been able to
find a good example of the syntax that I'm looking for in any tutorial
that I've seen. Hope somebody can
You might try subprocess, first of all. Use it to launch zlogin and
then treat it like a shell and write 'zonename\n' to its stdin, to
simulate running it as a user. This is a good bet, but I don't have
either available to try it. The subprocess documentation covers
invoking a process and writing
i = iter(container.iterChildren())
i.next()
for x in i:
...
On Tue, Aug 12, 2008 at 2:51 AM, ray [EMAIL PROTECTED] wrote:
A container object provides a method that returns an iterator object.
I need to iterate the sequence with that iterator, but need to skip
the first item. I can only
The simple answer is Dont nest classes. It is not supported.
What you are seeing is really an artifact of how classes are built.
Basically, everything inside the class body has to exist before it can
run, so the inner classes code objects are actually created first.
However, the class object
Sounds like you might want to read up on RDF
On Tue, Aug 12, 2008 at 10:41 AM, Benjamin Michiels
[EMAIL PROTECTED] wrote:
Hi,
I am curently looking for a library allowing the creation and management of
a thesaurus. Our requirements are the following:
- creation of our own thesaurus (that
The best answer is: Don't do that!
That isn't how you test things. Write test scripts, probably using the
unittest framework. You'll save yourself time and trouble having
easily reproducible tests. Many people suggested reload(), but you
should know it is dangerous. It can have results you don't
Please re-evaluate your need for nesting classes in the first place.
On Tue, Aug 12, 2008 at 1:06 PM, Cousson, Benoit [EMAIL PROTECTED] wrote:
This is a language limitation.
This is because nested scope is implemented for python function only since
2.3
allow late binding of free variables.
object and type both are instances of type. Yes, type is an instance of itself.
type inherits object.
On Tue, Aug 12, 2008 at 1:14 PM, ssecorp [EMAIL PROTECTED] wrote:
super(object, type)
super: class 'object', type object
super(type, object)
super: class 'type', type object
how can both
/pipermail/python-dev/2002-November/029872.html
On Tue, Aug 12, 2008 at 4:40 PM, Maric Michaud [EMAIL PROTECTED] wrote:
Le Tuesday 12 August 2008 15:51:30 Calvin Spealman, vous avez écrit :
The simple answer is Dont nest classes. It is not supported.
I can't agree with this, there are many common
Ruby (on Rails) people love to talk about Ruby (on Rails).
Python people are too busy getting things done to talk as loudly.
On Wed, Aug 13, 2008 at 11:04 AM, D'Arcy J.M. Cain [EMAIL PROTECTED] wrote:
On Wed, 13 Aug 2008 13:47:58 +0200
Álvaro G. Vicario [EMAIL PROTECTED] wrote:
But I've never
On Wed, Aug 13, 2008 at 11:32 AM, Cousson, Benoit [EMAIL PROTECTED] wrote:
Defining it as a nested class saves you one line
of code, but IMHO makes the result just a bit more cluttered, while
reducing the elegance of reusing the metaclass.
The whole point of nested class is to avoid polluting
God forbid I try to make a joke.
On Wed, Aug 13, 2008 at 11:20 AM, Nigel Rantor [EMAIL PROTECTED] wrote:
Calvin Spealman wrote:
Ruby (on Rails) people love to talk about Ruby (on Rails).
Python people are too busy getting things done to talk as loudly.
Have you read this list?
I would
On Wed, Aug 13, 2008 at 7:41 PM, Maric Michaud [EMAIL PROTECTED] wrote:
I was not aware of any nested classes are unsupported before and didn't
consider nested classes as bad practice till now, even with the pickle
limitation (not every class are intended to be pickled), more you didn't give
On Wed, Aug 13, 2008 at 10:49 PM, Carl Banks [EMAIL PROTECTED] wrote:
There is no point of nested classes because nested classes _are not_
supported by python. They are simply an artifact of not actively
denying the syntax non-globally. I would fully support a change to the
language to
On Thu, Aug 14, 2008 at 6:46 PM, Michael Tobis [EMAIL PROTECTED] wrote:
I wrote some code to test the precedence of getitem vs getattr; it
shows that getitem binds tighter.
I have been handed some code that relies on the observed behavior.
However, the Nutshell precedence list claims the
On Fri, Aug 15, 2008 at 10:48 PM, Nadeem [EMAIL PROTECTED] wrote:
I understand the 99% rule... the example I gave was to simplify the
issue. The full thing I'm working on is a library for an introductory
CS class I'm teaching. I'm trying, essentially, to build a library of
macros for students
I'm still on 10.4 and I'm trying to build pyOpenSSL, but I'm failing
with Python.h trying to include and failing to find any of the shared
libraries. I can't figure this one out because i just don't compile
anything non trivial often.
ironfroggy:~/Desktop/pyOpenSSL-0.6 ironfroggy$ python setup.py
I'm trying to find a better way, a shell one-liner, that I can use to
recurse through my project, find all my test_ modules, aggregate the
TestCase classes into a suite, and run all my tests. Basically, what
py.test does out of the box. Why am I having such trouble doing it?
--
Read my blog! I
In the internal API when a C function is called and passed a kwarg
dictionary, is there any case where anything else has a reference to
it? I checked with the following code and it looks like even if you
explicitly pass a dictionary with **kwargs, it still copies the
dictionary anyway.
--
Read
Attending my first meetup tomorrow for the Agile Charlotte group from
meetup.com. My old area, surrounded by cows and corn, had no chance of
getting any meetups, so I'm excited to be back at the city and able to
partake in some community. If anyone by chance is attending, or near
enough to make
This is one of the things that I often see people trying to do in
Python, where the best solution is simply to understand how Python
works and craft the code to work with the language. The problem, in my
view, is not that you don't have a good way to do this once
assignment operation, but that you
This is a case where its up to the type involved. For example,
xrange() slices the way you want but range() does not. Maybe a type
would return for slices a proxy object that got the value by index or
maybe it knows that it makes more sense to give you a copy because
changes during the iteration
Most problems like this are caused by trying to access the attributes
of the module before that module is fully executed, and thus before
they are defined.
For example, if you have A.py:
import B
data = TEST
And B.py:
import A
print A.data
Now, if you run A,py, it will import B before
I am trying to install the newest setuptools on my macbook. 2.3 was
installed by default, and 2.4 is installed and is my default version
now. However, when I try to import setuptools, which is required to
_install_ setuptools, I get this error:
macbkpro1:~/Desktop/setuptools-0.6c7 ironfroggy$
This is something I have been wanting to find for a while, but i
haven't figured out. I really would love to know if there is some way
I can report extra information while running unittests, and have that
information appear along with the tracebacks, so its near the relevent
test's results.
--
On 15 Sep 2006 00:18:14 -0700, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi everyone,
Maybe these questions will sound strange to you, but I sometime have a
hard time switching from Java to Python ;-)
Let's say I have a function like this :
def show_lines(file):
for next_line in
On 15 Sep 2006 19:17:25 -0700, gry@ll.mit.edu gry@ll.mit.edu wrote:
I want a function (or callable something) that returns a random
word meeting a criterion. I can do it like:
def random_richer_word(word):
'''find a word having a superset of the letters of word'''
if len(set(word)
On 9/17/06, Wildemar Wildenburger [EMAIL PROTECTED] wrote:
Hi :)
I'm thinking of letting my program create hardlinks (or symlinks). I
know python allows doing this for ext, reiser and the like, but
apparently not for ntfs systems.
Is there any package out there that lets me create links in a
On 17 Sep 2006 09:22:16 -0700, Ilias Lazaridis [EMAIL PROTECTED] wrote:
I understand that I can use __metaclass__ to create a class which
modifies the behaviour of another class.
How can I add this metaclass to *all* classes in the system?
(In ruby I would alter the Class class)
This is a
On 9/17/06, A.M. Kuchling [EMAIL PROTECTED] wrote:
On Sun, 17 Sep 2006 18:10:51 +0200,
Daniel Nogradi [EMAIL PROTECTED] wrote:
start a new one. What would be very useful though is more visible
links on the python.org site to the activestate repository where
appropriate. I'm not
On 9/17/06, Edward A. Waugh [EMAIL PROTECTED] wrote:
Consider the following code:
import sys
class FirstClass:
def __init__(self, value):
self.data = value
def __add__(self, value):
return FirstClass(self.data + value)
def display(self):
print
On 18 Sep 2006 00:19:20 -0700, JyotiC [EMAIL PROTECTED] wrote:
hi,
i have a prog. and i want diving the code in different files.
there will be one mail file which will call modules or
variables(global) from differnet files
how can i do this.
code is very big and i it's getting difficult to
On 18 Sep 2006 12:44:32 -0700, Sandra-24 [EMAIL PROTECTED] wrote:
A dictionary that can be shared across processes without being
marshaled?
Is there such a thing already for python?
If not is there one for C maybe?
I was just thinking how useful such a thing could be. It's a great way
to
On 18 Sep 2006 12:40:00 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I think I read a suggestion somewhere to wrap the code where a Python
script starts in a main() function, so one has
def main():
print hi
main()
instead of
print hi
What are the advantages of doing this?
It
On 9/18/06, Carl Drinkwater [EMAIL PROTECTED] wrote:
Hi all,
Code Golf's 12th challenge has just been added to the site. It asks you
to calculate the first 1,000 digits of Pi - Something I'm sure most of
you have thought about, but never done. You can see the challenge at :
define new-style classes?
- Edward
Original Message Follows
From: Calvin Spealman [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Edward Waugh [EMAIL PROTECTED]
Subject: Re: Problem with operator overloading and inheritance in Python
Date: Mon, 18 Sep 2006 17:06:53 -0400
On 9/18
On 18 Sep 2006 17:09:22 -0700, citlaly [EMAIL PROTECTED] wrote:
Hi!!
I'm a beginner in python and I'm trying to use the files from a
folder as a list. What I want to do is read each one as a list, but
just the name of the file, the data inside doesn't matter. How can I do
it? I was trying
On 18 Sep 2006 16:33:20 -0700, George Sakkis [EMAIL PROTECTED] wrote:
Calvin Spealman wrote:
Just once, I would like to see a programming contest that was judged
on the quality of your code, not the number of bytes you managed to
incomprehensively hack it down to.
Unfortunately, quality
On 18 Sep 2006 20:23:03 -0700, Ilias Lazaridis [EMAIL PROTECTED] wrote:
Steve Holden wrote:
Ilias Lazaridis wrote:
...
http://www-128.ibm.com/developerworks/linux/library/l-pymeta.html
I am not so much interested in old-style, as is start production with
python 2.4 (possibly even
On 20 Sep 2006 00:27:07 -0700, daniel [EMAIL PROTECTED] wrote:
Hello,
Can anyone explain the main points in working with threads in Python.
Why use threading and not Thread.I have read an article that i have to
subclass the Thread class and override some function.
I repeat this all the time,
On 3 Oct 2006 19:09:53 -0700, SpreadTooThin [EMAIL PROTECTED] wrote:
If you are deriving a new class from another class,
that you must (I assume) know the initializer of the other class.
So in myClass
import array
class myClass(arrary.array):
def __init__(self, now here I need to put
On 10/9/06, Edward Waugh [EMAIL PROTECTED] wrote:
Consider the following (working) Python code:
import sys
def sum(list):
# total = 0 does not work for non-numeric types
total = list[0].__class__()
for v in list:
total += v
return total
l = [1, 2, 3]
print
On 25 Nov 2006 15:27:26 -0800, Ritesh Raj Sarraf [EMAIL PROTECTED] wrote:
Hi,
I have, for very long, been trying to find a consistent solution (which
could work across major python platforms - Linux, Windows, Mac OS X)
for the following problem.
I have a function which downloads files from
On 11/29/06, Tommy Zong [EMAIL PROTECTED] wrote:
Hi,
I am learning metaclass by reading Metaclass programming in Python, Part
2. I have a question as following and had tried to search from internet and
also have read the article Unifying types and classes in Python 2.2 but
failed to
On 29 Nov 2006 07:36:26 -0800, Leandro Ardissone [EMAIL PROTECTED] wrote:
Hi,
I want to know what type is a variable.
For example, I get the contents of an xml but some content is a list or
a string, and I need to know what type it is.
Thanks
--
I have tried repeatedly to make a post to the Image SIG ML, and get nothing but automated responses that I must wait for word from the moderator to approve my posting on the list. I have gotten no reply, positive or not, in over a month. I am assuming the Image SIG moderator is currently MIA. What
On 4 Dec 2006 20:18:22 -0800, Linan [EMAIL PROTECTED] wrote:
Hi,
In javascript, code could be written like this:
...
var _p=XMLHttpRequest();
_p.open('GET',url,true);
_p.send(null);
_p.onreadystateChange=function(){
if(_p.readyState==4)
No matter what I do I cant get the following code to do what I expect.
I hadn't used subprocess t o read and write to pipes of a
still-running app, and I just can't seem to get it right. What gives?
import subprocess
p = subprocess.Popen(python, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
On 12/5/06, Fredrik Lundh [EMAIL PROTECTED] wrote:
Calvin Spealman wrote:
No matter what I do I cant get the following code to do what I expect.
I hadn't used subprocess t o read and write to pipes of a
still-running app, and I just can't seem to get it right. What gives?
import
On 6 Dec 2006 09:41:36 -0800, GHUM [EMAIL PROTECTED] wrote:
imagine:
template= Hello %(name)s, how are you %(action)s
we can use it to do things like:
print template % dict (name=Guido, action=indenting)
Is there an easy (i.e.: no regex) way to do get the names of all
parameters?
On 6 Dec 2006 18:33:26 GMT, Duncan Booth [EMAIL PROTECTED] wrote:
Calvin Spealman [EMAIL PROTECTED] wrote:
I am not aware of anything in the stdlib to do this easily, but its
pretty easy to get them. See this example:
class format_collector(object):
def __init__(self
1 - 100 of 204 matches
Mail list logo