Stef Mientki writes:
> from the given class, it's ancestors and it's derived classes,
> I'ld like to get the following information in a tree like structure:
>
> - the file were the class is definied
> - the attributes, split in inherited / created / overriden
> - the methodes, split in inherited
On Jan 10, 2:35 pm, flow wrote:
> I've just finished reading a sort of beginner Python book, and I know
> quite a bit now but I'm looking for a book that can teach me advanced
> aspects of Python - code optimisation, threading, etc.
>
> Any recommendations?
>
> Cheers.
I like to add this one, whi
On Sun, 10 Jan 2010 22:21:54 -0800, Sebastian wrote:
> Hi there,
>
> I have an array x=[1,2,3]
You have a list. Python has an array type, but you have to "import array"
to use it.
> Is there an operator which I can use to get the result
> [1,1,1,2,2,2,3,3,3] ?
Not an operator, but you can d
Paul Rudin wrote:
Sebastian writes:
Hi there,
I have an array x=[1,2,3]
In python such an object is called a "list".
(In cpython it's implemented as an automatically resizable array.)
Is there an operator which I can use to get the result
[1,1,1,2,2,2,3,3,3] ?
There's
On Jan 10, 10:34 am, Nobody wrote:
> Hellmut Weber wrote:
> >> being a causal python user (who likes the language quite a lot)
> >> it took me a while to realize the following:
> >> >>> max = '5'
> >> >>> n = 5
> >> >>> n >= max
> >> False
>
> >> Section 5.9 Comparison describes this.
>
> >> Ca
Sebastian writes:
> Hi there,
>
> I have an array x=[1,2,3]
In python such an object is called a "list".
(In cpython it's implemented as an automatically resizable array.)
>
> Is there an operator which I can use to get the result
> [1,1,1,2,2,2,3,3,3] ?
There's no operator that will give yo
On Sun, Jan 10, 2010 at 10:21 PM, Sebastian wrote:
> Hi there,
>
> I have an array x=[1,2,3]
>
> Is there an operator which I can use to get the result
> [1,1,1,2,2,2,3,3,3] ?
>
> I tried x*3, which resulted in [1,2,3,1,2,3,1,2,3]
> I also tried [[b,b,b] for b in x] which led to [[1,2,3],[1,2,3],
On Jan 11, 4:21 pm, Sebastian wrote:
> I also tried [[b,b,b] for b in x] which led to [[1,2,3],[1,2,3],
> [1,2,3]]
Sorry, I have to correct myself. The quoted line above resulted in
[[1,1,1],[2,2,2],[3,3,3]] of course!
Cheers, Sebastian
--
http://mail.python.org/mailman/listinfo/python-list
Hi there,
I have an array x=[1,2,3]
Is there an operator which I can use to get the result
[1,1,1,2,2,2,3,3,3] ?
I tried x*3, which resulted in [1,2,3,1,2,3,1,2,3]
I also tried [[b,b,b] for b in x] which led to [[1,2,3],[1,2,3],
[1,2,3]], but this isn't what I want either.
Cheers, Sebastian
--
On Jan 10, 8:16 pm, Dave WB3DWE wrote:
> On Sat, 9 Jan 2010 16:48:52 -0800 (PST), casevh
> wrote:
>
> >On Jan 9, 3:10 pm, pdlem...@earthlink.net wrote:
> >> On Sat, 9 Jan 2010 13:27:07 -0800 (PST), casevh
> >> wrote:
>
> >1) Try the commands again. Make sure all the "./configure" options are
> >o
Carl Banks wrote:
> On Jan 8, 11:14 am, Daniel Fetchinson
> wrote:
>> I have a plain text file which I would like to protect in a very
>> simple minded, yet for my purposes sufficient, way. I'd like to
>> encrypt/convert it into a binary file in such a way that possession of
>> a password allows a
On Sun, Jan 10, 2010 at 3:26 PM, Paul Rubin wrote:
> geremy condra writes:
>> Not sure why in the world you would homebrew something like this- a
>> small dependency isn't that bad, and aes can be pretty simple to use.
>> Might as well go for the industrial strength approach.
>
> In my experience
On Jan 8, 11:14 am, Daniel Fetchinson
wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way that possession of
> a password allows anyone to convert it back i
Paul Rubin wrote:
> Steve Holden writes:
>>> Right now, even asking for HTTPS support is too much to ask. Heck,
>>> even asking for the fake HTTPS support to be identified as such is too
>>> much, apparently.
>>>
>> No, Paul, nobody will complain if you *ask* ...
>
> Er, that wasn't me...
>
Oh s
In article ,
Jean-Michel Pichavant wrote:
>
>class A:
>def __init__(self, foo = None, bar = None):
>if len(foo) > 5:
> raise ValueError('foo cannot exceed 5 characters')
Bad Idea -- what happens when foo is None?
--
Aahz (a...@pythoncraft.com) <*> htt
In article ,
p_tierchen <1...@sms.at> wrote:
>
>the application is an interface to a sqlite database and stores image
>metadata (such as year, event, photographer, people on image etc.). i
>use pyqt4 for the interface and developed this application on a linux
>platform (python 2.5.4). friends of m
Nobody writes:
> But, yeah, the OP needs to be aware of the difference (and probably isn't,
> yet). So to take that a step further ...
> The key passed to arcfour.schedule() shouldn't be re-used
> If you need to verify the data, append a hash of the ciphertext ...
> If you want to encrypt mul
Steve Holden writes:
>> Right now, even asking for HTTPS support is too much to ask. Heck,
>> even asking for the fake HTTPS support to be identified as such is too
>> much, apparently.
>>
> No, Paul, nobody will complain if you *ask* ...
Er, that wasn't me...
> A question I've been asking myse
Here's an improvement in case you want your code to work outside of
Arizona:
from time import time, timezone
h = ((time() - timezone) / 3600) % 24
On Jan 10, 9:04 pm, Austyn wrote:
> How about:
>
> import time
> arizona_utc_offset = -7.00
> h = (time.time() / 3600 + arizona_utc_offset) % 24
>
>
On Sat, 9 Jan 2010 16:48:52 -0800 (PST), casevh
wrote:
>On Jan 9, 3:10 pm, pdlem...@earthlink.net wrote:
>> On Sat, 9 Jan 2010 13:27:07 -0800 (PST), casevh
>> wrote:
>
>1) Try the commands again. Make sure all the "./configure" options are
>on one line. Make sure to do "sudo make altinstall". (D
How about:
import time
arizona_utc_offset = -7.00
h = (time.time() / 3600 + arizona_utc_offset) % 24
dt.timetuple()[6] is the day of the week; struct tm_time doesn't
include a sub-second field.
On Jan 10, 10:28 am, "W. eWatson" wrote:
> Maybe there's a more elegant way to do this. I want to exp
Nobody wrote:
> On Sun, 10 Jan 2010 12:26:05 -0800, Paul Rubin wrote:
>
>> I'd like it a lot if the Python stdlib could include a serious
>> cryptography module.
>
> And I'd like a truckload of gold ;)
>
> Right now, even asking for HTTPS support is too much to ask. Heck,
> even asking for the f
On Sun, 10 Jan 2010 12:26:05 -0800, Paul Rubin wrote:
> I'd like it a lot if the Python stdlib could include a serious
> cryptography module.
And I'd like a truckload of gold ;)
Right now, even asking for HTTPS support is too much to ask. Heck,
even asking for the fake HTTPS support to be identi
On Sun, 10 Jan 2010 08:54:51 -0800, Paul Rubin wrote:
> Nobody writes:
>> RC4 (aka ArcFour) is quite trivial to implement, and better than inventing
>> your own cipher or using a Vignere: ...
>
> That's a cute implementation, but it has no authentication and doesn't
> include any randomness, whi
Steve Holden wrote:
[...]
> Because I habitually run the NoScript extension to Firefox the popups
> didn't appear, but there didn't seem to be any original content on this
> site. Google continues to be your friend.
>
And dammit, why didn't I think to strip the links out instead of
creating yet on
Terry Reedy wrote:
> On 1/8/2010 11:50 AM, tanix wrote:
>> Python Goldmine collection contains the extensive collection of articles
>> going back several years. It includes thousands of code
>> examples and expert discussions on all major topics.
>>
>> The information is organized by relevant topic
On 1/8/2010 11:50 AM, tanix wrote:
Python Goldmine collection contains the extensive collection of articles
going back several years. It includes thousands of code
examples and expert discussions on all major topics.
The information is organized by relevant topics, covered
by the corresponding c
On 1/10/2010 4:15 AM, Peter Billam wrote:
Greetings. Is there a way to get at the Computer Music Toolkit (CMT)
http://www.ladspa.org/cmt/
functionality from Python (Python3 in my case) ?
You can access compiled C shared libraries most easily via the ctypes
module.
Searching Python CMT "Co
no idea :-(
--
http://mail.python.org/mailman/listinfo/python-list
?
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for valuable answers. Both solutions work and I understand my
mistake.
Best regards,
Daniel
--
http://mail.python.org/mailman/listinfo/python-list
Thanks Miki and Jason. I knew it could be done :-)
--
http://mail.python.org/mailman/listinfo/python-list
Python Goldmine collection contains the extensive collection of articles
going back several years. It includes thousands of code
examples and expert discussions on all major topics.
The information is organized by relevant topics, covered
by the corresponding chapters.
The information was filtere
Maybe there's a more elegant way to do this. I want to express the
result of datetime.datetime.now() in fractional hours.
Here's one way.
dt=datetime.datetime.now()
xtup = dt.timetuple()
h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6
# now is in fractions of an hour
--
http://mail.pyth
On Jan 11, 1:10 pm, Zabin wrote:
> Hey!
>
> I am trying to align contents of some table cells but find the code
> below working for some fields and not for others. I am stuck as to why
> this is happening. Help will be gretly appreciated!
>
> setTextAlignment(QtCore.Qt.AlignVCenter)
>
> Cheers
> Z
In Python 3.1 is there any difference in the buffering behavior of the
initial sys.stdout and sys.stderr streams? They are both line_buffered
and stdout doesn't seem to use a larger-grain buffering, so they seem
to be identical with respect to buffering. Were they different at some
earlier
Hey!
I am trying to align contents of some table cells but find the code
below working for some fields and not for others. I am stuck as to why
this is happening. Help will be gretly appreciated!
setTextAlignment(QtCore.Qt.AlignVCenter)
Cheers
Zabin
--
http://mail.python.org/mailman/listinfo/py
hello,
I'd like to have a class viewer, something different from pydoc,
and I wonder if someone has made something similar.
from the given class, it's ancestors and it's derived classes,
I'ld like to get the following information in a tree like structure:
- the file were the class is definied
-
> Matt Nordhoff wrote:
> > BTW: Checked out optparse? It's bigger and sexier!
If you're doing things with positional arguments, you should consider using
argparse (http://argparse.googlecode.com/svn/tags/r101/doc/index.html). It's
like optparse, but (much) better.
Cheers,
Emm
--
http://mail.
Matt Nordhoff wrote:
> BTW: Checked out optparse? It's bigger and sexier!
Thanks for the tip. Works a treat.
-- Matt
--
http://mail.python.org/mailman/listinfo/python-list
so does anyone know how I could do this?
--
http://mail.python.org/mailman/listinfo/python-list
geremy condra writes:
> Not sure why in the world you would homebrew something like this- a
> small dependency isn't that bad, and aes can be pretty simple to use.
> Might as well go for the industrial strength approach.
In my experience, 1) small dependencies ARE that bad, since they mean
you ha
I am writing a small script to manage my ipod. I am using the python
bindings for libgpod. I have never used swig, or used python to
program against a c/c++ library.
I can get the library to find my ipod, and parse its DB format, but
I'm not sure how to interact with the types that some of the f
I have a Python multiprocessing application where a master process
starts server sub-processes and communicates with them via Pipes; that
works very well. But one of the subprocesses, in turn, starts a
collection of HTTPServer 'workers' (almost exactly as demonstrated in
the docs). This works pe
On 10-1-2010 20:04, Joan Miller wrote:
How the logging '%(asctime)s' [1] specifier to gets the millisecond
portion of the time if there is not a directive to get it from the
time module [2] ?
"The date format string follows the requirements of strftime()"
[1] http://docs.python.org/library/logg
Not sure why in the world you would homebrew something like this- a
small dependency isn't that bad, and aes can be pretty simple to use.
Might as well go for the industrial strength approach.
Geremy Condra
--
http://mail.python.org/mailman/listinfo/python-list
Victor Subervi wrote:
Hi;
The following code that works:
#! /usr/bin/python
import string
import cgitb; cgitb.enable()
import cgi
import MySQLdb
import sys,os
from sets import Set
import fpformat
cwd = os.getcwd()
sys.path.append(cwd)
from login import login
from particulars import ourOptions
How the logging '%(asctime)s' [1] specifier to gets the millisecond
portion of the time if there is not a directive to get it from the
time module [2] ?
"The date format string follows the requirements of strftime()"
[1] http://docs.python.org/library/logging.html#basic-example
[2] http://docs.p
In article <0fd84b05-cf12-485b-a14e-608e47679...@s20g2000yqd.googlegroups.com>,
mlowicki wrote:
>
>Hi!, i get such error when I try to install cheetah:
Probably better to ask on the Cheetah list:
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
--
Aahz (a...@pythoncraft.com
Somebody wrote:
> If you actually need to perform comparisons across types, you can rely
> upon the fact that tuple comparisons are non-strict and use e.g.:
>
> > a = 5
> > b = '5'
> > (type(a).__name__, a) < (type(b).__name__, b)
> True
> > (type(a).__name__, a) > (type(b).__name__, b)
> False
>
On Sat, Jan 9, 2010 at 3:00 PM, Stephen Hansen wrote:
> On Sat, Jan 9, 2010 at 7:15 AM, Victor Subervi wrote:
>
>> On Sat, Jan 9, 2010 at 9:35 AM, Steve Holden wrote:
>>
>>> But we are now in the realm of theory as far as you are concerned, since
>>> you have already stated several times that you
Hi;
The following code that works:
#! /usr/bin/python
import string
import cgitb; cgitb.enable()
import cgi
import MySQLdb
import sys,os
from sets import Set
import fpformat
cwd = os.getcwd()
sys.path.append(cwd)
from login import login
from particulars import ourOptions
form = cgi.FieldStorage(
Nobody writes:
> RC4 (aka ArcFour) is quite trivial to implement, and better than inventing
> your own cipher or using a Vignere: ...
That's a cute implementation, but it has no authentication and doesn't
include any randomness, which means if you use the same key for two
inputs, there is a secur
>> Thanks, this looks very simple too, but where is the decryption code?
>> Wikipedia seems to suggest that encryption and decryption are both the
>> same but running crypt on the output of crypt doesn't give back the
>> original string. So probably I'm misunderstanding something.
>
> Yes, the natu
Ryniek90 wrote:
I've just finished reading a sort of beginner Python book, and I know
quite a bit now but I'm looking for a book that can teach me advanced
aspects of Python - code optimisation, threading, etc.
Any recommendations?
Cheers.
Check those link:
http://www.amazon.com/Beginni
Hellmut Weber wrote:
>> being a causal python user (who likes the language quite a lot)
>> it took me a while to realize the following:
>> >>> max = '5'
>> >>> n = 5
>> >>> n >= max
>> False
>
>> Section 5.9 Comparison describes this.
>>
>> Can someone give me examples of use cases
Peter Ot
On Sun, 10 Jan 2010 15:30:12 +, Steven D'Aprano wrote:
>> Thanks, this looks very simple too, but where is the decryption code?
>> Wikipedia seems to suggest that encryption and decryption are both the
>> same but running crypt on the output of crypt doesn't give back the
>> original string. S
On Sun, 10 Jan 2010 09:59:31 +0100, Daniel Fetchinson wrote:
> Thanks, this looks very simple too, but where is the decryption code?
> Wikipedia seems to suggest that encryption and decryption are both the
> same but running crypt on the output of crypt doesn't give back the
> original string. So
Hi all,
I'm pleased to announce here that Spyder version 1.0.2 has been released:
http://packages.python.org/spyder
Previously known as Pydee, Spyder (Scientific PYthon Development
EnviRonment) is a free open-source Python development environment
providing MATLAB-like features in a simple and li
On Sun, 10 Jan 2010 09:59:31 +0100, Daniel Fetchinson wrote:
> Thanks, this looks very simple too, but where is the decryption code?
> Wikipedia seems to suggest that encryption and decryption are both the
> same but running crypt on the output of crypt doesn't give back the
> original string. So
> I've just finished reading a sort of beginner Python book, and I know
> quite a bit now but I'm looking for a book that can teach me advanced
> aspects of Python - code optimisation, threading, etc.
>
> Any recommendations?
>
> Cheers.
Check those link:
http://www.amazon.com/Beginning-Python-V
On 10 ene, 13:10, Joan Miller wrote:
> On 10 ene, 12:36, Peter Otten <__pete...@web.de> wrote:
>
>
>
> > Joan Miller wrote:
> > > On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote:
> > >> Joan Miller wrote:
> > >> > How to prepend anything to a logging message? Is possible to do it
> > >> > f
I've just finished reading a sort of beginner Python book, and I know
quite a bit now but I'm looking for a book that can teach me advanced
aspects of Python - code optimisation, threading, etc.
Any recommendations?
Cheers.
--
http://mail.python.org/mailman/listinfo/python-list
Hellmut Weber wrote:
> being a causal python user (who likes the language quite a lot)
> it took me a while to realize the following:
>
>
> l...@sylvester py_count $ python
> Python 2.6.3 (r263:75183, Oct 26 2009, 12:34:23)
> [GCC 4.4.1] on linux2
> Type "help", "copyright", "credits" or "licens
On 10 ene, 12:36, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
> > On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote:
> >> Joan Miller wrote:
> >> > How to prepend anything to a logging message? Is possible to do it
> >> > from the dictionary object (ExtraLog) or is there is that
On Sun, Jan 10, 2010 at 4:46 AM, Chris Rebert wrote:
> The behavior of disparate types being comparable is deprecated and has
> been removed in Python 3.0+; don't rely upon it.
Clarification: Equality testing between disparate types still works
unaltered however.
By "comparable", I meant >, <, >
On Sun, Jan 10, 2010 at 4:26 AM, Hellmut Weber wrote:
> Hi,
> being a causal python user (who likes the language quite a lot)
> it took me a while to realize the following:
>
>
> l...@sylvester py_count $ python
> Python 2.6.3 (r263:75183, Oct 26 2009, 12:34:23)
> [GCC 4.4.1] on linux2
> Type "hel
Joan Miller wrote:
> On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote:
>> Joan Miller wrote:
>> > How to prepend anything to a logging message? Is possible to do it
>> > from the dictionary object (ExtraLog) or is there is that override
>> > process() [1]?
>>
>> > --
>> > cla
Hi,
being a causal python user (who likes the language quite a lot)
it took me a while to realize the following:
l...@sylvester py_count $ python
Python 2.6.3 (r263:75183, Oct 26 2009, 12:34:23)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> max
Matthew Lear wrote:
> Hello,
>
> I'm having problems getting getopt to function correctly. Basically, no
> exception is being raised if no argument is passed to the code snippet
> below. I've read the Python documentation and tried example code from
> various sources which should cause an exceptio
Hello,
I'm having problems getting getopt to function correctly. Basically, no
exception is being raised if no argument is passed to the code snippet
below. I've read the Python documentation and tried example code from
various sources which should cause an exception, only they don't. I've
also tr
On 10 ene, 10:26, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
> > How to prepend anything to a logging message? Is possible to do it
> > from the dictionary object (ExtraLog) or is there is that override
> > process() [1]?
>
> > --
> > class ExtraLog(object):
>
> >
On Jan 10, 8:51 pm, pp wrote:
> On Jan 9, 8:23 am, John Machin wrote:
>
>
>
> > On Jan 9, 9:56 pm, pp wrote:
>
> > > On Jan 9, 3:52 am, Jon Clements wrote:
>
> > > > On Jan 9, 10:44 am, pp wrote:
>
> > > > > On Jan 9, 3:42 am, Jon Clements wrote:
>
> > > > > > On Jan 9, 10:24 am, pp wrote:
>
>> ... And I am interested in cleaning this up. I should probably
>> start with the matter of databases, since that's something I won't be able
>> to easily change once clients actually start entering data. Please share
>> with me any further concepts or questions to get me thinking how to redesign
Joan Miller wrote:
> How to prepend anything to a logging message? Is possible to do it
> from the dictionary object (ExtraLog) or is there is that override
> process() [1]?
>
> --
> class ExtraLog(object):
>
> def __getitem__(self, name):
> if name == 'foo':
>
On Jan 9, 8:23 am, John Machin wrote:
> On Jan 9, 9:56 pm, pp wrote:
>
> > On Jan 9, 3:52 am, Jon Clements wrote:
>
> > > On Jan 9, 10:44 am, pp wrote:
>
> > > > On Jan 9, 3:42 am, Jon Clements wrote:
>
> > > > > On Jan 9, 10:24 am, pp wrote:
> > > > yeah all my versions are latest fromhttp:/
Peter Billam, 10.01.2010 10:15:
Greetings. Is there a way to get at the Computer Music Toolkit (CMT)
http://www.ladspa.org/cmt/
functionality from Python (Python3 in my case) ?
Googling is confusing because of www.cmt.com and cmt-graph and
openscientist.lal.in2p3.fr/v9/cmt.html and pyAMISecure
On 10 ene, 03:27, Ishwor Gurung wrote:
> Joan,
>
> 2010/1/10 Joan Miller :
>
>
>
> > How to prepend anything to a logging message? Is possible to do it
> > from the dictionary object (ExtraLog) or is there is that override
> > process() [1]?
>
> > --
> > class ExtraLog(object):
>
>
Oki, it seems I've found.
To directly use a bytearray buffer from ctypes, you must first create
a compatible ctypes type (I.E, a char array of same size), and only
then instanciate this new type with newtype.from_buffer
(bytearray_object).
The little danger is : you must NOT change the size of by
Greetings. Is there a way to get at the Computer Music Toolkit (CMT)
http://www.ladspa.org/cmt/
functionality from Python (Python3 in my case) ?
Googling is confusing because of www.cmt.com and cmt-graph and
openscientist.lal.in2p3.fr/v9/cmt.html and pyAMISecure_and_cmt
and so on...
Regards, P
>> I have a plain text file which I would like to protect in a very
>> simple minded, yet for my purposes sufficient, way. I'd like to
>> encrypt/convert it into a binary file in such a way that possession of
>> a password allows anyone to convert it back into the original text
>> file while not po
On Fri, 08 Jan 2010 20:14:51 +0100, Daniel Fetchinson wrote:
> I have a plain text file which I would like to protect in a very
> simple minded, yet for my purposes sufficient, way. I'd like to
> encrypt/convert it into a binary file in such a way that possession of
> a password allows anyone to c
On Fri, 08 Jan 2010 11:44:48 +0800, Water Lin wrote:
> I am a new guy to use Python, but I want to parse a html page now. I
> tried to use HTMLParse. Here is my sample code:
> --
> from HTMLParser import HTMLParser
Note that HTMLParser only tokenises HTML; it doesn't actually
On Wed, 06 Jan 2010 19:05:40 -0800, Steven K. Wong wrote:
> Well, the example code at
> http://www.python.org/ ... /subprocess.html#replacing-shell-pipeline
> has the same issue:
> Perhaps the doc can be improved to remind folks to close p1.stdout if
> the calling process doesn't need it, unless
84 matches
Mail list logo