Eric S. Johansson wrote:
> Andreas Roehler wrote:
>> with python-mode.el from
>>
>> http://sourceforge.net/projects/python-mode/
>
> I think there's something wrong with the site because it tells me it's version
> 1.0 from year 2005.
You are right, sorry. I should tell you the present place.
Bar
Hi,
I am using py2exe with pygtk and everything works fine. But when I set
bundle_files to 1 or 2, I get following exception, when starting the
binary:
Traceback (most recent call last):
File "startup.py", line 1, in
File "zipextimporter.pyc", line 82, in load_module
File "foo.pyc", line 4
Rafe wrote:
> In the name of self-education can anyone share some pointers, links,
> modules, etc that I might use to begin learning how to do some
> "metaprogramming".
Fred Brooks, in his classic "Mythical Man-Month", defined "metaprogramming" as
simply a very high-level form of programming, us
Michele Simionato wrote:
> Guido and the Common Lisp implementors are happy with mutating the loop
> index. I myself prefer the functional way.
I'd agree with you, except Python doesn't provide any way to create
user-defined constants, so constant loop indices have no precedent.
--
http://mail.p
On Nov 27, 10:11 am, Lawrence D'Oliveiro <[EMAIL PROTECTED]
central.gen.new_zealand> wrote:
> Michele Simionato wrote:
> > Guido and the Common Lisp implementors are happy with mutating the loop
> > index. I myself prefer the functional way.
>
> I'd agree with you, except Python doesn't provide any
Hi all,
I've got some pickled files representing graphs (using networkx,
http://networkx.lanl.gov if you're interested) that were produced
using version 0.36 of the library.
Now, they have released a new version of the library which is
incompatible with respect to pickled files, so what I'd like
2008/11/27 r0g <[EMAIL PROTECTED]>
> Hi,
>
> I want to use a regex to match a string "poo" but not "poo\n" or
> "poo"+chr(13) or "poo"+chr(10) or "poo"+chr(10)+chr(13)
>
> ...
> Thanks,
>
>
> Roger.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
Hi,
if I understand correctly, that
Hello,
when I set non blocking flag with fcntl on sys.stdin, then sys.stdout
turns into non blocking mode too. Is it normal behaviour? How can I
turn stdin into non blocking mode but not stdout? Thanks.
This is a quick program that shows the (my?) problem:
import fcntl
import os
import sys
print
Stef Mientki a écrit :
Alternative (if you *really* want to save the explicit test) is to
attach the behaviour modification to the *relevant* class:
class NonEvent(Event):
def do_nothing(self):
pass
skip = jump = hop = waltz = saunter = do_nothing
def __len__(self):
return
On Nov 26, 12:09 pm, Bruno Desthuilliers wrote:
> marc wyburn a écrit :
>
> > Hi,
>
> > I've created my firstTkinterGUI class which consists of some buttons
> > that trigger functions. I have also created a
> > tkFileDialog.askdirectory control to local a root folder for log
> > files.
>
> > I ha
della wrote:
> On 27 Nov, 11:21, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>
>> You can't do that. How should python distinguish between the two modules
>> with the same name?
>
> That's why I was trying to import them with different names :)
You weren't. The "as" creates just a local alias
I call a function get_items() which returns a list of items.
However, in some cases, it returns just one item.
It returns the item as an object though, not as a list containing one object.
In other cases it simply returns None.
What is the cleanest way to iterate over the return value of this func
adam carr wrote:
> I call a function get_items() which returns a list of items.
> However, in some cases, it returns just one item.
> It returns the item as an object though, not as a list containing one object.
> In other cases it simply returns None.
>
> What is the cleanest way to iterate over
Hello.
I am interested in using OpenOpt, a numerical optimization framework
in Python.
I've been reading the official documentation about OpenOpt, but it
seems a little confusing to me.
So, this is a question about OpenOpt; sorry if it is too specific for
this forum, but I thought maybe someone
On Nov 26, 4:57 pm, Kaz Kylheku <[EMAIL PROTECTED]> wrote:
> On 2008-11-26, Xah Lee <[EMAIL PROTECTED]> wrote:
>
> > Can you see, how you latched your personal beef about anti software
> > crisis philosophy into this no namespace thread?
>
> I did no such thing. My post was about explaining the de
2008/11/27 Stefan Behnel <[EMAIL PROTECTED]>:
> adam carr wrote:
>> I call a function get_items() which returns a list of items.
>> However, in some cases, it returns just one item.
>> It returns the item as an object though, not as a list containing one object.
>> In other cases it simply returns
Denis kindly provided the following code which does this well:
def mkiter( x ):
""" list -> list, el -> [el], None -> []
usage: for x in mkiter( func returning list or
singleton ): ...
"""
return (x if hasattr( x, "__iter__" ) # list tuple ...
else [] if x is None
el
Bruno Desthuilliers wrote:
Frederic Rentsch a écrit :
Hi,
Where can one get assistance if a Windows installation service fails
to install an msi installer? I used to download zip files, but they
seem to have been replaced with msi files. I know this issue is off
topic here. So my question si
On 27 Nov, 06:20, John O'Hagan <[EMAIL PROTECTED]> wrote:
> Apologies if this is a D.Q., I'm still learning to use classes, and this
> little problem has proved too specific to find in the tutorials.
>
> I have two classes with a relationship that I find confusing.
>
> One is called Engine, and it
On Nov 27, 5:00 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> Refactor until your code is simple enough to unit-test effectively, then
> unit-test effectively.
I suspect you are right...
Ok, thank you!
Manu
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
The project goal is to incorporate the functionality of interaction of
the excel application (gnumeric) with the XO's journal. All the
activities needs to register any change in that datastore (save and
open files are made throw it).
In order to apply this option, we need to call some pyt
Gilles Ganault wrote:
> Hello
>
> I'm trying to read pages from Amazon JP, whose web pages are
> supposed to be encoded in ShiftJIS, and decode contents into Unicode
> to keep Python happy:
>
> www.amazon.co.jp
> />
>
> But this doesn't work:
>
> ==
> m = try.search(the_page)
> if m
On 27 Nov, 11:21, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> You can't do that. How should python distinguish between the two modules
> with the same name?
That's why I was trying to import them with different names :)
> What you can do is
>
> - import the old package
> - unpickle
> - co
On Nov 27, 5:41 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote:
> Given that, can anybody think of an example that you could not do with
> a class? (excepting the "stored procedure" aspect)
The namedtuple recipe by Raymond Hettinger (http://
code.activestate.com/recipes/500261)
is an interest
Asun Friere a écrit :
On Nov 27, 6:11 am, Nan <[EMAIL PROTECTED]> wrote:
Hello,
I just started to use Python. I wrote the following code and
expected 'main' would be called.
def main():
print "hello"
main
Not an answer to your question, but I dislike functions named 'main'
because the s
della wrote:
> Hi all,
>
> I've got some pickled files representing graphs (using networkx,
> http://networkx.lanl.gov if you're interested) that were produced
> using version 0.36 of the library.
>
> Now, they have released a new version of the library which is
> incompatible with respect to pi
On Thu, 27 Nov 2008 01:00:28 +, MRAB <[EMAIL PROTECTED]>
wrote:
>No problem here:
>
> >>> import urllib
> >>> data = urllib.urlopen("http://www.amazon.co.jp/";).read()
> >>> decoded_data = data.decode("shift-jis")
> >>>
Thanks, but it seems like some pages contain ShiftJIS mixed with some
othe
r0g wrote:
Hi,
I want to use a regex to match a string "poo" but not "poo\n" or
"poo"+chr(13) or "poo"+chr(10) or "poo"+chr(10)+chr(13)
"\n" is the same as chr(10).
According to http://docs.python.org/library/re.html
'.' (Dot.) In the default mode, this matches any character except a
newlin
On Mon, 2008-11-17 at 14:52 +, Darren Mansell wrote:
> Hi.
>
> I'm relatively new to python so please be gentle :)
>
> I'm trying to write a £ symbol to an MS SQL server using pymsssql . This
> works but when selecting the data back (e.g. using SQL management
> studio) the £ symbol is replac
Steven D'Aprano wrote:
> If you don't test all the paths, then by definition you
> have program paths which have never been tested. Unless those paths are
> so trivially simple that you can see that they must be correct just by
> looking at the code, then the chances are very high that they will
You must install numpy or scipy before installing matplotlib. If you
do not want to do it yourself you cand download
Scipy superpack
"This shell script will install recent SVN builds of Numpy (1.3) and
Scipy (0.7), as well as Matplotlib (0.98), iPython (0.8.3) and PyMC
(2.0 beta) for OS X 10.5 (Le
You must install numpy or scipy before installing matplotlib. If you
do not want to do it yourself you cand download
Scipy superpack
"This shell script will install recent SVN builds of Numpy (1.3) and
Scipy (0.7), as well as Matplotlib (0.98), iPython (0.8.3) and PyMC
(2.0 beta) for OS X 10.5 (Le
Hi everybody,
I know how to document a function or a method, with a docstring (see below
for "foo" method documentation ("bar")).
But, how to document a property (below, self.d)?
###
class a():
def __init__( self ):
self.d = 2
def foo( self ):
"bar"
b=a()
pr
On 26 nov, 23:22, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
> On Nov 27, 12:21 am, [EMAIL PROTECTED] wrote:
>
>
>
> > Hi,
>
> > I'm using a simple form to make possible the users of our site upload
> > files.
>
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
> >
Eric S. Johansson wrote:
Andreas Roehler wrote:
with python-mode.el from
http://sourceforge.net/projects/python-mode/
I think there's something wrong with the site because it tells me it's version
1.0 from year 2005.
Meanwhile I'll reflect a draft addressing your needs.
there is a rather
adam carr wrote:
2008/11/27 Stefan Behnel <[EMAIL PROTECTED]>:
adam carr wrote:
I call a function get_items() which returns a list of items.
However, in some cases, it returns just one item.
It returns the item as an object though, not as a list containing one object.
In other cases it simply r
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Nov 27, 2008, at 3:13 AM, Andreas Roehler wrote:
Eric S. Johansson wrote:
Andreas Roehler wrote:
with python-mode.el from
http://sourceforge.net/projects/python-mode/
I think there's something wrong with the site because it tells me
it's v
In article <[EMAIL PROTECTED]>,
Stefan Behnel <[EMAIL PROTECTED]> wrote:
> Not to mention that you can sometimes look at awfully trivial code three
> times and only see the obvious bug in that code the fourth time you put an
> eye on it a good night's sleep later.
Or never see it.
Lately, I've
In article <[EMAIL PROTECTED]>,
"adam carr" <[EMAIL PROTECTED]> wrote:
> I call a function get_items() which returns a list of items.
> However, in some cases, it returns just one item.
> It returns the item as an object though, not as a list containing one object.
> In other cases it simply retu
On Nov 26, 7:29 am, Xah Lee <[EMAIL PROTECTED]> wrote:
> ...
It's mostly a problem of culture.
If you look, for example, at chinese names, the name space is not that
much important:
"Xee Laa" only takes this space:
" "
^^^
Instead, if you take a typical english name, say, "Abraham Lin
Hi,
I'm the maintainer of an asynchronous FTP server implementation based
on asyncore.
Some days ago I thought it would be interesting to add a class
offering the possibility to run the asyncore loop into a thread so
that a user can run the server without blocking the entire
application.
It could b
Quoting TP <[EMAIL PROTECTED]>:
> d :
> int(x[, base]) -> integer
>
> Convert a string or number to an integer, if possible. A floating point
> argument will be truncated towards zero (this does not include a string
> representation of a floating point number!) When converting a string, use
>
Xah Lee wrote:
this one is published a decade ago by a lisp [sic] dignitary.
Its theory of programing [sic] and software engineering is poetry and
taoism [sic].
It suggests that C will be the last lang.
In a paroxysm of precognitive genius, seemingly.
--
Lew
--
http://mail.python.org/mailman/l
On 27 nov, 15:13, [EMAIL PROTECTED] wrote:
> On 26 nov, 23:22, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Nov 27, 12:21 am, [EMAIL PROTECTED] wrote:
>
> > > Hi,
>
> > > I'm using a simple form to make possible the users of our site upload
> > > files.
>
> > >
> > >
> > >
>
[EMAIL PROTECTED] wrote:
It's mostly a problem of culture.
If you look, for example, at chinese [sic] names, the name space is not that
much important:
"Xee Laa" only takes this space:
" "
^^^
Chinese names are presumably not spelled with Roman letters in Chinese, so
this really sa
On Nov 27, 8:57 am, Roy Smith <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> "adam carr" <[EMAIL PROTECTED]> wrote:
>
> > I call a function get_items() which returns a list of items.
> > However, in some cases, it returns just one item.
> > It returns the item as an object though,
"Aaron Brady" <[EMAIL PROTECTED]> wrote:
>On Nov 26, 10:41 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]>
>wrote:
>> "Steven D'Aprano" wrote:
>>
>>
>>
>> > Well, I don't know about "any problem". And it's not so much about
>> > whether metaprograms can solve problems that can't be solved by anythi
<[EMAIL PROTECTED]> wrote:
On 26 Nov, 13:42, Steve Holden <[EMAIL PROTECTED]> wrote:
>> One approach would be to run the socket code in blocking mode in a
>> separate thread started by the (main program) GUI thread at program
>> startup, and communicating results back via a Queue.Queue or simil
"Steven D'Aprano" <[EMAIL PROTECTED]>
>GUI designer. You write a program to let the user create code by clicking
>buttons, dragging objects, drawing lines, etc. The GUI designer may use
>classes, but the purpose of those classes is to generate source code.
>
Yikes, this is getting hairy- If "
"Kay Schluehr" <[EMAIL PROTECTED]> wrote:
>
> I just noticed that corepy 1.0 [1] has been released. Corepy is an
> embedded DSL for synthesizing machine code from chaining Python
> commands. This means it provides objects and exploits control
> structures used to create machine code that can f
"Michele Simionato" <[EMAIL PROTECTED]> wrote:
>The namedtuple recipe by Raymond Hettinger (http://
>code.activestate.com/recipes/500261)
>is an interesting example of code generation. My own decorator module
>use a similar
>trick. Here code generation (plus eval/exec) is needed since you need
>c
On Nov 27, 5:00 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> Refactor until your code is simple enough to unit-test effectively, then
> unit-test effectively.
Ok, I've taken this wise suggestion on board and of course I found
immediately ways to improve the method. -However- this generates
ano
On Fri, 28 Nov 2008 04:20:22 +0100, Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote:
If you are not already doing it, you need to make a "stutter thread"
by using the after() call on some gui object to periodically check for
input on the queue.
You don't need to in fact: from the secondary thread
"Terry Reedy" <[EMAIL PROTECTED]> wrote:
> Hendrik van Rooyen wrote:
>
> > I am using the term in the restricted sense of Python writing Python source.
> >
> > Given that, can anybody think of an example that you could not do with
> > a class? (excepting the "stored procedure" aspect)
>
> I am
Here is the situation:
$ ls
test
$ cd test
$ ls
__init__.py data.py
$ cat __init__.py
$ cat data.py
DATA = {}
$ cd ..
$ python
>>> import os
>>> from test.data import DATA
>>> DATA['something'] = 33
>>> os.chdir('test')
>>> from data import DATA as NEW_DATA
>>> DATA
{'something': 33}
>>> NEW_DAT
Viktor Kerkez wrote:
> Here is the situation:
>
> $ ls
> test
> $ cd test
> $ ls
> __init__.py data.py
> $ cat __init__.py
>
> $ cat data.py
> DATA = {}
>
> $ cd ..
> $ python
import os
from test.data import DATA
DATA['something'] = 33
os.chdir('test')
from data import
"Gilles Ganault" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Thu, 27 Nov 2008 01:00:28 +, MRAB <[EMAIL PROTECTED]>
wrote:
No problem here:
>>> import urllib
>>> data = urllib.urlopen("http://www.amazon.co.jp/";).read()
>>> decoded_data = data.decode("shift-jis")
>>>
T
I have a while iterates forever. I would like to trap a SIGTERM signal
and execute some clean up code. How would I do this in python? Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Emanuele D'Arrigo wrote:
On Nov 27, 5:00 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
Refactor until your code is simple enough to unit-test effectively, then
unit-test effectively.
Ok, I've taken this wise suggestion on board and of course I found
immediately ways to improve the method. -Ho
On Nov 27, 6:42 pm, Viktor Kerkez <[EMAIL PROTECTED]> wrote:
> Is this a bug?
It is not a bug: the dictionaries are different because they are
loaded from different modules.
>>> import os
>>> import test.data
>>> test.data
>>> os.chdir('test')
>>> import data
>>> data
>>> test.data is data
Fals
Hi,
If I do:
>>> a=("1","2")
>>> b=[("3","4"),("5","6")]
>>> list(a)+b
['1', '2', ('3', '4'), ('5', '6')]
I would like rather to obtain:
[('1', '2'), ('3', '4'), ('5', '6')]
Am I compelled to do:
>>> c=[]
>>> c.append(a)
>>> c+b
[('1', '2'), ('3', '4'), ('5', '6')]
Thanks
Julien
--
python
TP:
> >>> a=("1","2")
> >>> b=[("3","4"),("5","6")]
> >>> list(a)+b
> ['1', '2', ('3', '4'), ('5', '6')]
>>> a = ("1", "2")
>>> b = [("3", "4"), ("5", "6")]
>>> [a] + b
[('1', '2'), ('3', '4'), ('5', '6')]
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
Emanuele D'Arrigo:
>I can fragment the code of the original method into one public method and a
>few private support methods.<
Python also support nested functions, that you can put into your
method. The problem is that often unit test functions aren't able to
test nested functions.
A question
tekion wrote:
> I have a while iterates forever. I would like to trap a SIGTERM signal
> and execute some clean up code. How would I do this in python? Thanks.
look into module "signal"
Diez
--
http://mail.python.org/mailman/listinfo/python-list
Hendrik van Rooyen wrote:
"Terry Reedy" <[EMAIL PROTECTED]> wrote:
Hendrik van Rooyen wrote:
I am using the term in the restricted sense of Python writing Python source.
Given that, can anybody think of an example that you could not do with
a class? (excepting the "stored procedure" aspec
My code:
from time import time
def leibniz(terms):
acc = 0.0
num = 4.0 # numerator value remains constant in the series
den = 1
count = 0
start_time = 0.0
for aterm in range(terms):
nextterm = num/den * (-1)**aterm # (-1) allows fractions to
alternate
On 27 Nov., 06:11, Rafe <[EMAIL PROTECTED]> wrote:
> On Nov 27, 11:41 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > "Steven D'Aprano" wrote:
>
> > > Well, I don't know about "any problem". And it's not so much about
> > > whether metaprograms can solve problems that can't be sol
Very simple question: how do you apply a decorator to an entire
module? an idea whose time has properly arrived is to merge pyjamas
(http://pyjs.org) into web2py (http://web2py.com), and to do that,
it's necessary to "identify" functions, classes, global variables and
modules that should be compil
willie wrote:
> My code:
>
> from time import time
> def leibniz(terms):
>
>
> acc = 0.0
> num = 4.0 # numerator value remains constant in the series
> den = 1
> count = 0
> start_time = 0.0
> for aterm in range(terms):
> nextterm = num/den * (-1)**aterm # (-1)
lkcl> Very simple question: how do you apply a decorator to an entire
lkcl> module?
Function-by-function or class-by-class. There is no decorator support for
modules.
--
Skip Montanaro - [EMAIL PROTECTED] - http://smontanaro.dyndns.org/
--
http://mail.python.org/mailman/listinfo/python
My beta testers are complaining about excessive memory usage. It's a
wxPython app with several embedded mozilla activex controls and a local
web server.
Unfortunately, Python has some problems in this area. In particular,
since ubiquitous lists and dictionaries are dynamically resized as
ne
"adam carr" <[EMAIL PROTECTED]> writes:
> Denis kindly provided the following code which does this well:
>
> def mkiter( x ):
>""" list -> list, el -> [el], None -> []
>usage: for x in mkiter( func returning list or
> singleton ): ...
>"""
>return (x if hasattr( x, "__iter__" )
On Nov 27, 7:43 pm, [EMAIL PROTECTED] wrote:
> lkcl> Very simple question: how do you apply a decorator to an entire
> lkcl> module?
>
> Function-by-function or class-by-class. There is no decorator support for
> modules.
awWww! i'm going to quietly throw my toys out of my pram.
... but
Viktor Kerkez <[EMAIL PROTECTED]> writes:
> Here is the situation:
>
> $ ls
> test
> $ cd test
> $ ls
> __init__.py data.py
> $ cat __init__.py
>
> $ cat data.py
> DATA = {}
>
> $ cd ..
> $ python
import os
from test.data import DATA
DATA['something'] = 33
os.chdir('test')
On Nov 27, 2:54 pm, lkcl <[EMAIL PROTECTED]> wrote:
> On Nov 27, 7:43 pm, [EMAIL PROTECTED] wrote:
>
> > lkcl> Very simple question: how do you apply a decorator to an entire
> > lkcl> module?
>
> > Function-by-function or class-by-class. There is no decorator support for
> > modules.
>
>
>> Function-by-function or class-by-class. There is no decorator
>> support for modules.
lkcl> ... but seriously - doesn't that strike people as... a slightly
lkcl> odd omission?
Decorators are still a new feature in the language and were purposely added
in an incremental fashion
lkcl <[EMAIL PROTECTED]> writes:
> On Nov 27, 7:43 pm, [EMAIL PROTECTED] wrote:
>> lkcl> Very simple question: how do you apply a decorator to an entire
>> lkcl> module?
>>
>> Function-by-function or class-by-class. There is no decorator support for
>> modules.
>
> awWww! i'm going to qu
Diez B. Roggisch wrote:
della wrote:
On 27 Nov, 11:21, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
You can't do that. How should python distinguish between the two modules
with the same name?
That's why I was trying to import them with different names :)
You weren't. The "as" creates jus
Hello,
I am getting the following error and my script is bailing out because
of it. I have tried capturing it but it does not seem to work. Below
is the error:
ValueError: I/O operation on closed file
the above error is received when, the following code snippet is
executed:
try:
Ken> Unfortunately, Python has some problems in this area. In
Ken> particular, since ubiquitous lists and dictionaries are dynamically
Ken> resized as needed, memory fragmentation seems inevitable.
That's not necessarily true. Also, I would say that Python has made
tradeoffs in this
On 18 Nov., 21:40, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Tue, 18 Nov 2008 09:41:46 -0200, Christan K. <[EMAIL PROTECTED]> escribió:
>
> > ckkart gmail.com> writes:
> >> on XP when starting a certainexternalprogram (plain C calculation
> >> program which communicates via stdout/fs) fr
tekion schrieb:
Hello,
I am getting the following error and my script is bailing out because
of it. I have tried capturing it but it does not seem to work. Below
is the error:
ValueError: I/O operation on closed file
the above error is received when, the following code snippet is
executed:
lkcl schrieb:
On Nov 27, 7:43 pm, [EMAIL PROTECTED] wrote:
lkcl> Very simple question: how do you apply a decorator to an entire
lkcl> module?
Function-by-function or class-by-class. There is no decorator support for
modules.
awWww! i'm going to quietly throw my toys out of my pram.
But this means that there is no way to create a safe Singleton in
python, because the classes are also created twice.
This is the problem that I encountered. I created a complex
implementation of a Singleton pattern using metaclasses because I
needed the __init__ method to be called just once and
A better way to do this was http://pastebin.com/m1130d1fe :)
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
>> >>> a=("1","2")
>> >>> b=[("3","4"),("5","6")]
>> >>> list(a)+b
>> ['1', '2', ('3', '4'), ('5', '6')]
>
a = ("1", "2")
b = [("3", "4"), ("5", "6")]
[a] + b
> [('1', '2'), ('3', '4'), ('5', '6')]
Thanks a lot.
Why this difference of behavior between list
TP schrieb:
[EMAIL PROTECTED] wrote:
a=("1","2")
b=[("3","4"),("5","6")]
list(a)+b
['1', '2', ('3', '4'), ('5', '6')]
a = ("1", "2")
b = [("3", "4"), ("5", "6")]
[a] + b
[('1', '2'), ('3', '4'), ('5', '6')]
Thanks a lot.
Why this difference of behavior between list(a) and [a]?
Because th
On Thu, Nov 27, 2008 at 2:39 PM, TP <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>
>>> >>> a=("1","2")
>>> >>> b=[("3","4"),("5","6")]
>>> >>> list(a)+b
>>> ['1', '2', ('3', '4'), ('5', '6')]
>>
> a = ("1", "2")
> b = [("3", "4"), ("5", "6")]
> [a] + b
>> [('1', '2'), ('3', '4'
Hello fellow Python Advocates!
Help me promote Python to a larger audience.
An introduction to SketchUp:
I don't know if you are familiar with "Google Sketchup". It is the
best 3d CAM program available.
If you have not checked it out and do modeling of any kind, or want to
lea
TP wrote:
[EMAIL PROTECTED] wrote:
a=("1","2")
b=[("3","4"),("5","6")]
list(a)+b
['1', '2', ('3', '4'), ('5', '6')]
a = ("1", "2")
b = [("3", "4"), ("5", "6")]
[a] + b
[('1', '2'), ('3', '4'), ('5', '6')]
Thanks a lot.
Why this difference of behavior between list(a) and [a]?
list(a) itera
On Thu, Nov 27, 2008 at 12:33 PM, tekion <[EMAIL PROTECTED]> wrote:
> Hello,
> I am getting the following error and my script is bailing out because
> of it. I have tried capturing it but it does not seem to work. Below
> is the error:
>
> ValueError: I/O operation on closed file
>
>
> the above e
On Thu, Nov 27, 2008 at 3:18 PM, r <[EMAIL PROTECTED]> wrote:
> Hello fellow Python Advocates!
> Help me promote Python to a larger audience.
>
> An introduction to SketchUp:
>
> I don't know if you are familiar with "Google Sketchup". It is the
> best 3d CAM program available.
On Thu, Nov 27, 2008 at 2:36 PM, Viktor Kerkez <[EMAIL PROTECTED]> wrote:
> A better way to do this was http://pastebin.com/m1130d1fe :)
> --
> http://mail.python.org/mailman/listinfo/python-list
>
The Python position on singletons is generally to just use a module
instead (preferred), or apply th
On Nov 27, 5:27 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
> On Thu, Nov 27, 2008 at 3:18 PM, r <[EMAIL PROTECTED]> wrote:
> > Hello fellow Python Advocates!
> > Help me promote Python to a larger audience.
>
> > An introduction to SketchUp:
> >
> > I don't know if you are f
On Thu, Nov 27, 2008 at 3:33 PM, r <[EMAIL PROTECTED]> wrote:
> On Nov 27, 5:27 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
>> On Thu, Nov 27, 2008 at 3:18 PM, r <[EMAIL PROTECTED]> wrote:
>> > Hello fellow Python Advocates!
>> > Help me promote Python to a larger audience.
>>
>> > An introductio
On Nov 27, 5:38 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
> On Thu, Nov 27, 2008 at 3:33 PM, r <[EMAIL PROTECTED]> wrote:
> > On Nov 27, 5:27 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
> >> On Thu, Nov 27, 2008 at 3:18 PM, r <[EMAIL PROTECTED]> wrote:
> >> > Hello fellow Python Advocates!
>
[EMAIL PROTECTED] wrote:
Emanuele D'Arrigo:
I can fragment the code of the original method into one public method and a few
private support methods.<
Python also support nested functions, that you can put into your
method. The problem is that often unit test functions aren't able to
test nest
Decorators are syntactic sugar. They add no functionality.
@decorator
def/class possibly_long_name ...
abbreviates
def/class possibly_long_name ...
possibly_long_name = decorator(possibly_long_name)
thereby warning the reader at the beginning that possibly_long_name will
be rebound and avoid
On Nov 27, 5:42 pm, r <[EMAIL PROTECTED]> wrote:
> On Nov 27, 5:38 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Thu, Nov 27, 2008 at 3:33 PM, r <[EMAIL PROTECTED]> wrote:
> > > On Nov 27, 5:27 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote:
> > >> On Thu, Nov 27, 2008 at 3:18 PM, r <[EM
r wrote:
Hello fellow Python Advocates!
Help me promote Python to a larger audience.
An introduction to SketchUp:
There is no need to puff up Python or put down Ruby to this audience.
Given how much Google uses Python as a core language, I am a bit shocked
that they would
1 - 100 of 144 matches
Mail list logo