On 21 Nov 2005 13:59:12 -0800, [EMAIL PROTECTED] wrote:
>I tried the solutions you provided..these are not as robust as i
>thought would be...
>may be i should put the problem more clearly...
>
>here it goes
>
>I have a bunch of documents and each document has a header which is
>common to all
Alex Martelli wrote:
> > In the specific case of iter(), are there good
> > alternative ways of detecting an iterable without
> > consuming it?
>
> Not a problem I've had often, but when I did, if I recall correctly, I
> did something like:
>
> try:
> iter
> except NameError:
> def isiterable(
> http://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm
> has a Python example implementation of qubic Bezier curves available.
Here my port to Tkinter (doesn't need PIL)
from Tkinter import *
master = Tk()
objTkCanvas = Canvas(master, width=110, height=180)
objTkCanvas.pack()
def midpoint((x1
Thank you very much Dan.I settle the problem according to you tips.On 11/22/05, Dan Lowe <[EMAIL PROTECTED]
> wrote:On Nov 22, 2005, at 12:30 AM, could ildg wrote:> Thank you~
> It works!> but how can paste "<" and ">", please?> these 2 symbols will also confuse wordpress and I can't publish> what
http://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm
has a Python example implementation of qubic Bezier curves available.
Claudio
"Warren Francis" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> I'm fairly new to Python (2-3 months) and I'm trying to figure out a
simple
>
There is the BayPiggies user group: [EMAIL PROTECTED] It meets
monthly alternating between Mt. VIew (Google) and San Bruno (IronPort).
n
--
bruce wrote:
> hey...
>
> i'm looking for classes (advanced) in python/php in the bay area as well...
> actually i'm looking for the students/teachers/prof
On Mon, 21 Nov 2005 19:39:42 -0500, Peter Hansen <[EMAIL PROTECTED]> wrote:
>amfr wrote:
>> Thanks for your help. Another question, is there an built in md5/sha1
>> function in python?
>
>Yes.
>
>Although it's a long list, it is worthwhile as a newbie for one to
>peruse the list of standard modu
On Nov 22, 2005, at 12:30 AM, could ildg wrote:
> Thank you~
> It works!
> but how can paste "<" and ">", please?
> these 2 symbols will also confuse wordpress and I can't publish
> what I want.
Replace < with <
Replace > with >
(where those abbreviations stand for "less than" and "greater t
Has anyone found a way besides not deriving from dict?
Shouldn't there be a way?
TIA
(need this for what I hope is an improvement on the Larosa/Foord OrderedDict ;-)
I guess I can just document that you have to spell it dict(d.items()), but I'd
like to hide the internal shenanigans ;-)
Regards,
B
Alex Martelli wrote:
> "Consuming" didn't really come into consideration for the
> backwards compatibility part because only objects indexable with
> integers, 0 and up (and raising IndexError at some point) were usable in
> for statements in old Pythons, there was no "consuming".
Ah yes, of cour
Shi Mu wrote:
> I run the following code and got wrong message, but I still want to
> make [1,2],[4,3] and [6,9] to be keys of the dictionary or change the
> style a little bit. How to do that?
Make them tuples:
>>> p=[[1,2],[4,3],[6,9]]
>>> n=dict([(tuple(x),[]) for x in p])
>>> n
{(6, 9): [
Simon Burton wrote:
> I'm having some trouble linking one extension module to another because
> the linker expects a "lib" prefix and my python modules cannot have
> this prefix.
This is a Good Thing (tm) :-) Don't link extension modules to each
other; this is really asking for trouble. Instead, c
Roy Smith wrote:
> Is there any way to access the RFC 3542 defined macros such as
> ICMP6_FILTER_SETPASSALL() from within the socket module?
No. Not sure it would belong into the socket module, though:
an icmp module could be developed independently from the socket
module if needed.
Regards,
Ma
I run the following code and got wrong message, but I still want to
make [1,2],[4,3] and [6,9]
to be keys of the dictionary or change the style a little bit. How to do that?
Thanks!
>>> p=[[1,2],[4,3],[6,9]]
>>> n=dict([(x,[]) for x in p])
Traceback (most recent call last):
File "", line 1, in ?
hi,
i am trying to develop a small gui app using boa constructor. say this
app has one frame which has one static text control. i want the frame
to resize itself to the width of the text contrl when i change the
label of the text control via SetLabel(). how can i do this in boa
constructor?
can an
Thank you~It works!but how can paste "<" and ">", please?these 2 symbols will also confuse wordpress and I can't publish what I want.On 11/22/05,
Dan Lowe <[EMAIL PROTECTED]> wrote:
On Nov 21, 2005, at 8:17 PM, could ildg wrote:> Wordpress.com blog will eat up the spaces before a line,> just as it
thakadu wrote:
> So it seems I am forced to use the bsddb185 module
> which does not have convenient record level methods.
> Am I missing something here or have others eperienced
> tha same?
I think you are missing that bsddb185 implements the
dictionary interface. So you can use [key] to access
t
Hi,
I'm having some trouble linking one extension module to another because
the linker expects a "lib" prefix and my python modules cannot have
this prefix.
I found two ways of doing it on a linux box (either symlink or create a
dummy .so that links to extension module) but I can get neither of
Jeffrey Schwab <[EMAIL PROTECTED]> wrote:
...
> > You may be gratified to learn that Python's main storage model
> > is reference counted objects, and when an object falls out of
> > all referenced scopes its finalizers run immediately.
>
> Thanks, that's good to know! For some reason I had it
Is there any way to access the RFC 3542 defined macros such as
ICMP6_FILTER_SETPASSALL() from within the socket module? A dir() on the
socket module (Python 2.4.1, built on a solaris box with IPv6 support)
doesn't show anything that looks like it (and socket.has_ipv6 is True).
--
http://mail.p
Hello,
I'm attempting to develop a plugin framework for an application that I'm
working on. I wish to develop something in which all plugins exist in a
directory tree. The framework need only be given the root of the tree. The
framework then uses os.path.walk to search all for all files nam
Great, thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano <[EMAIL PROTECTED]> wrote:
...
> In the specific case of iter(), are there good
> alternative ways of detecting an iterable without
> consuming it?
Not a problem I've had often, but when I did, if I recall correctly, I
did something like:
try:
iter
except NameError:
def i
In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> Is there a way to instruct Python to import modules from standard
> library even if there is one with the same name in the current working
> directory? I was trying to import BaseHTTPServer.py from standard
> library but was prevented by
Is there a way to instruct Python to import modules from standard
library even if there is one with the same name in the current working
directory? I was trying to import BaseHTTPServer.py from standard
library but was prevented by a python file with the same name in
current working directory (but
Fredrik Lundh wrote:
> Steven D'Aprano wrote:
>
>
>>Alas and alack, I have to write code which is backwards
>>compatible with older versions of Python:
[snip]
>>What should I do when I can't rely on functions that
>>don't exist in older versions of Python?
>
>
> python 2.1 doesn't support it
Peter Hansen wrote:
> Okay, granted. I guess this is the same as in any other case of
> deprecation (e.g. some people still have to work with code that uses
> apply() or string module methods).
Yup, this is exactly what will have to happen. Most or all of os.path
and maybe some of os/glob/fnmatc
On 11/22/05, Paul McGuire <[EMAIL PROTECTED]> wrote:
Or for a large literal string:"""lots of text hundreds of characters long
more text on another line but we really don't want any line breaksin our final stringso we replace newlines in this multiline stringwith an empty string thus""".replace('\n
Works!!
Thank you all so much. I didn't know it was coming back as a tuple, and
I'm sure that would have taken me four hours to figure out.
Appreciate it!
bs
Chris Curvey wrote:
> mxODBC implements the Python DB-API spec, which states that each "row"
> of query results is returned as
Is there any way to have one program run another arbitrary program
with input from stdin and display the output as if you had run it in
a shell (i.e., you'd see some of the output followed by the input
they typed in and then a newline because they pressed return followed
by subsequent outp
On Nov 21, 2005, at 8:17 PM, could ildg wrote:
> Wordpress.com blog will eat up the spaces before a line,
> just as it will trim every line of my article. So I can't paste
> python code indentedly.
> Does any one use wordpress blog here?
> Please tell me how to leave the sapces as they are when
mxODBC implements the Python DB-API spec, which states that each "row"
of query results is returned as a tuple. If you want the data
displayed differently, you can do it yourself.
for row in rows:
print "\t".join(row)
should do it.
--
http://mail.python.org/mailman/listinfo/python-list
BartlebyScrivener wrote:
> Hello, I'm new to python and trying to get records from an MSAccess
> database using mxODBC. It works, but the output is not formatted the
> way I want it.
>
> Here's the script:
>
> import mx.ODBC.Windows as odbc
>
> driv='DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:
The Bezier gives control points with natural interpretations and a
nice "within the convex hull" property. I happen to like Beziers to
control curves which are aestheticly, rather than computationally
defined.
--
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo
Wordpress.com blog will eat up the spaces before a line,
just as it will trim every line of my article. So I can't paste python code indentedly.
Does any one use wordpress blog here?
Please tell me how to leave the sapces as they are when publishing ariticles on the blog,
Thank you.
--
http://mail
Hello, I'm new to python and trying to get records from an MSAccess
database using mxODBC. It works, but the output is not formatted the
way I want it.
Here's the script:
import mx.ODBC.Windows as odbc
driv='DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:/Access
Databases/Quotations2005'
conn =
If I found the right "U3" when I googled, then maybe this is relevant:
http://www.voidspace.org.uk/python/movpy/
Jeff
pgp1AjuUdEskN.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
...
> But I think the following rule is "natural" enough to consider it as THE
> standard behavior of ordered dictionaries:
>
> "Insertion: If the key exists: Don't change the order. If it does not
> exist: Append it to the sequence of keys. Deleti
amfr wrote:
> Thanks for your help. Another question, is there an built in md5/sha1
> function in python?
Yes.
Although it's a long list, it is worthwhile as a newbie for one to
peruse the list of standard modules from time to time, until you gain a
familiarity with what is there.
http://docs
Thanks, all I wanted to know where the post data was stored from the
request
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for your help. Another question, is there an built in md5/sha1
function in python?
--
http://mail.python.org/mailman/listinfo/python-list
Hi Steven,
Le die Mon, 21 Nov 2005 11:37:37 -0700, Steven Bethard ha scribite:
[...]
> In the basic situation, where the instance is created in the same
module
> as the class, I can figure out 'mod' and 'name' like::
>
> cls = type(self)
> name = cls.__module__
> mod = __import__(c
Hi Magnus,
thanks a lot for your posting, you made me clear several things.
However, there something I still want to discuss:
Le die Mon, 21 Nov 2005 20:08:24 +0100, Magnus Lycka ha scribite:
[...]
> In an apache cgi-bin directory: The main Python CGI script(s) that are
> called by the web serve
On 21 Nov 2005 01:54:38 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>Fredrik Lundh wrote:
>> [EMAIL PROTECTED] wrote:
>>
>> > If I need the dict feature 90% of the time, and the list feature 10% of
>> > the time.
>>
>> Wasn't your use case that you wanted to specify form fields in
>> a
On 20 Nov 2005 20:34:39 -0800, "Alex" <[EMAIL PROTECTED]> wrote:
>I apologize for asking maybe a very trivial question.
>I have a new class object A with slots. One of the slots is, for
>example, object spam. Object spam, in turn, also has slots and one of
>them is attribute eggs. I need to assig
On Mon, 21 Nov 2005 15:23:20 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>David (Alan) Isaac wrote:
>
>> What's the good way to produce a cumulative sum?
>> E.g., given the list x,
>> cumx = x[:]
>> for i in range(1,len(x)):
>> cumx[i] = cumx[i]+cumx[i-1]
>>
>> What's the better way?
>
>Is
On Mon, 21 Nov 2005 01:27:22 +0100, Christoph Zwerschke <[EMAIL PROTECTED]>
wrote:
>Fredrik Lundh wrote:
>> if you restructure the list somewhat
>> d = (
>> ('pid', ('Employee ID', 'int')),
>> ('name', ('Employee name', 'varchar')),
>> ('sal', ('Salary', 'float'))
>>
On 11/17/05, Shi Mu <[EMAIL PROTECTED]> wrote:
> why subtract 1 from max_y - original_y?
Because in the computer science world we like starting to count at 0.
image_size = 1000
original_y = 25 # Really the 26th pixel line.
new_y = 1000 - 25 - 1 # 26 pixels from the bottom of the screen.
--
Steve
On 20 Nov 2005 21:12:52 -0800, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
>Bengt Richter wrote:
>> On Sun, 20 Nov 2005 22:03:34 +0100, Christoph Zwerschke <[EMAIL PROTECTED]>
>> wrote:
>> >> Ordering the keys isn't the normal case, and can be done easily when
>> >> needed.
>> >
>> >That dep
On 20 Nov 2005 12:00:02 -0800, "amfr" <[EMAIL PROTECTED]> wrote:
>Hoe would I call something on the command line from python, e.g. "ls
>-la"?
>
Depends on how much control you want over where the output goes.
If you want the result as a multi-line string formatted the way
the system utility (ls he
"Ben Finney" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Xiao Jianfeng <[EMAIL PROTECTED]> wrote:
> > I need to print a long sting, which is two long so it must expand
> > two lines.
>
> How is this string being constructed in the source? If it exists as a
> single long string, wh
On Mon, 21 Nov 2005 10:35:20 +0200, Sinan Nalkaya <[EMAIL PROTECTED]> wrote:
>Dennis Lee Bieber wrote:
>
>>On Fri, 18 Nov 2005 22:45:37 -0500, Peter Hansen <[EMAIL PROTECTED]>
>>declaimed the following in comp.lang.python:
>>
>>
>>
>>>It's quite unclear whether the last part, above, is one of yo
On Mon, 21 Nov 2005, Tom Anderson wrote:
> On Sun, 20 Nov 2005, Warren Francis wrote:
>
>> Basically, I'd like to specify a curved path of an object through space. 3D
>> space would be wonderful, but I could jimmy-rig something if I could just
>> get 2D... Are bezier curves really what I want a
What I am trying to do is call perl on the command line. Also, do any
of these functions return the data recievved from the command?
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I am attemtping to package Python in a "U3" install program for Windows.
I got Python to compile/link and prior to adding the necessary code for the
U3 SDK registration, I would like to know where I can find the actual list
of files needed for a minimum installation (are DLLs and libs enough
Paul Watson wrote:
> My desire to have the code distributed through a web page is just to
> ensure that the user is running the correct version and has not hacked
> it in any way. I suppose I can checksum the local client application
> and compare it with what is on the server. Then, make a wa
javuchi wrote:
> I'm searching for a library which makes aproximative string matching,
> for example, searching in a dictionary the word "motorcycle", but
> returns similar strings like "motorcicle".
>
> Is there such a library?
>
Perhaps the get_close_matches function that is presentt in the st
Thanks,
Regards,
Philippe
"Martin v. Löwis" wrote:
> Philippe C. Martin wrote:
>>>My mistake: The makefile (as written in the readme!) looks for bzip 1.0.2
>>>
>>
>> PS: since bzip.org does not have 1.0.2 source anymore, can I just rename
>> 1.0.3 ?
>
> That should work; alternatively, you c
Does anyone know how to set modal to True for Gtk::FileChooserDialog?
Thanks
Thierry
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 21 Nov 2005 19:47:45 +0100, Diez B. Roggisch wrote:
> The idea is that otherwise e.g. "cat" and "hippopothamus" have a
> l-distance of only 3, which one would consider good at the first look.
???
I make it that the L-distance between cat and hippopothamus is twelve, not
three. With len(
I needed to generate some C code for a fast lookup table using
piecewise-cubic interpolation. If anybody else needs this, the Python
code for it is at http://tinyurl.com/92zcs (alt.source, Google Groups).
Will Ware
--
http://mail.python.org/mailman/listinfo/python-list
I have an application that needs to create and delete
records in a Berkeley DB version 1.85 database.
If I use the bsdddb185 module I dont see any
of the record manipulation methods in there that
are available in the newer bsddb module.
(put(), get(), pop() etc)
I know the docs say that one should
Fredrik Lundh wrote:
> I'll repeat this one last time: for the use cases presented by Zwerschke
> and "bonono", using a list as the master data structure, and creating the
> dictionary on demand, is a lot faster than using a ready-made ordered
> dict implementation. if you will access things via t
Tom Anderson wrote:
> > If you program threads with shared nothing and communication over Queues
> > you are, in effect, using processes. If all you share is read-only
> > memory, similarly, you are doing "easy" stuff and can get away with it.
> > In all other cases you need to know things like "w
I tried the solutions you provided..these are not as robust as i
thought would be...
may be i should put the problem more clearly...
here it goes
I have a bunch of documents and each document has a header which is
common to all files. I read each file process it and compute the
frequency of w
Xiao Jianfeng wrote:
> self.assertEquals(result, expected)
> AssertionError: '-0' != '0'
>
> Can somebody tell me what's the problem ?
It looks like there is some minor bug in the floating
point libraries of your operating system: Python expects
that the strings for both numbers are the same in t
Philippe C. Martin wrote:
>>My mistake: The makefile (as written in the readme!) looks for bzip 1.0.2
>>
>
> PS: since bzip.org does not have 1.0.2 source anymore, can I just rename
> 1.0.3 ?
That should work; alternatively, you can change the project file.
Regards,
Martin
--
http://mail.python
Donn Cave wrote:
> In article <[EMAIL PROTECTED]>,
> Jeffrey Schwab <[EMAIL PROTECTED]> wrote:
>
>
>>Yes it is. Memory is only one type of resource. There are still files
>>and sockets to close, pipes to flush, log messages to be printed, GDI
>>contexts to free, locks to release, etc. I
Hi!
Let down subprocess, and remember popen4.
Here, an example (with CMD, under w-XP) :
import os
def lcmd(lst=None):
a = os.popen4(lst[0])
for i in lst[1:]:
if i!='':
a[0].write(i+'\r\n')
a[0].flush()
return a[1].readlines()
l=[
'CMD /K',
'DIR *.c
In article <[EMAIL PROTECTED]>,
Jeffrey Schwab <[EMAIL PROTECTED]> wrote:
...
> Yes it is. Memory is only one type of resource. There are still files
> and sockets to close, pipes to flush, log messages to be printed, GDI
> contexts to free, locks to release, etc. In C++, these things are
>
[EMAIL PROTECTED] wrote:
> Sorry Peter,
> Try this
>
> import unittest
> import Numeric
>
> class myTest(unittest.TestCase):
> def runTest(self):
> var1 = Numeric.array([1,22])
> var2 = Numeric.array([1,33])
> self.assertEqual(var1,var2)
>
> if __name__ == '__main
[EMAIL PROTECTED] writes:
> thanks for that. But this will check for the exact content of the
> "start of block.." or "end of block". How about if the content is
> anywhere in the line?
Then the test is '"start of block." in line'. You could also use
the line.find or line.index methods, b
commands is Unix only. This is Windows specific
--
http://mail.python.org/mailman/listinfo/python-list
Mardy wrote:
> Hi,
> I've built a small project (http://eligante.sf.net) which I'm actually
> trying to package using distutils.
...
> However, I don't know if this directory layout is suitable for
> site-packages, since at a first glance it looks to me that datafiles might
> not be welcome under
BroLewis wrote:
> I have been trying for several weeks now to write a program that
> allows me to read the stdout of a process that I spawn and once
> I receive feedback, act appropriately.
Have you looked into the 'commands' module?
Cheers,
--
Klaus Alexander Seistrup
Copenhagen, Denmark
ht
I have been trying for several weeks now to write a program that allows
me to read the stdout of a process that I spawn and once I receive
feedback, act appropriately.
More specifically, I need to create an SSH tunnel using plink on
Windows XP. Once the tunnel is successfully created, then I need
thanks for that. But this will check for the exact content of the
"start of block.." or "end of block". How about if the content is
anywhere in the line?
--
http://mail.python.org/mailman/listinfo/python-list
Let's say I have a main window which has a File menu. When I click on
the File menu and the open button, I have a File selector window which
comes in front of my main window. How do I make the main window
unselectable?
Thanks
Thierry
--
http://mail.python.org/mailman/listinfo/python-list
Fredrik Lundh wrote:
> huh? if you want a list, use a list.
>
> d = [('a', {...}), ('b', {})]
If one wants uniform access to a nested data structure like this one
usually starts writing a wrapper class. I do not think the requirement
is anyhow deeper than a standard wrapper around such a
> Alan Isaac wrote:
>> Like SciPy's cumsum.
"Colin J. Williams" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Doesn't numarray handle this?
Sure.
One might say that numarray is in the process of becoming scipy.
But I was looking for a solution when these are available.
Something
[EMAIL PROTECTED] writes:
> Hi I need help. What I want to do is If I read a file with some text
> content...
> I would like to ignore a block of lines and consider the rest..
> so if the block starts with
>
> "start of block."
> fjesdgsdhfgdlgjklfjdgkd
> jhcsdfskdlgjkljgkfdjkgj
> "end
Philippe C. Martin wrote:
> My mistake: The makefile (as written in the readme!) looks for bzip 1.0.2
>
PS: since bzip.org does not have 1.0.2 source anymore, can I just rename
1.0.3 ?
Regards,
Philippe
> Sorry,
>
> Philippe
>
>
>
> Philippe C. Martin wrote:
>
>> Hi,
>>
>> I'm currently
[EMAIL PROTECTED] (Bengt Richter) writes:
>>Eric Jacoboni, ne il y a 1435938104 secondes
> Um, about your sig ... ;-)
Well, i confess it's Ruby code... Maybe, one day, i will try to write
a Python Version (with DateTime, i guess?) but i'm afraid it doesn't
change the result.
--
Eric Jacoboni, ne
My mistake: The makefile (as written in the readme!) looks for bzip 1.0.2
Sorry,
Philippe
Philippe C. Martin wrote:
> Hi,
>
> I'm currently blocking on bzip2:
>
> python is in c:\python.2.4.2
> and bz2 is in c:\bzip2-1.0.3
>
> Since the readme say subprojects should be two directories abov
Hi,
I'm currently blocking on bzip2:
python is in c:\python.2.4.2
and bz2 is in c:\bzip2-1.0.3
Since the readme say subprojects should be two directories above PCbuild, I
assume I'm OK.
I added c:\bzip2-1.0.3 to the include and link path, but I get:
"""
Performing Pre-Link Event ...
The system
On Sun, 20 Nov 2005, Alex Martelli wrote:
> Christoph Zwerschke <[EMAIL PROTECTED]> wrote:
>
>> The 'sorted' function does not help in the case I have indicated, where
>> "I do not want the keys to be sorted alphabetically, but according to
>> some criteria which cannot be derived from the keys
On Sun, 20 Nov 2005, Warren Francis wrote:
> Basically, I'd like to specify a curved path of an object through space.
> 3D space would be wonderful, but I could jimmy-rig something if I could
> just get 2D... Are bezier curves really what I want after all?
No. You want a natural cubic spline:
Steven D'Aprano wrote:
> [EMAIL PROTECTED] wrote:
>
>> This algorithm is called soundex. Here is one implementation example.
>>
>> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52213
>>
>> here is another:
>> http://effbot.org/librarybook/soundex.htm
>
>
> Soundex is *one* particular a
pkilambi> I would like to ignore a block of lines and consider the
pkilambi> rest.. so if the block starts with
pkilambi> "start of block."
pkilambi> fjesdgsdhfgdlgjklfjdgkd
pkilambi> jhcsdfskdlgjkljgkfdjkgj
pkilambi> "end of block"
pkilambi> I want to ig
The setup: I'm working within a framework (designed by someone else)
that requires a number of module globals to be set. In most cases, my
modules look like:
(1) a class definition
(2) the creation of one instance of that class
(3) binding of the instance methods to the appropriate module global
* Alex Martelli <[EMAIL PROTECTED]>:
> [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Sorry Peter,
> >
> > Try this
> >
> > import unittest
> > import Numeric
> >
> > class myTest(unittest.TestCase):
> > def runTest(self):
> > var1 = Numeric.array([1,22])
> > var2 =
Hi I need help. What I want to do is If I read a file with some text
content...
I would like to ignore a block of lines and consider the rest..
so if the block starts with
"start of block."
fjesdgsdhfgdlgjklfjdgkd
jhcsdfskdlgjkljgkfdjkgj
"end of block"
I want to ignore this while proc
Hi,
I've built a small project (http://eligante.sf.net) which I'm actually
trying to package using distutils.
The directory structure is going to be like this:
eligante/
eligante.py
sitobase.py
personas.py
[...other python files...]
modulos/
Alex Martelli wrote:
import Numeric
a=Numeric.array([1,22])
b=Numeric.array([1,33])
c = a==b
c
>
> array([1, 0])
>
assert(c)
>
> i.e., thanks to element-by-element evaluation, == will generally return
> a true value for ANY comparison of Numeric arrays, causing a very
>
In article <[EMAIL PROTECTED]>,
Alex Martelli <[EMAIL PROTECTED]> wrote:
>
>I think you're wrong here. People in the past who have requested or
>implemented stuff they called 'ordered dicts' in the past had in mind
>drastically different things, based on some combination of insertion
>orders, keys
"Shi Mu" wrote:
> Got confused by the following code:
> >>> a
[6, 3, 1]
> >>> b
[4, 3, 1]
> >>> c
> {1: [[6, 3, 1], [4, 3, 1]], 2: [[6, 3, 1]]}
> >>> c[2].append(b.sort())
> >>> c
> {1: [[6, 3, 1], [1, 3, 4]], 2: [[6, 3, 1], None]}
> #why c can not append the sorted b??
In python 2.4, you can
"Shi Mu" wrote:
> Got confused by the following code:
> >>> a
[6, 3, 1]
> >>> b
[4, 3, 1]
> >>> c
> {1: [[6, 3, 1], [4, 3, 1]], 2: [[6, 3, 1]]}
> >>> c[2].append(b.sort())
> >>> c
> {1: [[6, 3, 1], [1, 3, 4]], 2: [[6, 3, 1], None]}
> #why c can not append the sorted b??
In python 2.4, you can
[EMAIL PROTECTED] wrote:
> most built-in function/method don't return the "object" but None. This
> I believe is the language creator's preference for everything being
> explicit.
The list methods .sort() and .reverse() don't create copies,
but rather change the existing object. The reson for thi
David Isaac wrote:
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
>>He seems to want scanl
>
>
> Yes. But it's not in Python, right?
> (I know about Keller's version.)
>
> Robert Kern wrote:
>
>>Define better. More accurate? Less code?
>
>
> Good point.
> As Bonono (?) su
Alex Martelli wrote:
> Note the plural in 'insertion orderS': some people care about the FIRST
> time a key was added to a dict, some about the LAST time it was added,
> some about the latest time it was 'first inserted' (added and wasn't
> already there) as long as it's never been deleted since t
1 - 100 of 175 matches
Mail list logo