hi
while trying to make an eigenface image from a numpy array of floats i
tried this
from numpy import array
import Image
imagesize=(200,200)
def makeimage(inputarray,imagename):
inputarray.shape=(-1,)
newimg=Image.new('L', imagesize)
newimg.putdata(inputarray)
newimg.save
I actually have a weirder problem. The code I posted earlier prints
garbage on Windows and python 2.5 and the perfect json data on RHEL
python 2.3.4. I'm so confused and helpless. json.py doesn't seem to
help either. It says
raise ReadException, "Input is not valid JSON: '%s'" %
self._generator.al
On Mar 18, 10:08 pm, Bryan Olson <[EMAIL PROTECTED]> wrote:
> Arnaud Delobelle wrote:
> > Ninereeds wrote:
> >> Hrvoje Niksic wrote:
> >>> This doesn't apply to Python, which implements dict storage as an
> >>> open-addressed table and automatically (and exponentially) grows the
> >>> table when th
On Mar 18, 4:24 pm, George Sakkis <[EMAIL PROTECTED]> wrote:
> On Mar 18, 6:40 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
>
>
>
> > Say, I have a function defined as:
>
> > def fun(arg_one, arg_two='x', arg_three=None):
> > pass
>
> > Is there any way to get actual arguments that will be effect
Diez B. Roggisch wrote:
> In python 3.0, there will be an even nicer way - propset:
> @property
> def foo(self):
> return self._foo
> @propset
> def foo(self, value):
> self._value = value
Isn't that::
@propset(foo)
def foo(self, value):
self._value = valu
"Duncan Booth" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Stargaming <[EMAIL PROTECTED]> wrote:
|
| > On Mon, 17 Mar 2008 16:03:19 +, Duncan Booth wrote:
| >
| >> For the answer I actually want each asterisk substitutes for exactly
one
| >> character.
| >
| > Played around
http://it.slashdot.org/it/08/03/18/1633229.shtml
it was surprising and disappointing that Python was not mentioned
*anywhere* in that article but when someone replied, it sparked a long
thread of post-discussion.
-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Core Python P
This is somewhere that I would personally use a metaclass. That way,
if you define more subclasses of Message, you're not limited to doing
so in that single module.
Someone correct me if this is goofy, I don't do much metaclass programming.
Perhaps something like:
#!/usr/bin/python
class MetaMe
> > You're mixing two completely different approaches of building a
> > property. If that code is actually in the book like that, that's a typo
> > that you should mention to the author.
> > :
> > The recipe you're referring to uses a magical function that returns a
> > dictionary of getter f
Replying to myself here, after discovering more. :-)
> Is there a way to get __thismodule__ in Python?
It looks like __thismodule__ is just sys.modules[__name__]. Neat.
Hmmm ... does sys.modules always already contain the currently-being-
loaded module? Or is this a hack that only happens to wo
Gabriel Genellina wrote:
> En Tue, 18 Mar 2008 18:25:28 -0300, Jeff Schwab <[EMAIL PROTECTED]>
> escribió:
>
>> I need to move a directory tree (~9GB) from one machine to another on
>> the same LAN. What's the best (briefest and most portable) way to do
>> this in Python?
>
> See Tools/scripts/
On Mar 18, 10:10 am, jmDesktop <[EMAIL PROTECTED]> wrote:
> Hi, I would like to start using Python, but am unsure where to begin.
> I know how to look up a tutorial and learn the language, but not what
> all technologies to use.
I think you are getting ahead of yourself. Get the book Learning
P
Thanks for your reply Justin. But how do I do it with cjson?
--
http://mail.python.org/mailman/listinfo/python-list
Is there a way to get __thismodule__ in Python? That is, the current
module you're in. Or isn't that known until the end of the module?
For instance, if I'm writing a module of message types/classes, like
so:
class SetupMessage(Message):
number = 1
class ResetMessage(Message):
number = 2
Arnaud Delobelle wrote:
> Ninereeds wrote:
>> Hrvoje Niksic wrote:
>>> This doesn't apply to Python, which implements dict storage as an
>>> open-addressed table and automatically (and exponentially) grows the
>>> table when the number of entries approaches 2/3 of the table size.
>>> Assuming a goo
FWIW, using json.py I got from somewhere forgotten,
>>> import json
>>> url =
>>> 'http://cmsdoc.cern.ch/cms/test/aprom/phedex/dev/gowri/datasvc/tbedi/requestDetails'
>>> params = {'format':'json'}
>>> import urllib
>>> eparams = urllib.urlencode(params)
>>> import urllib2
>>> request = urllib2.R
En Tue, 18 Mar 2008 18:25:28 -0300, Jeff Schwab <[EMAIL PROTECTED]>
escribió:
> I need to move a directory tree (~9GB) from one machine to another on
> the same LAN. What's the best (briefest and most portable) way to do
> this in Python?
See Tools/scripts/ftpmirror.py in your Python installat
En Tue, 18 Mar 2008 14:40:29 -0300, Adrián Bravo Navarro
<[EMAIL PROTECTED]> escribió:
> That was what we were thinking of, so if there is not some kind of easy
> python magic we will probably use some sockets.
You have pipes too, and a memory mapped file guarded by a semaphore.
--
Gabriel Ge
En Tue, 18 Mar 2008 09:51:03 -0300, bharath venkatesh
<[EMAIL PROTECTED]> escribió:
> my programs runs as daemon and it does some logging .. when system
> shuts down .. which may be done manually . i want my process do some
> cleaning up automatically such as writing in to the log file w
En Wed, 12 Mar 2008 18:02:54 -0200, Jean-Paul Calderone
<[EMAIL PROTECTED]> escribió:
> On Wed, 12 Mar 2008 12:58:33 -0700 (PDT), George Sakkis
> <[EMAIL PROTECTED]> wrote:
>> On Mar 12, 12:22 pm, mrstephengross <[EMAIL PROTECTED]> wrote:
>>
>>> Hi all. I've got a python file called 'foo' (no
"Jeff Schwab" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Marc Christiansen wrote:
| > This was my first thought, too. But tailcall optimisation wouldn't help
| > here. `make_slope` is not tail recursive, the `+` (aka list.extend)
gets
| > executed after the recursion.
|
|
| de
"Ninereeds" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| On Mar 17, 7:26 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
| > "Ninereeds" <[EMAIL PROTECTED]> wrote in message
| >
| >
news:[EMAIL PROTECTED]
| > | Is the PEP238 change to division going into Python 3 as planned?
| >
|
Hi,
I have a service running somewhere which gives me JSON data. What I do
is this:
import urllib,urllib2
import cjson
url = 'http://cmsdoc.cern.ch/cms/test/aprom/phedex/dev/gowri/datasvc/
tbedi/requestDetails'
params = {'format':'json'}
eparams = urllib.urlencode(params)
request = urllib2.Reque
"Ninereeds" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| On Mar 17, 7:26 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote:
| > "Ninereeds" <[EMAIL PROTECTED]> wrote in message
| >
| >
news:[EMAIL PROTECTED]
| > | Is the PEP238 change to division going into Python 3 as planned?
| >
|
"Jarek Zgoda" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
| Say, I have a function defined as:
|
| def fun(arg_one, arg_two='x', arg_three=None):
|pass
|
| Is there any way to get actual arguments that will be effectively used
| when I call this function in various ways, like:
On Mar 18, 5:16 pm, Robert Kern <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > So I need to recursively grep a bunch of gzipped files. This can't be
> > easily done with grep, rgrep or zgrep. (I'm sure given the right
> > pipeline including using the find command it could be donebu
On Mar 18, 6:51 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote:
> > That's another new step for me. Any ideas where to start?
>
> http://docs.python.org/ext/simpleExample.html
>
> And look into the source of existing extensions. PIL and PyCairo are
> the best in your situation.
You shouldn't be afr
> >> >>> b in b
> >> False
>
> > That's actually interesting.
>
> Just for the avoidance of doubt, I didn't write the 'b in b' line:
> castironpi is replying to himself without attribution.
>
> P.S. I still don't see the relevance of any of castironpi's followup to my
> post, but since none it made
On Mar 19, 9:47 am, geert <[EMAIL PROTECTED]> wrote:
> On Mar 18, 6:56 pm, geert <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Mar 14, 1:15 pm, [EMAIL PROTECTED] wrote:
>
> > > look
> > > athttp://groups.google.be/group/comp.lang.python/browse_thread/thread/d...
>
> > > There is a macpython list that yo
On Mar 18, 5:34 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> >> > > On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]>
> >> > > wrote:
>
> >> > >> A common explanation for this is that lists are for homogenous
> >> > >> collections, tuples are for when you have heterog
On Mar 18, 6:38 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> On Mar 18, 3:59 pm, Ninereeds <[EMAIL PROTECTED]> wrote:
>
> > Hrvoje Niksic wrote:
> > > This doesn't apply to Python, which implements dict storage as an
> > > open-addressed table and automatically (and exponentially) grows the
>
Gabriel Genellina wrote:
> On 18 mar, 04:12, Jerry Fleming <[EMAIL PROTECTED]> wrote:
>> Gabriel Genellina wrote:
>>> On 17 mar, 23:57, Jerry Fleming <[EMAIL PROTECTED]> wrote:
I have a binary file written with c structures. Each record contains a
null-terminated string followed by two 4-
On Mar 18, 6:39 pm, oog1e <""benjamin.serrato\"@G(oog1e)MAIL.com">
wrote:
> Hey, big thanks to you and Gabriel for replying. I couldn't quite follow
> what you did yet. What is this 'gimpy' thing
gmpy. It's the GMP (Gnu Multi-Precision) C-library in
a Python wrapper. It supports arbitrary precisio
> That's another new step for me. Any ideas where to start?
http://docs.python.org/ext/simpleExample.html
And look into the source of existing extensions. PIL and PyCairo are
the best in your situation.
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 19, 2:33 am, dave <[EMAIL PROTECTED]> wrote:
> First I want to say thank you all for your timely replies. This is all
> good food for thought. I've been programming more many years, but fast
> graphics rendering is new territory for me.
>
> I'm hoping to fine something like a buffer_blit, wh
Hey, big thanks to you and Gabriel for replying. I couldn't quite follow
what you did yet. What is this 'gimpy' thing and where can I read about
it? In response:
First: Heh, I'm a little embarrassed I didn't notice this. I thought 'I
only need to check up to half' but it didn't occur that base*
On Mar 18, 3:59 pm, Ninereeds <[EMAIL PROTECTED]> wrote:
> Hrvoje Niksic wrote:
> > This doesn't apply to Python, which implements dict storage as an
> > open-addressed table and automatically (and exponentially) grows the
> > table when the number of entries approaches 2/3 of the table size.
> > A
En Tue, 18 Mar 2008 07:09:08 -0300, <[EMAIL PROTECTED]> escribió:
> On Mar 17, 8:16 pm, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>> On 17 mar, 19:43, [EMAIL PROTECTED] wrote:
>>
>> > Can I allocate a second console window, so I can place certain output
>> > to that directly, and leave the orig
First I want to say thank you all for your timely replies. This is all
good food for thought. I've been programming more many years, but fast
graphics rendering is new territory for me.
I'm hoping to fine something like a buffer_blit, where I can set all
the pixels to change using basic operators,
On 18 Mar, 23:45, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> > def nonunique(lst):
> >slst = sorted(lst)
> >dups = [s[0] for s in
> > filter(lambda t : t[0] == t[1], zip(slst[:-1],slst[1:]))]
> >return [dups[0]] + [s[1] for s in
> > filter(lambda t : t[0] != t[1], zi
On Mar 18, 6:56 pm, geert <[EMAIL PROTECTED]> wrote:
> On Mar 14, 1:15 pm, [EMAIL PROTECTED] wrote:
>
> > look
> > athttp://groups.google.be/group/comp.lang.python/browse_thread/thread/d...
>
> > There is a macpython list that you can consult
> > athttp://www.nabble.com/Python---pythonmac-sig-f29
On Mar 18, 9:56 pm, sturlamolden <[EMAIL PROTECTED]> wrote:
> On 18 Mar, 22:25, sturlamolden <[EMAIL PROTECTED]> wrote:
>
> > def nonunique(lst):
> > slst = sorted(lst)
> > return list(set([s[0] for s in
> > filter(lambda t : t[0] != t[1], zip(slst[:-1],slst[1:]))]))
>
> Obviously that
On Mar 19, 9:27 am, Sean DiZazzo <[EMAIL PROTECTED]> wrote:
> On Mar 18, 2:27 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
>
>
>
> > Sean DiZazzo <[EMAIL PROTECTED]> wrote:
> > > On windows, this returns the size of the file as it _will be_, not the
> > > size that it currently is. Is this a featur
I love you guys, thanks! ;-)
~Simon
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 18, 2:27 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
> Sean DiZazzo <[EMAIL PROTECTED]> wrote:
> > On windows, this returns the size of the file as it _will be_, not the
> > size that it currently is. Is this a feature? What is the proper way
> > to get the current size of the file? I not
[EMAIL PROTECTED] wrote:
> So I need to recursively grep a bunch of gzipped files. This can't be
> easily done with grep, rgrep or zgrep. (I'm sure given the right
> pipeline including using the find command it could be donebut
> seems like a hassle).
>
> So I figured I'd find a fancy next g
Jeff Schwab wrote:
> I need to move a directory tree (~9GB) from one machine to another on
> the same LAN. What's the best (briefest and most portable) way to do
> this in Python?
>
> I see that urllib has some support for getting files by FTP, but that it
> has some trouble distinguishing files
Joe P. Cool schrieb:
> On 18 Mrz., 21:59, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>> Joe P. Cool schrieb:
>>> def _property_y(self):
>>> def _get(self):
>>> [...]
>> There are a few recipies, like this:
>>
>> class Foo(object):
>>
>> @apply
>> def foo():
>>
How about using list comprehension?
l1 = ["apples","apples","bananas","oranges","oranges","peaches"]
s1 = set([x for x in l1 if l1.count(x) > 1])
On Tue, Mar 18, 2008 at 4:56 PM, sturlamolden <[EMAIL PROTECTED]> wrote:
> On 18 Mar, 22:25, sturlamolden <[EMAIL PROTECTED]> wrote:
>
> > def nonun
On 18 Mar, 22:25, sturlamolden <[EMAIL PROTECTED]> wrote:
> def nonunique(lst):
>slst = sorted(lst)
>return list(set([s[0] for s in
>filter(lambda t : t[0] != t[1], zip(slst[:-1],slst[1:]))]))
Obviously that should be 'lambda t : t[0] == t[1]'. Instead of using
the set function, t
Jeff Schwab <[EMAIL PROTECTED]> writes:
> I need to move a directory tree (~9GB) from one machine to another on
> the same LAN. What's the best (briefest and most portable) way to do
> this in Python?
os.popen("rsync ...")
--
http://mail.python.org/mailman/listinfo/python-list
sturlamolden <[EMAIL PROTECTED]> writes:
> def nonunique(lst):
>slst = sorted(lst)
>return list(set([s[0] for s in
>filter(lambda t : t[0] != t[1], zip(slst[:-1],slst[1:]))]))
The items are all comparable and you're willing to take them out of order?
from collections import defaul
John Fisher wrote:
> Hi Group,
Hi John
> I have been absent a while, mainly because I have been getting better at
> figuring out my own Python problems. But not this one...
>
> I have a timed loop performing certain tasks until a total period of
> time has elapsed. I would like to be able to in
On 18 Mrz., 21:59, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Joe P. Cool schrieb:
> > def _property_y(self):
> > def _get(self):
> > [...]
>
> There are a few recipies, like this:
>
> class Foo(object):
>
> [EMAIL PROTECTED]
> def foo():
> def fget(se
[EMAIL PROTECTED] wrote:
>> > > On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]>
>> > > wrote:
>>
>> > >> A common explanation for this is that lists are for homogenous
>> > >> collections, tuples are for when you have heterogenous
>> > >> collections i.e. related but different things.
>>
>>
Sean DiZazzo <[EMAIL PROTECTED]> wrote:
> On windows, this returns the size of the file as it _will be_, not the
> size that it currently is. Is this a feature? What is the proper way
> to get the current size of the file? I noticed
> win32File.GetFileSize() Does that behave the way I expect?
> > > On Mar 17, 1:31 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
>
> > >> A common explanation for this is that lists are for homogenous
> > >> collections, tuples are for when you have heterogenous collections i.e.
> > >> related but different things.
>
> > > I interpret this as meaning that in a
On 18 Mar, 22:22, sturlamolden <[EMAIL PROTECTED]> wrote:
> def nonunique(lst):
>slst = sorted(lst)
>return list(set([s[0] for s in
> filter(lambda t : not(t[0]-t[1]), zip(slst[:-1],slst[1:]))]))
Or perhaps better:
def nonunique(lst):
slst = sorted(lst)
return list(set([s[0]
I need to move a directory tree (~9GB) from one machine to another on
the same LAN. What's the best (briefest and most portable) way to do
this in Python?
I see that urllib has some support for getting files by FTP, but that it
has some trouble distinguishing files from directories.
http
On 18 Mar, 10:57, Simon Forman <[EMAIL PROTECTED]> wrote:
> def f(L):
> '''Return a set of the items that occur more than once in L.'''
> L = list(L)
> for item in set(L):
> L.remove(item)
> return set(L)
def nonunique(lst):
slst = sorted(lst)
return list(set([s[0]
Hi Group,
I have been absent a while, mainly because I have been getting better at
figuring out my own Python problems. But not this one...
I have a timed loop performing certain tasks until a total period of
time has elapsed. I would like to be able to interrupt the loop or set
various flags dur
Python author and trainer Mark Lutz will be teaching another
3-day Python class at a conference center in Longmont, Colorado,
on May 14-16, 2008.
This is a public training session open to individual enrollments,
and covers the same topics as the 3-day onsite sessions that Mark
teaches, with hands-
Joe P. Cool schrieb:
> Hi,
>
> I like C#'s style of defining a property in one place. Can the
> following way
> to create a property be considered reasonable Python style (without
> the
> print statements, of course)?
>
> class sample(object):
> def __init__(self):
> sample.y = self.
Hi all,
I'm seeing some behavior that is confusing me. I often use a simple
function to tell if a file is growing...ie being copied into a certain
location. (Can't process it until it's complete) My function is not
working on windows, and I'm wondering if I am missing something
simple, or if I
> > >>> Can I allocate a second console window, so I can place certain output
> > >>> to that directly, and leave the original streams alone?
>
> > I've rather lost track of what you're trying to do, but I would
> > second Gabriel's suggestion of the standard Windows method of
> > debug output: u
Ninereeds <[EMAIL PROTECTED]> writes:
> As for the growth pattern, each time you grow the table you have to
> redistribute all the items previously inserted to new locations.
> Resizes would get rarer as more items are added due to the
> exponential growth, but every table resize would take longer
On Mar 18, 6:40 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> Say, I have a function defined as:
>
> def fun(arg_one, arg_two='x', arg_three=None):
> pass
>
> Is there any way to get actual arguments that will be effectively used
> when I call this function in various ways, like:
>
> fun(5) => [
[EMAIL PROTECTED] pisze:
> On Mar 18, 5:40 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
>> Say, I have a function defined as:
>>
>> def fun(arg_one, arg_two='x', arg_three=None):
>> pass
>>
>> Is there any way to get actual arguments that will be effectively used
>> when I call this function in v
Hi,
I like C#'s style of defining a property in one place. Can the
following way
to create a property be considered reasonable Python style (without
the
print statements, of course)?
class sample(object):
def __init__(self):
sample.y = self._property_y()
def _property_y(self):
Mike Driscoll wrote:
> On Mar 18, 1:41 pm, fumanchu <[EMAIL PROTECTED]> wrote:
>> On Mar 17, 6:25 pm, dundeemt <[EMAIL PROTECTED]> wrote:
>>
>>> I agree - the balance wasn't as good. We can all agree that HowTos
>>> and Intros are a necessary part of the conference talks track, but as
>>> Robert p
On Mar 18, 9:43 pm, Godzilla <[EMAIL PROTECTED]> wrote:
> Thanks Roel. If there is a way to pass in the PRESERVE_PRECISION
> constant in the python time.clock library, that would be great
Re-read Roel's message. Something like PRESERVE_PRECISION is to be
passed to whatever is setting up DirectX.
Chris Mellon <[EMAIL PROTECTED]> wrote:
>OpenGL is totally unsuitable if the goal is to implement your own
>pixel-level raster drawing.
Unfornately, any solution involving Python is likely to be unsuitable
if your goal is to set individual pixels one-by-one, and GDI would be no
better than OpenGL
On Mar 18, 8:51 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> >>> Can I allocate a second console window, so I can place certain output
> >>> to that directly, and leave the original streams alone?
>
> I've rather lost track of what you're trying to do, but I would
> seco
On Mar 18, 9:09 pm, Laszlo Nagy <[EMAIL PROTECTED]> wrote:
> Sorry, meanwhile i found that "email.Headers.decode_header" can be used
> to convert the subject into unicode:
>
> > def decode_header(self,headervalue):
> > val,encoding = decode_header(headervalue)[0]
> > if encoding:
> > return val.dec
On Mar 18, 1:41 pm, fumanchu <[EMAIL PROTECTED]> wrote:
> On Mar 17, 6:25 pm, dundeemt <[EMAIL PROTECTED]> wrote:
>
> > I agree - the balance wasn't as good. We can all agree that HowTos
> > and Intros are a necessary part of the conference talks track, but as
> > Robert pointed out some talks sho
On Mar 18, 1:49 pm, Mike Orr <[EMAIL PROTECTED]> wrote:
> On Mar 16, 6:10 am, Bruce Eckel <[EMAIL PROTECTED]> wrote:
> vendors:
> > On top of that, the quality of the presentations was unusually low.
>
> I did feel that. An advanced track would be a good idea. Because
> you do need to repeat stuf
On Mar 17, 6:25 pm, dundeemt <[EMAIL PROTECTED]> wrote:
> I agree - the balance wasn't as good. We can all agree that HowTos
> and Intros are a necessary part of the conference talks track, but as
> Robert pointed out some talks should be of a more advanced nature. I
> enjoy those that stretch my
On Mar 18, 6:03 am, Gabriel Rossetti
<[EMAIL PROTECTED]> wrote:
> Carsten Haese wrote:
> > On Tue, 2008-03-18 at 09:06 +0100, Gabriel Rossetti wrote:
>
> >> Hello,
>
> >> I am reading core python python programming and it talks about using the
> >> idiom
> >> described on
> >>http://aspn.activestat
On Mar 18, 5:40 am, Jarek Zgoda <[EMAIL PROTECTED]> wrote:
> Say, I have a function defined as:
>
> def fun(arg_one, arg_two='x', arg_three=None):
> pass
>
> Is there any way to get actual arguments that will be effectively used
> when I call this function in various ways, like:
>
> fun(5) => [
On Mar 16, 9:24 am, Matt Nordhoff <[EMAIL PROTECTED]> wrote:
> mpc wrote:
> > def concatenate(sequences):
> > for seq in sequences:
> > for item in seq:
> > yield item
>
> You should check out itertools.chain(). It does this. You call it like
> "chain(seq1, seq2, ...)" inste
On Mar 9, 2:04 am, "Ryan Ginstrom" <[EMAIL PROTECTED]> wrote:
> > On Behalf Of Grant Edwards
> > I think docstrings are a great idea. What's needed is a way
> > to document the signature that can't get out-of-sync with
> > what the fucntion really expects.
>
> Like doctests? (I know, smart-ass res
On Mar 14, 1:15 pm, [EMAIL PROTECTED] wrote:
> look
> athttp://groups.google.be/group/comp.lang.python/browse_thread/thread/d...
>
> There is a macpython list that you can consult
> athttp://www.nabble.com/Python---pythonmac-sig-f2970.html
Just wanted to let you know that I've solved my problem.
On Mar 16, 6:10 am, Bruce Eckel <[EMAIL PROTECTED]> wrote:
vendors:
> But it gets worse. The lightning talks, traditionally the best, newest
> and edgiest part of the conference, were also sold like commercial air
> time.
We introduced sponsor lighting talks last year. This year it got out
of han
On Mar 18, 6:08 am, erikcw <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to create an undo/redo feature for a webapp I'm working on
> (django based). I'd like to have an undo/redo function.
>
> My first thought was to use the difflib to generate a diff to serve as
> the "backup", and then if som
On Tue, Mar 18, 2008 at 12:30 PM, sturlamolden <[EMAIL PROTECTED]> wrote:
> On 18 Mar, 17:48, Miki <[EMAIL PROTECTED]> wrote:
>
> > Apart from PIL, some other options are:
> > 1. Most GUI frameworks (wxPython, PyQT, ...) give you a canvas object
> > you can draw on
>
> Yes, but at least on Wind
That was what we were thinking of, so if there is not some kind of easy
python magic we will probably use some sockets.
Thanks!!
2008/3/18, Joshua Kugler <[EMAIL PROTECTED]>:
>
> Adrián Bravo Navarro wrote:
> >> Is there any simple way to achieve this goal? We've been thinking of
> >> sockets but
On 18 Mar, 17:48, Miki <[EMAIL PROTECTED]> wrote:
> Apart from PIL, some other options are:
> 1. Most GUI frameworks (wxPython, PyQT, ...) give you a canvas object
> you can draw on
Yes, but at least on Windows you will get a GDI canvas. GDI is slow.
> 2. A bit of an overkill, but you can use P
[EMAIL PROTECTED] wrote:
> if __name__ == '__main__':
>
> print "Globals (For Loop):"
> try:
> for i in globals():
> print "\t%s" % i
> except RuntimeError:
> print "Only some globals() printed\n"
> else:
> print "All globals() printed\n"
>
>
On Mar 18, 2:57 am, Simon Forman <[EMAIL PROTECTED]> wrote:
> Is there a more efficient way to do this?
>
> def f(L):
> '''Return a set of the items that occur more than once in L.'''
> L = list(L)
> for item in set(L):
> L.remove(item)
> return set(L)
>
> |>> f([0, 0, 1, 1,
Adrián Bravo Navarro wrote:
>> Is there any simple way to achieve this goal? We've been thinking of
>> sockets but Im not conviced at all with that.
If you want to communicate between processes on the same host, yes, you can
use DBus or a couple of the options here:
http://docs.python.org/lib/ipc.
Amen on the diamond keynotes and lightning talks. The lightning talks
were a great disappointment. Sponsor talks (or any such talks pitched
at selling or recruiting) should go in their own, clearly labeled
group so those of us who don't care about them can avoid them.
If there must diamond 'keynot
"Marc 'BlackJack' Rintsch" schrieb
>
> > I don't think this qualifies as a bug, but I am astonished
> > that the struct module does not tell you whether you are
> > big endian, you have to find out yourself with
> >struct.unpack('@I', s)[0]==struct.unpack(">I", s)[0]
>
> Maybe a little more
Pylons is a Ruby on Rails-like web framework that allows you build dynamic
web applications with a database backend. Here is a link to the Pylons web
site:
http://pylonshq.com/
On Tue, Mar 18, 2008 at 11:10 AM, jmDesktop <[EMAIL PROTECTED]> wrote:
> Hi, I would like to start using Python, but
Hello Dave,
> Hi All. I've been formulating in my head a simple image editor. I
> actually started prototyping is some time ago in Java, but am liking
> Python more and more. My editor will be nowhere near the level of Gimp/
> Photoshop, but I do need fast pixel level control and display. For
> in
On Tue, 18 Mar 2008 09:27:46 -0700 (PDT)
rodmc <[EMAIL PROTECTED]> wrote:
>
> > Hi, I would like to start using Python, but am unsure where to begin.
> > I know how to look up a tutorial and learn the language, but not what
> > all technologies to use. I saw references to plain Python, Django,
>
Marc Christiansen wrote:
> sturlamolden <[EMAIL PROTECTED]> wrote:
>> On 18 Mar, 00:58, Jeff Schwab <[EMAIL PROTECTED]> wrote:
>>
>>> def make_slope(distance, parts):
>>> if parts == 0:
>>> return []
>>>
>>> q, r = divmod(distance, parts)
>>>
>>> if r and parts % r:
>>>
> Hi, I would like to start using Python, but am unsure where to begin.
> I know how to look up a tutorial and learn the language, but not what
> all technologies to use. I saw references to plain Python, Django,
> and other things.
Hi,
For database stuff you can plug directly into either MySQL
Laszlo Nagy wrote:
> I know that "=?UTF-8?B" means UTF-8 + base64 encoding, but I wonder if
> there is a standard method in the "email" package to decode these
> subjects?
The standard library function email.Header.decode_header will parse these
headers into an encoded bytestring paired with the
if __name__ == '__main__':
print "Globals (For Loop):"
try:
for i in globals():
print "\t%s" % i
except RuntimeError:
print "Only some globals() printed\n"
else:
print "All globals() printed\n"
print "Globals (Generator):"
try:
p
On Mar 18, 8:42 am, "mhearne808[insert-at-sign-here]gmail[insert-dot-
here]com" <[EMAIL PROTECTED]> wrote:
> I can't seem to get the zlib module to build on an RHEL box.
>
> I did the following:
> 1) Download zlib 1.2.3
> 2) configure;make;make install
> 3) Download python 2.5.2
> 4) configure;make
1 - 100 of 151 matches
Mail list logo