Christoph Zwerschke wrote:
> Bryan Olson schrieb:
>
>>> Still think there is no such thing?
>>
>>
>> Uh, yes.
>>
>>The Cartesian product of two sets A and B (also called the
>>product set, set direct product, or cross product) is defined to
>>be the set of [...]
>>
>> All sets, no stri
Christoph Zwerschke wrote:
> Now as I'm thinking about it, wouldn't it be nice to have the cartesian
> products on Python sets? Maybe also a method that returns the power set
> of a set (the set of all subsets), or the set of all subsets with a
> given length.
For defining powersets it might suf
Hi all,
I have released IPython 0.7.1, which is mainly a bugfix release over 0.7.0.
As expected in that release, given the large changes made, some problems
inevitably appeared. I believe all regressions and known bugs have been
fixed, along with some useful new features.
This release marks the
rbt wrote:
> Can someone detail the differences between these two? On Windows which
> is preferred?
They do the same thing: unlink calls DeleteFile. The only difference is
how errors are reported.
For portability, os.unlink is preferred.
Regards,
Martin
--
http://mail.python.org/mailman/listinf
Andrae Muys wrote:
> [EMAIL PROTECTED] wrote:
> > Thank you for the posting Andrae, it has increased my
> > knowledge.
> No problem, happy to help.
> > But my original point was there are cases (often involving
> > file iterators) where the problem's complexity seems to be
> > on the same order as
On Mon, 23 Jan 2006 21:43:16 +1100, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>On Sun, 22 Jan 2006 16:40:48 -0800, Paul Rubin wrote:
>
>> Steve Holden <[EMAIL PROTECTED]> writes:
>>> > The current list function is supposed to be something like a
>>> > typecast:
>>> >
>>> list() isn't a function,
[EMAIL PROTECTED] wrote:
> Thank you for the posting Andrae, it has increased my
> knowledge.
No problem, happy to help.
> But my original point was there are cases (often involving
> file iterators) where the problem's complexity seems to be
> on the same order as problems involving iterate-to-sh
Martin v. Löwis wrote:
> Frank Millman wrote:
> > In principle I agree. My concern was that I might have inadvertently
> > done something wrong (e.g. left a reference dangling) which would
> > prevent gc from removing all objects which I wanted to be removed.
>
> Depends on what it really is that
Christoph Zwerschke wrote:
> Bryan Olson schrieb:
>
>>> Still think there is no such thing?
>>
>>
>> Uh, yes.
>>
>>The Cartesian product of two sets A and B (also called the
>>product set, set direct product, or cross product) is defined to
>>be the set of [...]
>>
>> All sets, no stri
Bryan Olson wrote:
> Duncan Booth wrote:
>
>> Here's the way I would do it:
>>
> def occurrences(it):
>>
>>
>> res = {}
>> for item in it:
>> if item in res:
>> res[item] += 1
>> else:
>> res[item] = 1
>> return res
>
>
> I slightly prefer:
James Stroud wrote:
> I can't find "≤, ≥, or ≠" on my keyboard.
Get a better keyboard? or OS?
On OS X,
≤ is Alt-,
≥ is Alt-.
≠ is Alt-=
Fewer keystrokes than <= or >= or !=.
--
Robert Kern
[EMAIL PROTECTED]
"In the fields of hell where the grass grows high
Are the graves of dreams allowed
Kay Schluehr wrote:
> Bryan Olson wrote:
>
>
>>There's no such thing; you'd have to define it first. Are duplicates
>>significant? Order?
>
>
> That's all trivial isn't it? A string is a set of pairs (i,c) where i
> is an integer number, the index, with 0<=i (i,c), (j,d) in string and c is a ch
Steven D'Aprano wrote:
> On Mon, 23 Jan 2006 18:17:08 +, Bryan Olson wrote:
>
>
>>Steven D'Aprano wrote:
>>
>>>Bryan Olson wrote:
>>>
>>[Christoph Zwerschke had written:]
>>
>What I expect as the result is the "cartesian product" of the strings.
There's no such thing; you'd have
Christoph Zwerschke wrote:
> On the page http://wiki.python.org/moin/Python3%2e0Suggestions
> I noticed an interesting suggestion:
>
> "These operators ≤ ≥ ≠ should be added to the language having the
> following meaning:
>
> <= >= !=
>
> this should improve readibility (and make language
On the page http://wiki.python.org/moin/Python3%2e0Suggestions
I noticed an interesting suggestion:
"These operators ≤ ≥ ≠ should be added to the language having the
following meaning:
<= >= !=
this should improve readibility (and make language more accessible to
beginners).
This shoul
Can someone detail the differences between these two? On Windows which
is preferred?
Also, is it true that win32api.DeleteFile() can remove the 'special'
files located in the 'special' folders only accessible by the shell
object such as Temporary Internet Files, etc.
Thanks!
--
http://mail.py
Thus spake Ivan Shevanski ([EMAIL PROTECTED]):
> Alright this is kind of a continuation of a past conversation. . .But not
> really. Anyway, heres the problem. Say I had this:
>
> try:
> x = input("> ")
> except SyntaxError:
>print "explain the problem he
Patch / Bug Summary
___
Patches : 391 open ( +7) / 3028 closed (+12) / 3419 total (+19)
Bugs: 906 open ( -3) / 5519 closed (+19) / 6425 total (+16)
RFE : 207 open ( -1) / 197 closed ( +1) / 404 total ( +0)
New / Reopened Patches
__
Patch for
Bryan Olson schrieb:
>> Still think there is no such thing?
>
> Uh, yes.
>
>The Cartesian product of two sets A and B (also called the
>product set, set direct product, or cross product) is defined to
>be the set of [...]
>
> All sets, no strings. What were you looking at?
Not only
I'm just learning Python myself, but I just saw an example of
something similar. Not sure if this is what you're looking for, but
while 1:
try:
x=input('>')
except Exception, e:
print 'Problems: ', e
else:
break
The else clause is executed UNLESS something is c
Patch / Bug Summary
___
Patches : 391 open ( +7) / 3028 closed (+12) / 3419 total (+19)
Bugs: 905 open ( -4) / 5519 closed (+19) / 6424 total (+15)
RFE : 207 open ( -1) / 197 closed ( +1) / 404 total ( +0)
New / Reopened Patches
__
Patch for
On 23 Jan 2006 10:03:28 -0800,
"ToMasz" <[EMAIL PROTECTED]> wrote:
> Yes, each time the process is created, it remains. os.waitpid(-1,
> os.WNOHANG) doesn't work before starting the process for the first
> time.
Argh. That's what I get for looking at my example too quickly. ;-)
Of course: th
i put this together to fix a bunch of files with wierd names, please
gimme feedback, i am a newbie
#!/usr/bin/env python
import os
import sys
import string
import platform
dir = sys.argv[1]
noworky = sys.argv[2]
if platform.system() == 'Linux':
uglychars = ''.join( set(string.punctuation+' ')
>>> And if I'm reading it correctly, the Perl
>>> script's process starts tcpdump, but redirects its output to its own
>>> input, and reads it line by line.
And to clarify, what the Perl script is doing is redirecting the standard
error to standard out. STDIN is file handle 0, STDOUT is file handl
Duncan Booth showed how to solve a problem posed by Mathijs. This is
very similar to Duncan's solution, except I (ab)use setdefault on a
regular basis...
>>> def occurrences(t):
... res = {}
... for item in t:
... res.setdefault(item,[0])[0] += 1
... return res
...
>>> ref = [
"Andrae Muys" <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > I am still left with a difficult to express feeling of
> > dissatifaction at this process.
> >
> > Plese try to see it from the point of view of
> > someone who it not a expert at Python:
> >
> > Here is izip().
> > My concepti
Hi,
I've come across a bug in CSV where the csv.reader() raises an
exception if the input line contains '\r'. Example code and output
below shows a test case where csv.reader() cannot read an array
written by csv.writer().
I believe this is a known bug and may have been fixed for Python 2.5.
Ho
Is it possible to obtain the client's ip address from a
SimpleXMLRPCServer instance or subclass instance? When running
SimpleXMLRPCServer with logRequests = 1, the xmlrpc server prints out
the fqdn on the console, however, I'm not sure if this information
(either fqdn or ip address) is available t
Mike C. Fletcher wrote:
> OpenGL-ctypes is designed with a fairly well abstracted array-handling
> API. Basically any array type can be registered with handlers that let
> you tell the system how to do basic operations; get an array's size,
> shape, data-type, convert to a given data-format, bui
Ok, so I've figured this out (see below),
mail = logging.handlers.SMTPHandler('mail.vw.com',
'[EMAIL PROTECTED]',
'[EMAIL PROTECTED]',
'Data Processing Error at
location: %s' %
Steven D'Aprano wrote:
> On Mon, 23 Jan 2006 18:17:08 +, Bryan Olson wrote:
>
> > Steven D'Aprano wrote:
> >> Bryan Olson wrote:
> >>
> >>
> > [Christoph Zwerschke had written:]
> What I expect as the result is the "cartesian product" of the strings.
> >>>
> >>>There's no such thing; you'd
Tuvas wrote:
> Only 1 process initiated Tkinter.Tk. I guess this'll just be a tough
> bug hunt... It drives me nuts that it should work, it just doesn't for
> some reason... I guess I can try various things to make it work, but,
> well, I would rather that it just works to start out with...
>
If
Hi, I'm using python 2.4, DB2 8.1 (with development libraries) on
ubuntu linux 5.10. I installed PyDB2 1.1 but when I try to connect to
any database I've got this:
>>> import DB2
>>> conn = DB2.connect(dsn='sample', uid='db2inst1', pwd='secret')
Traceback (most recent call last):
File "", line 1
Jarek Zgoda wrote:
> Tim Parkin napisa�(a):
>
>
>>I'm trying to convert fragments of wiki markup into fragments of html
>>(specifically using moinmoin markup). I've managed to do this with
>>MoinMoin but I've had to create a data directory, config file and
>>underlay. Does anybody know if there a
Alright this is kind of a continuation of a past conversation. . .But not really. Anyway, heres the problem. Say I had this:
try: x = input("> ") except SyntaxError: print "explain the problem here" x = input("> ")That's
to catch when people just pres
Paul Rubin wrote:
> IMO it's better to use words than strings of letters. Try something
> like (untested):
>
>import binascii,os
>short_words = [w.strip() for w in file('/usr/dict/words') if len(w) < 8]
>assert len(short_words) > 5000
>passphrase = []
>
>for i in range(2):
Hi, I can't seem to get the library built, and any help is greatly
appreciated. Here is the info:
Windows XP
Borland C++ Builder 5
Latest Boost source code (downloaded at the weekend)
Windows binary bjam 3.1.11
Command line:
bjam "-sTOOLS=borland" "--with-python-root=C:\Python" "--with-python"
i
Grzegorz Smith <[EMAIL PROTECTED]> writes:
> '\xec2a\xe2\xe2\xeb_\n',"\x9f\\]'\xad|\xe6\xeb",'\xb0\xf8\xd3\xa0>01\xaf'.
> How can I convert this to hash? i change python defaultencoding from ascii
> to utf-8 and try convert this to unicode object but I only get:
Don't use totally arbitrary 8-bit
On Mon, 23 Jan 2006 17:41:55 +, Mathijs wrote:
> Op 19 jan 2006 vond "[EMAIL PROTECTED]" :
>
>> another approach:
>>
>> ref = [2,2,4,1,1]
>> lis = [2,2,5,2,4]
>>
>> len([ref.pop(ref.index(x)) for x in lis if x in ref])
>>
>
> This is the type of solution I was hoping to see: one-liners, w
On Mon, 23 Jan 2006 18:17:08 +, Bryan Olson wrote:
> Steven D'Aprano wrote:
>> Bryan Olson wrote:
>>
>>
> [Christoph Zwerschke had written:]
What I expect as the result is the "cartesian product" of the strings.
>>>
>>>There's no such thing; you'd have to define it first. Are duplicates
Only 1 process initiated Tkinter.Tk. I guess this'll just be a tough
bug hunt... It drives me nuts that it should work, it just doesn't for
some reason... I guess I can try various things to make it work, but,
well, I would rather that it just works to start out with...
--
http://mail.python.org/
Frank Millman wrote:
> In principle I agree. My concern was that I might have inadvertently
> done something wrong (e.g. left a reference dangling) which would
> prevent gc from removing all objects which I wanted to be removed.
Depends on what it really is that you want to know. If you want
to kn
> Can C extended python modules provide any kind module destructor, so
> that whenever the module is unloaded some cleanup is run?
I've needed the same thing before but couldn't find it. AFAIK, the best
you can do is register an exit function that will be called when python
exits. Here is a sa
I want to create two different loggers so that users see one output
(e.g. no exception/stack traces) and others (e.g support staff) that
does see stack traces via email. The code below is close but I still
get console output on the email logger from the "root" logger. How do
I get rid of it?
im
Will McDonald wrote:
> On 23/01/06, Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
>> > I can get the script to behave as expected when content's piped to it
>> > using sys.stdin but I'd like to know that there's data coming from
>> > stdin or fail and print the useage again. Is there a simple way to
Hi all
I'm writing small python module which will be a password generator. I read
that python can use system random generator on machine whit *nix os. So i
start using os.urandom and when i generate random string i get something
like this: urandom(8) ->
'\xec2a\xe2\xe2\xeb_\n',"\x9f\\]'\xad|\xe6\x
On 2006-01-23, Stormcoder <[EMAIL PROTECTED]> wrote:
> Using candygram you can send the sync thread a message telling it to
> reread the config file or you could send a message that changes the
> setting directly. Candygram is much better than the standard threading
> module which is designed afte
On 2006-01-20, David S <[EMAIL PROTECTED]> wrote:
> Anyway, I have tried messing around with the threading module
> and referenced some examples I have come across, but to no
> avail. Fundamentally I expected that when I change a global
> variable in 1 thread, the new value would be picked up in
I'm extending Python with C, it seems as though initialization is easy
enough with an init() function that all C extended python
modules must provide that can serve as a sort of "module constructor".
Can C extended python modules provide any kind module destructor, so
that whenever the module i
Using candygram you can send the sync thread a message telling it to
reread the config file or you could send a message that changes the
setting directly. Candygram is much better than the standard threading
module which is designed after the Java threading library. Java
recently added another thre
Ilias Lazaridis wrote:
> within a python script, I like to create a collection which I fill with
> values from an external text-file (user editable).
>
> How is this accomplished the easiest way (if possible without the need
> of libraries which are not part of the standard distribution)?
>
> so
Bryan Olson wrote:
> There's no such thing; you'd have to define it first. Are duplicates
> significant? Order?
That's all trivial isn't it? A string is a set of pairs (i,c) where i
is an integer number, the index, with 0<=ihttp://mail.python.org/mailman/listinfo/python-list
Robert Kern wrote:
> Sébastien Boisgérault wrote:
> > Robert Kern wrote:
> >
> >>Sébastien Boisgérault wrote:
> >>
> >>>By the way, I tried numpy 0.9.4 10 minutes ago and guess
> >>>what ? 'eigenvalue' is broken too ... (hangs forever)
> >>
> >>On what platform?
> >
> > Linux, Mandriva 2006 (gcc 4
[EMAIL PROTECTED] wrote:
> Robert Kern wrote:
> > Sébastien Boisgérault wrote:
> >
> > > By the way, I tried numpy 0.9.4 10 minutes ago and guess
> > > what ? 'eigenvalue' is broken too ... (hangs forever)
> >
> > On what platform? Are you linking against an optimized BLAS? We can't fix
> > anythi
Randall Parker wrote:
> Steve,
>
> This is an aside: I'd love to see someone implement in Python a
> framework similar to the Quantum Leaps Quantum Framework for
> event-driven programming. I think Python has some features that lend
> themselves to a neater implementation than what can be done in
Pankaj wrote:
Perl :::
> ***
> while( )
> {
>
> line = $_;
>
> pattern = "printf\( \"$lineNo \" \),";
>
> line =~ s/"for(.*)\((*.)\;(.*)/for$1\($pattern$2\;$3/g;
> }
>
> This is used to
>
> search for :for ( i = 0; i < 10; i++)
> Replace with: for( printf( "10" ),
...I have some C code (foo.c and foo.h) that I would like to be able to access
using python.
I've written my interface file (foo.i) like so:
%module foo
%{
#include "foo.h"
%}
%include "foo.h"
I then do the following on the command line:
$ swig -python foo.i
$ gcc -c foo.c foo_wrap.c -I /usr/inc
Tuvas wrote:
> Nope, that's the oddest thing about it all... Perhaps the statement is
> called twice or something along those lines, but there again, I can't
> see how it would be...
>
Very strange behavior can occur if the same python process instantiates
Tkinter.Tk more than once (either con
Nope, that's the oddest thing about it all... Perhaps the statement is
called twice or something along those lines, but there again, I can't
see how it would be...
--
http://mail.python.org/mailman/listinfo/python-list
Tuvas wrote:
> I am building a tkinter program. A part of this program is to read data
> from an incoming interface, and depending on the data, will display a
> bit of text on the tk dialog, it decodes this data, so to speak. If one
> command is sent, everything's just fine. When multiple are sent,
Ilias Lazaridis wrote:
> within a python script, I like to create a collection which I fill with
> values from an external text-file (user editable).
>
> How is this accomplished the easiest way (if possible without the need
> of libraries which are not part of the standard distribution)?
>
> s
A year or so ago, there was a posting - I believe on someone's blog -
which told of a unique experiment. The experimenter tried loading and
searching a large XML document based on three strategies:
1. (I think) elementree directly
2. Store entire XML document in ZODB (or Durus, can't remember)
On 2006-01-23, Grant Edwards <[EMAIL PROTECTED]> wrote:
> On 2006-01-23, Jan Danielsson <[EMAIL PROTECTED]> wrote:
>
>> And if I'm reading it correctly, the Perl
>> script's process starts tcpdump, but redirects its output to its own
>> input, and reads it line by line.
> [...]
>>...however, th
Ilias Lazaridis wrote:
> I am within a directory
>
> \doc\template\
>
> I launch script.py
>
> within this script.py, I like to import a module from the doc directory.
>
> this here does not work:
>
> form ..\..\module_name import this_one
>
Well, if you are in linux you can do this easily by ch
On 2006-01-23, Jan Danielsson <[EMAIL PROTECTED]> wrote:
> And if I'm reading it correctly, the Perl
> script's process starts tcpdump, but redirects its output to its own
> input, and reads it line by line.
[...]
>...however, the Perl script solution looks interresting.. Is it
> possible to d
I am building a tkinter program. A part of this program is to read data
from an incoming interface, and depending on the data, will display a
bit of text on the tk dialog, it decodes this data, so to speak. If one
command is sent, everything's just fine. When multiple are sent, the
program will sto
Tim Parkin napisał(a):
> I'm trying to convert fragments of wiki markup into fragments of html
> (specifically using moinmoin markup). I've managed to do this with
> MoinMoin but I've had to create a data directory, config file and
> underlay. Does anybody know if there a sane way of doing this wi
"Pankaj" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> I have something like below in perl and i am searching for equivalent
> in python:
>
> ::: Perl :::
> ***
> while( )
> {
>
> line = $_;
>
> pattern = "printf\( \"$lineNo \" \),";
>
> line =~ s/"for(.*)
Sébastien Boisgérault wrote:
> Robert Kern wrote:
>
>>Sébastien Boisgérault wrote:
>>
>>>By the way, I tried numpy 0.9.4 10 minutes ago and guess
>>>what ? 'eigenvalue' is broken too ... (hangs forever)
>>
>>On what platform?
>
> Linux, Mandriva 2006 (gcc 4.0.1, etc.)
Okay, my answer then is, "D
[EMAIL PROTECTED] wrote:
> well actually all i want it to do is find the first thing that shows up
> whether its class:food or class: drink so that works for me.
what makes you think that looking "food" only will find either "food"
or "drink" ?
--
http://mail.python.org/mailman/listinfo/pyt
> How can I modify the python search-path from within the script, thus it
> contains the doc directory?
Hi,
The sys.path variable is a list of strings that contains the current
module search path. You can add your own path to this list:
import sys
sys.path.append('../')
-Farshid
--
http://ma
within a python script, I like to create a collection which I fill with
values from an external text-file (user editable).
How is this accomplished the easiest way (if possible without the need
of libraries which are not part of the standard distribution)?
something like:
text-file:
{peter, 16
I have the following code:
[code]
class MainFrame(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, wx.ID_ANY, title,
style=wx.DEFAULT_FRAME_STYLE |wx.NO_FULL_REPAINT_ON_RESIZE)
# build top area
topSizer = self.buildTopPanel()
# bu
Hello, I thought I'd write a program to collect information from pf
(packet filter) and insert it into a postgresql database for review on a
web page. First I checked if this has been done already, and found that
it has.. Using Perl and SQLite in a program called "hatchet".
Well, I want to do i
I am within a directory
\doc\template\
I launch script.py
within this script.py, I like to import a module from the doc directory.
this here does not work:
form ..\..\module_name import this_one
how do I go back in the directory hierarchy to import something?
If this is not possible:
How ca
Robert Kern wrote:
> Sébastien Boisgérault wrote:
>
> > By the way, I tried numpy 0.9.4 10 minutes ago and guess
> > what ? 'eigenvalue' is broken too ... (hangs forever)
>
> On what platform?
Linux, Mandriva 2006 (gcc 4.0.1, etc.)
> Are you linking against an optimized BLAS?
Nope -- I tried the ba
Robert Kern wrote:
> Sébastien Boisgérault wrote:
>
> > By the way, I tried numpy 0.9.4 10 minutes ago and guess
> > what ? 'eigenvalue' is broken too ... (hangs forever)
>
> On what platform? Are you linking against an optimized BLAS? We can't fix
> anything without details. I'll be happy to work
Mathijs wrote:
> Op 20 jan 2006 vond Duncan Booth <[EMAIL PROTECTED]>:
>> Or in other words, define a function to return a dictionary containing
>> a count of the number of occurrences of each element in the list (this
>> assumes that the list elements are hashable). Then you just add up the
>> va
well actually all i want it to do is find the first thing that shows up
whether its class:food or class: drink so that works for me. only
thing is that after it finds class:food i think it runs through the
html again and finds the following class:drink and being that there is
not class tag after t
Hehe, interesting. I'll try it out.Thanks, SebastjanOn 1/23/06, Terry Hancock <[EMAIL PROTECTED]
> wrote:On 23 Jan 2006 05:47:58 -0800"Rinzwind" <
[EMAIL PROTECTED]> wrote:> For example:>> getdata>> im.getdata() => sequence>> Returns the contents of an image as a sequence object> containing pixel v
On 23/01/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
Chris Cioffi wrote:> Q: If I have a file called "spreadsheet.xls" how can I launch it in what> ever program it is associated with? I don't care if that program is Excel> or OpenOffice Calc. I just want to launch the file.
>>> import os>>> hel
Mathijs wrote:
> Op 20 jan 2006 vond Duncan Booth <[EMAIL PROTECTED]>:
>> Or in other words, define a function to return a dictionary
>> containing a count of the number of occurrences of each element in
>> the list (this assumes that the list elements are hashable). Then you
>> just add up the v
Yes, each time the process is created, it remains.
os.waitpid(-1, os.WNOHANG) doesn't work before starting the process
for the first time.
I tried this:
pid = os.fork()
if pid == 0:
os.execl('ext_script.py','ext_script.py')
else:
(pid,status) = os.waitpid(pid, 0)
It seems to work w
Steven D'Aprano wrote:
> Bryan Olson wrote:
>
>
[Christoph Zwerschke had written:]
>>>What I expect as the result is the "cartesian product" of the strings.
>>
>>There's no such thing; you'd have to define it first. Are duplicates
>>significant? Order?
>
>
> Google "cartesian product" and hit "
Op 20 jan 2006 vond Duncan Booth <[EMAIL PROTECTED]>:
> Or in other words, define a function to return a dictionary containing
> a count of the number of occurrences of each element in the list (this
> assumes that the list elements are hashable). Then you just add up the
> values in the test list
Op 19 jan 2006 vond "Paddy" <[EMAIL PROTECTED]>:
answer = [ val for val in set(ref) for x in
range(min(lst.count(val), ref.count(val)))] answer
> [2, 2, 4]
I don't think it's correct. Your algoritm with the ref and lst below gives
3 as answer. The answer should have been 2 (1,3).
ref=
Pankaj wrote:
> Here problem is , i am not getting backreferences using \1 and \2
>
You wrote:
> subStrPattern1_hasInitialization = "\1"
"\1" is the way to create a string containing a control-A character. What
you actually wanted was a string containing a backslash and a "1", so you
need e
Op 19 jan 2006 vond Peter Otten <[EMAIL PROTECTED]> :
> sum(min(list.count(n), ref.count(n)) for n in set(ref))
>
> Is that it?
Seems like this is it! Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
I got my answer
if ( m != None ) :
subStrPattern1_hasInitialization = m.group(1)
subStrPattern2_hasRestTillEnd = m.group(2)
str = subStrPattern1_hasInitialization +
subStrPattern2_hasRestTillEnd
strToReplace = "for(" + pattern + str
This gave me my soluti
Op 19 jan 2006 vond "[EMAIL PROTECTED]" :
> another approach:
>
> ref = [2,2,4,1,1]
> lis = [2,2,5,2,4]
>
> len([ref.pop(ref.index(x)) for x in lis if x in ref])
>
This is the type of solution I was hoping to see: one-liners, with no use
of local variables. As Tim Chase already wrote, it has
Steven D'Aprano wrote:
> Bryan Olson wrote:
>>Christoph Zwerschke wrote:
>>[...]
>>
>>>That may be the main problem to decide whether the cartesian product
>>>should return a generator or a list.
>>
>>The Cartesion product is a set.
>
> And the generalization of mathematical sets in Python can be
On 2006-01-23, Matthias Kaeppler <[EMAIL PROTECTED]> wrote:
>> wxPython are the Python bindings to wxWidgets which is a C++ library.
>
> Don't want to hijack the thread, but since it's answered already:
> Has wxWidgets finally arrived at migrating to GTK2?
Yes.
--
Grant Edwards
My tries have with re have not yielded results::
{
strToFind = 'for*;*'
## Converting int to string, i.e. line no. to string
lineNoClone = lineno
pattern = "printf(\"" + str( lineNoClone) + "\"),"
regObj = re.compile( strToFind)
m = regObj.searc
Marc 'BlackJack' Rintsch wrote:
> wxPython are the Python bindings to wxWidgets which is a C++ library.
Don't want to hijack the thread, but since it's answered already:
Has wxWidgets finally arrived at migrating to GTK2? ^^
If so, I might consider using wxPython instead of pygtk for that small
a
Fredrik Lundh wrote:
> Chris Cioffi wrote:
>
> > Q: If I have a file called "spreadsheet.xls" how can I launch it in what
> > ever program it is associated with? I don't care if that program is Excel
> > or OpenOffice Calc. I just want to launch the file.
>
> >>> import os
> >>> help(os.startfil
Ant wrote:
> If you have to trick the compiler like this though, I'd take a good
> look at *why* you want to couple the modules so tightly in the first
> place!
Yeah, you're right. I think loosening up the coupling by introducing a
module which holds common shared data is probably a good idea any
Bryan Olson schrieb:
> Christoph Zwerschke wrote:
> [...]
>> That may be the main problem to decide whether the cartesian product
>> should return a generator or a list.
>
> The Cartesion product is a set.
Of course it is a set. But if the factors of the product have a total
order (as in the ca
On Friday 20 January 2006 15:42, Keith Thompson wrote:
> "Xah Lee" <[EMAIL PROTECTED]> writes:
> [the usual]
>
> ___
> /| /| | |
>
> ||__|| | Please do |
>
>
To clarify this issue,
I checked, DCOracle is compile such that sizeof(int) = 4, sizeof(long) =
8. I guess this is closer to what you are expecting.
If a 'Python' int is a C long, then why is it passing in a 4 byte size?
Digging deaper, I've found that this size is not passed in by Python,
but
Chris Cioffi wrote:
> Q: If I have a file called "spreadsheet.xls" how can I launch it in what
> ever program it is associated with? I don't care if that program is Excel
> or OpenOffice Calc. I just want to launch the file.
>>> import os
>>> help(os.startfile)
Help on built-in function startf
1 - 100 of 149 matches
Mail list logo