Re: Some posts do not show up in Google Groups

2012-04-30 Thread Frank Millman
On Apr 30, 8:20 am, Frank Millman wrote: > Hi all > > For a while now I have been using Google Groups to read this group, but on > the odd occasion when I want to post a message, I use Outlook Express, as I > know that some people reject all messages from Google Groups due to the high > spam ra

Re: Trouble splitting strings with consecutive delimiters

2012-04-30 Thread Jussi Piitulainen
deuteros writes: > I'm using regular expressions to split a string using multiple > delimiters. But if two or more of my delimiters occur next to each > other in the string, it puts an empty string in the resulting > list. For example: > > re.split(':|;|px', "width:150px;height:50px;float:

Re: Creating a directory structure and modifying files automatically in Python

2012-04-30 Thread John Nagle
On 4/30/2012 8:19 AM, deltaquat...@gmail.com wrote: Hi, I would like to automate the following task under Linux. I need to create a set of directories such as 075 095 100 125 The directory names may be read from a text file foobar, which also contains a number corresponding to each dir, like

Sort comparison

2012-04-30 Thread Dan Stromberg
A while back I did a sort algorithm runtime comparison for a variety of sorting algorithms, and then mostly sat on it. Recently, I got into a discussion with someone on stackoverflow about the running time of radix sort. I realize it's commonly said that radixsort is n*k rather than n*log(n). I'v

Trouble splitting strings with consecutive delimiters

2012-04-30 Thread deuteros
I'm using regular expressions to split a string using multiple delimiters. But if two or more of my delimiters occur next to each other in the string, it puts an empty string in the resulting list. For example: re.split(':|;|px', "width:150px;height:50px;float:right") Results in

Re: Some posts do not show up in Google Groups

