Thanks everyone for the help. This script is just a one-shot thingie
on my work host, not as a web script or anything professional.
On Mon, 17 Aug 2009 17:05:28 -0700 (PDT), Jonathan Gardner
wrote:
>Unfortunately, there isn't any string to date parsers in the built-
>ins. Not to worry, though, si
> > Is it possible to split up a class definition over multiple files?
>
> Not exactly, but you can do variations of this:
... [subclass a class]
> Steven
Thanks Steven.
I guess I will just preprocess the script:
cat partA.py > class.py
cat partB >> class.py
python class.py
--
http://mail.pyth
Gilles Ganault writes:
> Thanks everyone for the help. This script is just a one-shot thingie
> on my work host, not as a web script or anything professional.
>
> On Mon, 17 Aug 2009 17:05:28 -0700 (PDT), Jonathan Gardner
> wrote:
> >r"(?P\d+)\s+(?P\w+)\s+(?P\d+)"
>
> I've never seen regexes
naveen writes:
> I guess I will just preprocess the script:
>
> cat partA.py > class.py
> cat partB >> class.py
> python class.py
>
This, to me, is a programming smell; not necessarily bad, but an
indicator of bad practice. What is the problem you're trying to solve?
I'll wager there are bette
Sreejith K schrieb:
Hi,
I know this is not the best way to do it. But I have to do it at least
to make it *hard* to decompile the python bytecode.
I want to distribute a software written in Python without the source.
So I compiled Python from source changing some opcode values (Taking
care of H
On Aug 18, 12:19 pm, "Diez B. Roggisch" wrote:
> Did you try installing the egg *without* pyc-files in there? Because
> naturally those shouldn't work. They shouldn't crash the interpreter
> either, but then again - you *did* modify it.
Hi Diez, thanks for the immediate reply :)
I installed the
On Tue, 18 Aug 2009 17:10:50 +1000, Ben Finney
wrote:
>Luckily, you have access to the documentation to find out.
I never used groups before. Thanks for showing me.
At this point, the script is almost done, but the regex fails if the
month contains accented characters (eg. "Août", but fine if e
Am 2009-08-17 21:10, schrieb kj:
I'm looking for a good Python package for visualizing
scientific/statistical data. (FWIW, the OS I'm interested in is
Mac OS X).
The users of this package will be experimental biologists with
little programming experience (but currently learning Python).
SciDA
Could you let me know which platform this is on (Windows, *nix)? It may be a
locale encoding issue -- the locale.setlocale() function allows the second
argument to be a tuple of (locale_code, encoding), as below:
locale.setlocale(locale.LC_ALL, ('FR', 'UTF-8'))
Since this is for a one-shot (and
This is a repost from two weeks ago. It didn't get much feedback last
time. I still keep trying, reposting to python-list also this time.
In this thread, I'd like to collect things that ought to be done
but where Dirkjan has indicated that he would prefer if somebody else
did it.
Item 1
--
Th
On Tue, 18 Aug 2009 01:11:20 -0700, Rami Chowdhury
wrote:
>Could you let me know which platform this is on (Windows, *nix)? It may be a
>locale encoding issue -- the locale.setlocale() function allows the second
>argument to be a tuple of (locale_code, encoding), as below:
>
>locale.setlocale(lo
On Tue, Aug 18, 2009 at 10:12, "Martin v. Löwis" wrote:
> In this thread, I'd like to collect things that ought to be done
> but where Dirkjan has indicated that he would prefer if somebody else
> did it.
I think the most important item here is currently the win32text stuff.
Mark Hammond said he w
Hi,
I have to call a perl method which takes a hash as its argument from a python
module. Is there a way to convert python dictionary to perl hash ( not hash
ref)?
Thanks,
Srini
See the Web's breaking stories, chosen by people like you. Check out
Yahoo! Buzz. http://in.buzz.yahoo.com/
Hello Everyone,
I would like to know if it is possible to extract a sub-list from a
list ?
typically if :
L =[[1, 2, 3],[4, 5, 6],[3] ]
How to extract easily the elements 0 and 2 of L in order to get :
L2 =[[1, 2, 3],[3] ]
Moreover, I would like to know if it is possible to use logical
indexa
On 2009-08-17, Sjoerd Mullender wrote:
> Also in The Netherlands, ZIP codes are much more fine-grained than in
> some other countries: ZIP code plus house number together are sufficient
> to uniquely identify an address. I.e. you don't need the street name.
> E.g., my work address has ZIP code 1
هاني الموصلي schrieb:
Please could you lead me to a way or a good IDE that makes developing
huge projects in python more easier than what i found.Now i am using
eclips. Actually it is very hard to remember all my classes methods
and attributes or copy and paste them each time.
Thanks very much fo
http://www.stephenwolfram.com/publications/recent/mathml/index.html
i was trying to find the publication date and context, but didn't find
it last time after a couple min. Yesterday, on rereading, i did. The
article in question is:
«
Mathematical Notation: Past and Future (2000)
Stephen Wolfram
On Mon, Aug 17, 2009 at 3:47 AM, srinivasan
srinivas wrote:
> Hi,
> I have to call a perl method which takes a hash as its argument from a python
> module. Is there a way to convert python dictionary to perl hash ( not hash
> ref)?
How are you calling the Perl method from Python in the first pla
On 18 Aug, 05:19, [email protected] wrote:
>
> Yes, I agree. I should have mentioned this as an exception
> in my "wikis suck" diatribe. Although it far better than
> most wiki's I've seen, it is still pretty easy to find signs
> of typical wiki-ness. On the Documentation page my first
> click was
> Python doesn't like the above:
>
> #locale.Error: unsupported locale setting
> locale.setlocale(locale.LC_ALL, ('FR', 'UTF-8'))
>
> Maybe it was introduced in more recent versions of Python?
Hmm, that's odd. According to the docs
(http://docs.python.org/library/locale.html#locale.setlocale) it's
On Aug 18, 11:24 am, Stefan Behnel wrote:
> inder wrote:
> > On Aug 17, 8:31 pm, John Posner wrote:
> >>> Use the iterparse() function of the xml.etree.ElementTree package.
> >>>http://effbot.org/zone/element-iterparse.htm
> >>>http://codespeak.net/lxml/parsing.html#iterparse-and-iterwalk
> >>> S
Sreejith K wrote:
> On Aug 18, 12:19 pm, "Diez B. Roggisch" wrote:
>
>> Did you try installing the egg *without* pyc-files in there? Because
>> naturally those shouldn't work. They shouldn't crash the interpreter
>> either, but then again - you *did* modify it.
>
> Hi Diez, thanks for the immed
On Tue, 18 Aug 2009 10:52:41 +0200, Gilles Ganault
wrote:
>I find it odd that the regex library can't handle European characters
>:-/
Ha, found it! :-)
http://www.regular-expressions.info/python.html
=
# -*- coding: latin-1 -*-
import locale
import re
locale.setlocale(locale.LC_ALL,
[email protected] writes:
> I took a look at the PHP docs last night which seem pretty well
> done. The User Comments looked rather as I expected, there was
> useful info but most did not contain documentation quality writing.
> So if they are used as a source for improving the docs, there
> clearly
inder wrote:
> Is lxml part of standard python package ? I am having python 2.5 .
No, that's why I suggested ElementTree first.
> I might not be able to use any additional package other than the
> standard python . Could you please suggest something part of standard
> python package ?
No, there
On Monday 17 August 2009 23:06:04 Carl Banks wrote:
> On Aug 17, 10:03 am, Jean-Michel Pichavant
>
> wrote:
> > I'm no English native, but I already heard women/men referring to a
> > group as "guys", no matter that group gender configuration. It's even
> > used for group composed exclusively of w
Gilles Ganault writes:
> dateinscription = "11 Août 2008"
For any text string that's not ASCII, you should specify it as Unicode.
(Actually, you should specify text as Unicode anyway.) For a literal
text string:
dateinscription = u"11 Août 2008"
If you're using exclusively Python 3, you wi
On Tuesday 18 August 2009 06:45:39 Aahz wrote:
> In article ,
>
> Steven D'Aprano wrote:
> >The comments were made a week ago -- why the sudden flurry of attention?
>
> Mainly an opportunity to flog the new diversity list.
Here my English fails me - flog as in "whip", or flog as in "sell"?
- He
I'm scripting a superkaramba theme using python and have intgrated output
from amarok. I have also would like to show the artist and song title from
a radio stream i've added to my playlist.
If I open a python console and add the following:
>>>import urllib2
>>>from urllib2 import urlopen
>>>now
I'm scripting a superkaramba theme using python and have intgrated output
from amarok. I have also would like to show the artist and song title from
a radio stream i've added to my playlist.
If I open a python console and add the following:
">>>import urllib2"
">>>from urllib2 import urlopen"
">
On Mon, Aug 17, 2009 at 11:10:25AM -0700, seldan24 wrote:
>
> I didn't even notice the higher level methods. I changed the
> retrieval line to:
>
> ftp.nlst("testfile*.txt")
>
> This works great. The result is even captured in an array. I really
> have no idea what the difference between a LI
On Tue, 18 Aug 2009 20:03:47 +1000, Ben Finney
wrote:
>The principles of handling text in Python: Get it to internal Unicode
>objects as soon as possible, handle it as Unicode for as long as
>possible, and only encode it to some byte stream for output as late as
>possible.
Thanks much for the tip
On Tue, 2009-08-18 at 08:46 +0200, Diez B. Roggisch wrote:
<هاني الموصلي schrieb:
> > Please could you lead me to a way or a good IDE that makes developing
> > huge projects in python more easier than what i found.Now i am using
> > eclips. Actually it is very hard to remember all my classes metho
Gilles Ganault writes:
> On Tue, 18 Aug 2009 20:03:47 +1000, Ben Finney
> wrote:
> >The principles of handling text in Python: Get it to internal Unicode
> >objects as soon as possible, handle it as Unicode for as long as
> >possible, and only encode it to some byte stream for output as late as
Hendrik van Rooyen writes:
> On Tuesday 18 August 2009 06:45:39 Aahz wrote:
> > Mainly an opportunity to flog the new diversity list.
>
> Here my English fails me - flog as in "whip", or flog as in "sell"?
Yes :-)
--
\ “The most common of all follies is to believe passionately in |
`\
Xah Lee wrote:
> This feature is important in practical ways. For example, when you
> work with “tab separated line” files (CSV) that's a common format for
> importing/exporting address books or spreadsheets.
CSV stands for "comma separated values" and the import facilities of any
spreadsheet ap
Sleepy Cabbage wrote:
> I'm scripting a superkaramba theme using python and have intgrated output
> from amarok. I have also would like to show the artist and song title from
> a radio stream i've added to my playlist.
>
> If I open a python console and add the following:
>
> ">>>import urllib2"
MRAB wrote:
Carl Banks wrote:
On Aug 17, 10:03 am, Jean-Michel Pichavant
wrote:
I'm no English native, but I already heard women/men referring to a
group as "guys", no matter that group gender configuration. It's even
used for group composed exclusively of women. Moreover it looks like a
*very
On 18/08/2009 6:20 PM, Dirkjan Ochtman wrote:
On Tue, Aug 18, 2009 at 10:12, "Martin v. Löwis" wrote:
In this thread, I'd like to collect things that ought to be done
but where Dirkjan has indicated that he would prefer if somebody else
did it.
I think the most important item here is currentl
I think i found a good managable solution. Actually it is trivial but
may help (I used it now).
When i wnat to access the list then i assign the object which i want
to access to a variable ex:
1)x=AutomataBranch()
2)x=self.cfgAutomata[i]
The first line is used only to make the IDE knows that x is
On 03:56 am, [email protected] wrote:
[email protected] wrote:
There's a lot of things in Python that I don't strictly *need*. That
doesn't mean that they wouldn't be welcome if I could have them.
Getting rid of the range/xrange dichotomy would improve things.
The developers agreed a
On Tue, Aug 18, 2009 at 13:32, Mark Hammond wrote:
> I can make time, somewhat spasmodically, starting fairly soon. Might I
> suggest that as a first task I can resurrect my old stale patch, and you can
> arrange to install win32text locally and start experimenting with how mixed
> line-endings ca
On Tue, 18 Aug 2009 13:21:59 +0200, Peter Otten wrote:
> Sleepy Cabbage wrote:
>
>> I'm scripting a superkaramba theme using python and have intgrated
>> output from amarok. I have also would like to show the artist and song
>> title from a radio stream i've added to my playlist.
>>
>> If I open
Ben Finney wrote:
>>> The principles of handling text in Python: Get it to internal Unicode
>>> objects as soon as possible, handle it as Unicode for as long as
>>> possible, and only encode it to some byte stream for output as late as
>>> possible.
> Again, note that these recommendations hold for
Sleepy Cabbage wrote:
> This is the script up to where the error seems to fall:
>
> "#!/usr/bin/env superkaramba"
> "# -*- coding: iso-8859-1 -*-"
>
> "import karamba"
> "import subprocess"
> "from subprocess import Popen, PIPE, STDOUT, call"
> "import urllib"
> "from urllib import urlopen"
>
>
On Tue, 18 Aug 2009 13:36:49 +0200, Jean-Michel Pichavant wrote:
> MRAB wrote:
>> Carl Banks wrote:
>>> On Aug 17, 10:03 am, Jean-Michel Pichavant
>>> wrote:
I'm no English native, but I already heard women/men referring to a
group as "guys", no matter that group gender configuration. I
On Tue, 18 Aug 2009 12:12:14 +0200, Hendrik van Rooyen wrote:
> On Tuesday 18 August 2009 06:45:39 Aahz wrote:
>> In article ,
>>
>> Steven D'Aprano wrote:
>> >The comments were made a week ago -- why the sudden flurry of
>> >attention?
>>
>> Mainly an opportunity to flog the new diversity list.
Thanks for the time you've spent anyway Peter. I have superkaramba
installed and the rest of the script is running fine, it's only when I
put the urlopen part in that it comes back with errors. The quotes are
just to make it readable on here as my first attempt at posting muted the
text.
--
h
هاني الموصلي wrote:
> I think i found a good managable solution. Actually it is trivial but
> may help (I used it now).
> When i wnat to access the list then i assign the object which i want
> to access to a variable ex:
> 1)x=AutomataBranch()
> 2)x=self.cfgAutomata[i]
>
> The first line is used
I need to compare a REST XML response with a 'gold standard' response (one
that we have already verified is correct). The problem is, sometimes the
REST response comes back and it is logically correct, but the order of
attributes and elements is different than what is in the 'gold standard'
file. F
> indicator of bad practice. What is the problem you're trying to solve?
> Ben Finney
No major problem.
I was just trying to make some experimental changes to autokey. My
repo: http://github.com/tinku99/autokey.git/
Didn't want to subclass or reorganize a class just yet.
--
http://mail.python.or
While refactoring some code, I ran across an opportunity to use a
conditional expression. Original:
if total > P.BASE:
excessblk = Block(total - P.BASE, srccol, carry_button_suppress=True)
else:
excessblk = None
Is there any consensus on how to format a conditional expression that i
Tinybooker 0.2.2 released at http://tinybooker.org/
Tinybooker is an accounting program offering the dual accounting
core functionality for moderate size accountings:
* Assisted establishing new accountings
* Localized scheme templates
* Easy entering and saving new entries
* Sta
Hi,
The PySide team is pleased to announce the first public release of
PySide: Python for Qt!
PySide, its documentation, and developer resources are available at the
project website, http://www.pyside.org .
What is it?
---
PySide is a project providing an LGPL'd set of Python bindings f
John Posner wrote:
> While refactoring some code, I ran across an opportunity to use a
> conditional expression. Original:
>
> if total > P.BASE:
> excessblk = Block(total - P.BASE, srccol,
> carry_button_suppress=True)
> else:
> excessblk = None
>
> Is there any consensus
Diez B. Roggisch wrote:
John Posner wrote:
While refactoring some code, I ran across an opportunity to use a
conditional expression. Original:
if total > P.BASE:
excessblk = Block(total - P.BASE, srccol,
carry_button_suppress=True)
else:
excessblk = None
Is there any
On 2009-08-17, Carl Banks wrote:
> On Aug 17, 10:03?am, Jean-Michel Pichavant
> wrote:
>> I'm no English native, but I already heard women/men referring to a
>> group as "guys", no matter that group gender configuration. It's even
>> used for group composed exclusively of women. Moreover it looks
On 17 Aug, 17:19, Che M wrote:
> Boa (Boa Constructor) is really nice for wxPython GUI
> work, but it has some bugs when using Linux that might
> be dealbreakers for the user. At least I have had
> problems on Ubuntu 8.10 64 bit (but none or very few
>
I prefer wxFormBuilder over Boa.
--
http:
On Tue, 18 Aug 2009 10:04:36 -0400, John Posner wrote:
> While refactoring some code, I ran across an opportunity to use a
> conditional expression. Original:
>
> if total > P.BASE:
> excessblk = Block(total - P.BASE, srccol,
> carry_button_suppress=True)
> else:
> excessblk
My choice would be
excessblk = None
if total > P.BASE:
excessblk = ...
Diez and Jean-Michel,
Ha! Your suggestion above was my *original* coding. It looks like I'm
evolving backwards!
But doesn't it violate the DRY principle? The token "excessblk" appears
twice instead of once.
Than
hi all,
could you inform how to compose a py-file (for soft installation),
that will visit 3 subdirectories (eg subdir1, subdir2, subdir3) and
invoke a command "python setup.py install" in each subdirectory?
I know there should be a simple solution available in Python
documentation, but I have an a
"John Posner" wrote in message
news:[email protected]...
> if total > P.BASE:
> excessblk = Block(total - P.BASE, srccol, carry_button_suppress=True)
> else:
> excessblk = None
I wonder if it is appropriate to replace the None sentinel with one that
How difficult is to create a program that will be executed when Windows
Vista is started? As Windows Calendar does, for example.
I am actually more interested in the Python tools that might be used for
this task. I hope that this question is not inappropriate for the list. :-\
--V
--
http://
John Posner wrote:
My choice would be
excessblk = None
if total > P.BASE:
excessblk = ...
Diez and Jean-Michel,
Ha! Your suggestion above was my *original* coding. It looks like I'm
evolving backwards!
But doesn't it violate the DRY principle? The token "excessblk"
appears twice ins
> > Robert Dailey:
[...]
>
> It's a figure of speech. And besides, why would I want programming
> advice from a woman? lol. Thanks for the help.
Sorry, Robert, simply not acceptable. Whether designed to be funny or
not it's the kind of inane remark I would be really happy never to see
again.
The
Virgil Stokes wrote:
> How difficult is to create a program that will be executed when Windows
> Vista is started? As Windows Calendar does, for example.
>
> I am actually more interested in the Python tools that might be used for
> this task. I hope that this question is not inappropriate for th
Virgil Stokes wrote:
How difficult is to create a program that will be executed when
Windows Vista is started? As Windows Calendar does, for example.
I am actually more interested in the Python tools that might be used
for this task. I hope that this question is not inappropriate for the
list
hi,
i have to work with mac OS 9.2 for legacy reasons...is there a
compiled version of python for this os ? i need to get input about
variable values from the user and then print out some text files that
make use of this input. a gui would be nice, but keyboard based input
would be ok too...
than
Virgil Stokes wrote:
How difficult is to create a program that will be executed when Windows
Vista is started? As Windows Calendar does, for example.
I am actually more interested in the Python tools that might be used for
this task. I hope that this question is not inappropriate for the list.
2009/8/17 Simon Forman
> You can use a little helper function to create your itemgetter like this:
>
> def makeItemGetter(indexes):
>I = itemgetter(*indexes)
>if len(indexes) > 1:
>return I
>return lambda thing: (I(thing),)
>
> If indexes contains only one index the itemgette
Steve Holden wrote:
Robert Dailey:
[...]
It's a figure of speech. And besides, why would I want programming
advice from a woman? lol. Thanks for the help.
Sorry, Robert, simply not acceptable. Whether designed to be funny or
not it's the kind of inane remark I would be really h
I am writing some code to form a tree of nodes of different types. The
idea is to define one class per node type such as
class node_type_1(node):
class node_type_2(node):
etc
(Class "node" would hold any common properties).
When walking the tree I need to know what type of node I'm dealing
could you inform how to compose a py-file (for soft installation),
that will visit 3 subdirectories (eg subdir1, subdir2, subdir3) and
invoke a command "python setup.py install" in each subdirectory?
I know there should be a simple solution available in Python
If you're executing "python setup.p
ok, i found macpython 2.3 at this site:
http://homepages.cwi.nl/~jack/macpython/macpython-older.html
is this the best option for me in terms of using python on os 9.2 ?
thanks much !!
suresh
On Aug 18, 6:04 pm, madzientist wrote:
> hi,
>
> i have to work with mac OS 9.2 for legacy reasons..
I wonder if it is appropriate to replace the None sentinel with one that is an
instance
of Block() e.g.
size = total - P.BASE
excessblk = Block(size, srccol, carry_button_suppress=True, empty_block=(size
<= 0) )
In this particular case, Richard, I don't think so. The Block class is
an a
Hi All,
I'm pleased to announce a new release of xlutils. This is a small
collection of utilities that make use of both xlrd and xlwt to process
Microsoft Excel files. The changes for this release are as follows:
- Add sheet density information and onesheet option to
xlutils.margins.
- Reduce
I'm looking for a way to parallelize my python script without using
typical threading primitives. For example, C++ has pthreads and TBB to
break things into "tasks". I would like to see something like this for
python. So, if I have a very linear script:
doStuff1()
doStuff2()
I can parallelize it
John Posner wrote:
BTW, from the (admittedly few) responses to my original post, it seems
there's some sentiment that "conditional expressions" are a non-Pythonic
misfeature. Interesting ...
-John
I didn't read it that way. One of the (to me) core points of Pythonic
is readability. A
Robert Dailey wrote:
> I'm looking for a way to parallelize my python script without using
> typical threading primitives. For example, C++ has pthreads and TBB to
> break things into "tasks". I would like to see something like this for
> python. So, if I have a very linear script:
>
> doStuff1()
James Harris wrote:
I am writing some code to form a tree of nodes of different types. The
idea is to define one class per node type such as
class node_type_1(node):
class node_type_2(node):
etc
(Class "node" would hold any common properties).
When walking the tree I need to know what ty
On Aug 18, 2:09 pm, James Harris
wrote:
> I am writing some code to form a tree of nodes of different types. The
> idea is to define one class per node type such as
>
> class node_type_1(node):
>
> class node_type_2(node):
>
> etc
>
> (Class "node" would hold any common properties).
>
> When
On Mon, Aug 17, 2009 at 3:51 PM, David Brochu wrote:
> I need to compare one xml document to another to see if the content matches.
> Unfortunately, the formatting (spacing) and order of elements may change
> between files from run to run. I have looked into xml dom minidom but can't
> seem to find
I want a dictionary that will transparently "inherit" from a parent
dictionary. So, for example:
"""
a = InheritDict({1: "one", 2: "two", 4: "four"})
b = InheritDict({3: "three", 4: "foobar"}, inherit_from=a)
a[1] # "one"
a[4] # "four"
b[1] # "one"
b[3] # "three"
b[4] # "foobar"
"""
I've written
18-08-2009 Steven D'Aprano wrote:
On Tue, 18 Aug 2009 10:04:36 -0400, John Posner wrote:
[snip]
How about this:
excessblk = (Block(total - P.BASE, srccol, carry_button_suppress=True)
if total > P.BASE else
None)
If you insist on using the conditional expres
18-08-2009 o 21:44:55 Pavel Panchekha wrote:
I want a dictionary that will transparently "inherit" from a parent
dictionary. So, for example:
"""
a = InheritDict({1: "one", 2: "two", 4: "four"})
b = InheritDict({3: "three", 4: "foobar"}, inherit_from=a)
a[1] # "one"
a[4] # "four"
b[1] # "one"
On Tue, Aug 18, 2009 at 2:44 PM, Pavel Panchekha wrote:
> I want a dictionary that will transparently "inherit" from a parent
> dictionary. So, for example:
>
> """
> a = InheritDict({1: "one", 2: "two", 4: "four"})
> b = InheritDict({3: "three", 4: "foobar"}, inherit_from=a)
>
> a[1] # "one"
> a[
Hello,
I want to simply wrap a function up into an object so it can be called
with no parameters. The parameters that it would otherwise have taken
are already filled in. Like so:
print1 = lambda: print( "Foobar" )
print1()
However, the above code fails with:
File "C:\IT\work\dis
Robert Dailey wrote:
> Hello,
>
> I want to simply wrap a function up into an object so it can be called
> with no parameters. The parameters that it would otherwise have taken
> are already filled in. Like so:
>
>
> print1 = lambda: print( "Foobar" )
> print1()
>
> However, the a
On Aug 18, 3:31 pm, Duncan Booth wrote:
> Robert Dailey wrote:
> > Hello,
>
> > I want to simply wrap a function up into an object so it can be called
> > with no parameters. The parameters that it would otherwise have taken
> > are already filled in. Like so:
>
> > print1 = lambda: print(
On Aug 18, 4:23 pm, "Jan Kaliszewski" wrote:
> 18-08-2009 o 21:44:55 Pavel Panchekha wrote:
>
>
>
> > I want a dictionary that will transparently "inherit" from a parent
> > dictionary. So, for example:
>
> > """
> > a = InheritDict({1: "one", 2: "two", 4: "four"})
> > b = InheritDict({3: "three"
On Tue, Aug 18, 2009 at 1:57 AM, Steven
D'Aprano wrote:
> On Mon, 17 Aug 2009 21:45:57 -0700, naveen wrote:
>
>> Is it possible to split up a class definition over multiple files?
>
> Not exactly, but you can do variations of this:
>
>
> In file A.py, create:
>
> class Parent:
> def method(self)
On Aug 18, 3:31 pm, Duncan Booth wrote:
> Robert Dailey wrote:
> > Hello,
>
> > I want to simply wrap a function up into an object so it can be called
> > with no parameters. The parameters that it would otherwise have taken
> > are already filled in. Like so:
>
> > print1 = lambda: print(
On Tue, Aug 18, 2009 at 1:32 PM, Robert Dailey wrote:
> On Aug 18, 3:31 pm, Duncan Booth wrote:
>> Robert Dailey wrote:
>> > Hello,
>>
>> > I want to simply wrap a function up into an object so it can be called
>> > with no parameters. The parameters that it would otherwise have taken
>> > are al
18-08-2009 o 06:58:58 Xavier Ho wrote:
On Tue, Aug 18, 2009 at 2:45 PM, naveen wrote:
Is it possible to split up a class definition over multiple files?
-
Answer in short, I don't think so.
Why not?
-
File a.py:
class MyClass:
def foo(self, x):
return x * 6
-
On Aug 18, 11:19 am, Robert Dailey wrote:
> I'm looking for a way to parallelize my python script without using
> typical threading primitives. For example, C++ has pthreads and TBB to
> break things into "tasks". I would like to see something like this for
> python. So, if I have a very linear sc
On Aug 18, 3:40 pm, Chris Rebert wrote:
> On Tue, Aug 18, 2009 at 1:32 PM, Robert Dailey wrote:
> > On Aug 18, 3:31 pm, Duncan Booth wrote:
> >> Robert Dailey wrote:
> >> > Hello,
>
> >> > I want to simply wrap a function up into an object so it can be called
> >> > with no parameters. The param
Lambda expressions are, I believe, syntactically limited to a single
expression -- no statements, like 'print' is in Python 2.x.
If you are strongly against just defining a function, you might have to
use a trick to get around it -- this page
(http://p-nand-q.com/python/stupid_lambda_tricks
In article
,
Robert Dailey wrote:
> On Aug 18, 3:31 pm, Duncan Booth wrote:
> > Robert Dailey wrote:
> > > Hello,
> >
> > > I want to simply wrap a function up into an object so it can be called
> > > with no parameters. The parameters that it would otherwise have taken
> > > are already fille
On Aug 18, 3:41 pm, Jonathan Gardner
wrote:
> On Aug 18, 11:19 am, Robert Dailey wrote:
>
>
>
>
>
> > I'm looking for a way to parallelize my python script without using
> > typical threading primitives. For example, C++ has pthreads and TBB to
> > break things into "tasks". I would like to see s
On Tue, Aug 18, 2009 at 10:09 AM, James
Harris wrote:
> I am writing some code to form a tree of nodes of different types. The
> idea is to define one class per node type such as
>
> class node_type_1(node):
>
> class node_type_2(node):
>
> etc
>
> (Class "node" would hold any common properties
1 - 100 of 181 matches
Mail list logo