2012-04-30 Thread alex23
On May 1, 12:38 pm, Ben Finney wrote: > In the absence of their participation in resolving the problems Google > Groups has with Usenet, I think the best course of action is to avoid > Google Groups. The new interface effectively kills Groups dead as a useful Usenet reader anyway :( -- http://ma

Re: syntax for code blocks

2012-04-30 Thread Ben Finney
mwil...@the-wire.com writes: > Another take-away might be don't use boilerplate, but in the situation > I didn't see a simple way to avoid it. It seems we agree, then, that avoiding boilerplate code is preferable to writing bad boilerplate code. -- \ “Computer perspective on Moore's L

Re: Some posts do not show up in Google Groups

2012-04-30 Thread Ben Finney
Frank Millman writes: > Does anyone know a reason for this, or have a solution? To my knowledge no-one responsible at Google Groups has bothered to comment about the issue. It's not clear to we outsiders that they are even aware of it. In the absence of their participation in resolving the prob

Re: Create directories and modify files with Python

2012-04-30 Thread Irmen de Jong
On 1-5-2012 1:24, deltaquat...@gmail.com wrote: > Hi, 0 I would like to automate some simple tasks I'm doing by hand. Given a > text file > foobar.fo: [...] > At first, I tried to write a bash script to do this. However, when and if the > script > will work, I'll probably want to add more feat

Re: Create directories and modify files with Python

2012-04-30 Thread Mark Lawrence
On 01/05/2012 00:24, deltaquat...@gmail.com wrote: Hi, I would like to automate some simple tasks I'm doing by hand. Given a text file foobar.fo: 073 1.819 085 2.132 100 2.456 115 2.789 I need to create the directories 073, 085, 100, 115, and copy in each directory a modified version of the t

Create directories and modify files with Python

2012-04-30 Thread deltaquattro
Hi, I would like to automate some simple tasks I'm doing by hand. Given a text file foobar.fo: 073 1.819 085 2.132 100 2.456 115 2.789 I need to create the directories 073, 085, 100, 115, and copy in each directory a modified version of the text file input.in: . . . foo = 1.5 ! edit this valu

Re: Communication between C++ server and Python app

2012-04-30 Thread Miki Tebeka
> > I've got a server process written in C++ running on Unix machine. > > On the same box I'd like to run multiple Python scripts that will > > communicate with this server. > > > > Can you please suggest what would be best was to achieve this ? As said before, there are many options. Here are som

Re: Communication between C++ server and Python app

2012-04-30 Thread kenk
Failr point - I should do that in original question. The C++ server runs on Unix (Mac OS X as a matter of fact) and, as I'm the one who develops it, can use whthever technology is suitable. Currently it uses STL, Boost and Qt libraries. The server is responsible for providing connectivity to sto

Re: For loop

2012-04-30 Thread Terry Reedy
On 4/30/2012 6:41 AM, viral shah wrote: Hi I want to make a pattern like this *1 22 333 5 Python 3: >>> for i in range(1,6): print(i*str(i)) 1 22 333 5 -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: Some posts do not show up in Google Groups

2012-04-30 Thread Colin J. Williams
On 30/04/2012 2:20 AM, Frank Millman wrote: Hi all For a while now I have been using Google Groups to read this group, but on the odd occasion when I want to post a message, I use Outlook Express, as I know that some people reject all messages from Google Groups due to the high spam ratio (wh

Re: Creating a directory structure and modifying files automatically in Python

2012-04-30 Thread Chris Rebert
On Mon, Apr 30, 2012 at 8:19 AM, wrote: > Hi, > > I would like to automate the following task under Linux. I need to create a > set of directories such as > > 075 > 095 > 100 > 125 > > The directory names may be read from a text file foobar, which also contains > a number corresponding to each

Re: ctypes details was: Re: syntax for code blocks

2012-04-30 Thread mwilson
Kiuhnm wrote: > Regarding ctypes, try this to convince yourself that there's no problem > in reusing BignumPtrType: > from ctypes import POINTER, c_int > assert POINTER(c_int) is POINTER(c_int) print ('POINTERs are shareable:', ctypes.POINTER (BignumType) is ctypes.POINTER (BignumType))

Re: Creating a directory structure and modifying files automatically in Python

2012-04-30 Thread MRAB
On 30/04/2012 16:19, deltaquat...@gmail.com wrote: Hi, I would like to automate the following task under Linux. I need to create a set of directories such as 075 095 100 125 The directory names may be read from a text file foobar, which also contains a number corresponding to each dir, like

Re: ctypes details was: Re: syntax for code blocks

2012-04-30 Thread Kiuhnm
On 4/30/2012 17:42, mwil...@the-wire.com wrote: On 4/30/2012 17:02, Kiuhnm wrote: BignumTypePtr = ctypes.POINTER(BignumType) for op, op_word in ((libbnem.BN_add, libbnem.BN_add_word), (libbnem.BN_sub, libbnem.BN_sub_word)): op.argtypes = [BignumTypePtr] * 3 op_word.argtypes = [BignumTypePtr, ct

ctypes details was: Re: syntax for code blocks

2012-04-30 Thread mwilson
> On 4/30/2012 17:02, Kiuhnm wrote: >> BignumTypePtr = ctypes.POINTER(BignumType) >> >> for op, op_word in ((libbnem.BN_add, libbnem.BN_add_word), >> (libbnem.BN_sub, libbnem.BN_sub_word)): >> op.argtypes = [BignumTypePtr] * 3 >> op_word.argtypes = [BignumTypePtr, ctypes.c_ulong] >> op.restype = op

Re: syntax for code blocks

2012-04-30 Thread Kiuhnm
On 4/30/2012 17:02, Kiuhnm wrote: On 4/30/2012 16:17, mwil...@the-wire.com wrote: Ben Finney wrote: [ ... ] Even worse is the penchant for ‘foo .bar()’, the space obscures the fact that this is attribute access. I like the style sometimes when it helps to break the significantly different pa

Creating a directory structure and modifying files automatically in Python

2012-04-30 Thread deltaquattro
Hi, I would like to automate the following task under Linux. I need to create a set of directories such as 075 095 100 125 The directory names may be read from a text file foobar, which also contains a number corresponding to each dir, like this: 075 1.818 095 2.181 100 2.579 125 3.019 In e

Re: syntax for code blocks

2012-04-30 Thread Kiuhnm
On 4/30/2012 16:17, mwil...@the-wire.com wrote: Ben Finney wrote: [ ... ] Even worse is the penchant for ‘foo .bar()’, the space obscures the fact that this is attribute access. I like the style sometimes when it helps to break the significantly different parts out of boilerplate: libb

Re: syntax for code blocks

2012-04-30 Thread mwilson
Ben Finney wrote: > [ ... ] Even worse is the > penchant for ‘foo .bar()’, the space obscures the fact that this is > attribute access. I like the style sometimes when it helps to break the significantly different parts out of boilerplate: libbnem. BN_add .argtypes = [ctypes.POINTER (Bignu

Re: numpy (matrix solver) - python vs. matlab

2012-04-30 Thread Kiuhnm
On 4/30/2012 3:35, Nasser M. Abbasi wrote: But you still need to check the cond(). If it is too large, not good. How large and all that, depends on the problem itself. But the rule of thumb, the lower the better. Less than 100 can be good in general, but I really can't give you a fixed number to

Re: For loop

2012-04-30 Thread Chris Angelico
On Mon, Apr 30, 2012 at 8:41 PM, viral shah wrote: > for i in range (5): >   for j in range (i): >     print i >   print " " The print command (you're clearly using Python 2 here - it's slightly different in Python 3) by default prints a whole line - that is, it finishes with a newline or '\n'. Y

For loop

2012-04-30 Thread viral shah
Hi I want to make a pattern like this *1 22 333 5 * and I did the following code, *for i in range (5): for j in range (i): print i print " "* got the output : * * *1 2 2 3 3 3 4 4 4 4* What's I'm not doing right, please let me know about this -- http://mail.python.org/ma

Re: numpy (matrix solver) - python vs. matlab

2012-04-30 Thread Kiuhnm
On 4/30/2012 2:17, someone wrote: On 04/30/2012 12:39 AM, Kiuhnm wrote: So Matlab at least warns about "Matrix is close to singular or badly scaled", which python (and I guess most other languages) does not... A is not just close to singular: it's singular! Ok. When do you define it to be s

Europython 2012 - Early Bird will end in 3 days!

2012-04-30 Thread Palla
Hi all, the end of Early bird is on May 2nd, 23:59:59 CEST. We'd like to ask to you to forward this post to anyone that you feel may be interested. We have an amazing lineup of tutorials and talks. We have some excellent keynote speakers and Guido will be with us! [https://ep2012.europython.eu/p3/

Re: Some posts do not show up in Google Groups

2012-04-30 Thread Terry Reedy
On 4/30/2012 2:20 AM, Frank Millman wrote: Hi all For a while now I have been using Google Groups to read this group, but on the odd occasion when I want to post a message, I use Outlook Express, as I know that some people reject all messages from Google Groups due to the high spam ratio (whi