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

2012-05-01 Thread Jussi Piitulainen
"someone" writes: > except it would be nice to learn some things for future use (for > instance understanding SVD more - perhaps someone geometrically can > explain SVD, that'll be really nice, I hope)... The Wikipedia article looks promising to me:

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

2012-05-01 Thread Russ P.
On May 1, 11:03 pm, someone wrote: > On 05/02/2012 01:38 AM, Russ P. wrote: > > > > > > > > > > > On May 1, 4:05 pm, Paul Rubin  wrote: > >> someone  writes: > >>> Actually I know some... I just didn't think so much about, before > >>> writing the question this as I should, I know theres also some

Re: Trouble splitting strings with consecutive delimiters

2012-05-01 Thread rusi
On May 1, 9:50 am, deuteros wrote: > 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;he

linux

2012-05-01 Thread Debashish Saha
can anyone say me how to subscribe linux mailing list like 'python mailing list'. Actually i want to post question there. -- http://mail.python.org/mailman/listinfo/python-list

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

2012-05-01 Thread someone
On 05/02/2012 01:38 AM, Russ P. wrote: On May 1, 4:05 pm, Paul Rubin wrote: someone writes: Actually I know some... I just didn't think so much about, before writing the question this as I should, I know theres also something like singular value decomposition that I think can help solve other

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

2012-05-01 Thread someone
On 05/02/2012 01:05 AM, Paul Rubin wrote: someone writes: Actually I know some... I just didn't think so much about, before writing the question this as I should, I know theres also something like singular value decomposition that I think can help solve otherwise illposed problems, You will p

Designing and Building an API converter

2012-05-01 Thread samuelmarks
How would I go about building an API converter? I have multiple different APIs with different schemas serialised in XML or JSON which I need to output as a standardised schema. Other features needed: - Authentication (i.e.: can't get/set data unless you're from a certain DNS xor have the correc

Re: syntax for code blocks

2012-05-01 Thread alex23
On May 2, 12:18 am, Kiuhnm wrote: > "Most Pythonic" doesn't mean better, unfortunately. Neither does "Kiuhnm prefers it". > For instance, assume that you want to write a function that accepts a > dictionary of callbacks: >    func(some_args, callbacks) > > Pythonic way > > > def whe

Re: syntax for code blocks

2012-05-01 Thread alex23
On May 2, 12:43 pm, alex23 wrote: > I'm not entirely sure what your 'solution' offers over something like: > > class FOO(object): >     def __init__(self, fn): >         self.fn = fn > >     def __enter__(self): >         return self.fn > >     def __exit__(self, exc_type, exc_value, traceback): >

Re: syntax for code blocks

2012-05-01 Thread alex23
[Apologies in advance if this comes through twice] On May 2, 12:18 am, Kiuhnm wrote: > "Most Pythonic" doesn't mean better, unfortunately. Nor does it mean "Kiuhnm prefers it". > For instance, assume that you want to write a function that accepts a > dictionary of callbacks: >    func(some_args

Re: syntax for code blocks

2012-05-01 Thread Ben Finney
Steven D'Aprano writes: > On Tue, 01 May 2012 19:07:58 +0200, Kiuhnm wrote: > > [entitled demands] > Believe it or not, the world does not revolve around you. We cannot > see what is in your head. If we ask for a WORKING EXAMPLE, you need to > give an example that includes EVERYTHING necessary t

Re: pyjamas pyjs.org domain has been hijacked

2012-05-01 Thread Luke Kenneth Casson Leighton
... i'm reeally really sorry about this, but it suddenly dawned on me that, under UK law, a breach of the UK's data protection act has occurred, and that the people responsible for setting up the hijacked services have committed a criminal offense under UK law. ordinarily, a free software mailing

Re: syntax for code blocks

2012-05-01 Thread Steven D'Aprano
On Tue, 01 May 2012 19:07:58 +0200, Kiuhnm wrote: > On 5/1/2012 17:11, Steven D'Aprano wrote: >>> My way >>> -- >>> >>> with func(some_args)<< ':dict': >>> with when_odd as 'n': >>> pass >>> with when_prime as 'n': >>> pass >> >> >> If you actually try that, yo

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

2012-05-01 Thread Russ P.
On May 1, 4:05 pm, Paul Rubin wrote: > someone writes: > > Actually I know some... I just didn't think so much about, before > > writing the question this as I should, I know theres also something > > like singular value decomposition that I think can help solve > > otherwise illposed problems, >

Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread Cameron Simpson
The tutorial suggests multchoicebox returns an interable of chosen items, in fact probably a seqeunce. So... On 01May2012 14:50, ksals wrote: | This is a small excert to show you what I get | | for choice in easygui.multchoicebox(msg1, title,qstack): | if choice[0] == None: |

Re: Create directories and modify files with Python

2012-05-01 Thread Irmen de Jong
On 1-5-2012 12:51, deltaquat...@gmail.com wrote: But if you really want to go this way (and hey, why not) then first you'll have to learn some basic Python. A good resource for this might be: http://learnpythonthehardway.org/ Ehm...name's not exactly inspiring for a newbie who's short on time :

Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread Cameron Simpson
Disclaimer: I have never used esygui. On 01May2012 21:29, John Gordon wrote: | In <3b5f65c4-cd95-4bb4-94f2-0c69cf2b1...@d20g2000vbh.googlegroups.com> ksals writes: | > The original choice looks like this when I print it: | | > print(choice) | > ('ksals', '', 'alsdkfj', '3', '') That's just pr

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

2012-05-01 Thread Paul Rubin
someone writes: > Actually I know some... I just didn't think so much about, before > writing the question this as I should, I know theres also something > like singular value decomposition that I think can help solve > otherwise illposed problems, You will probably get better advice if you are a

Re: Sort comparison

2012-05-01 Thread Dan Stromberg
On Tue, May 1, 2012 at 11:52 AM, Ian Kelly wrote: > On Tue, May 1, 2012 at 12:00 PM, Dan Stromberg > wrote: > > > > On Tue, May 1, 2012 at 12:21 AM, Ian Kelly > wrote: > >> > >> On Mon, Apr 30, 2012 at 11:25 PM, Dan Stromberg > >> wrote: > >> > > >> > A while back I did a sort algorithm runtim

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

2012-05-01 Thread Kiuhnm
On 5/1/2012 21:59, Colin J. Williams wrote: On 01/05/2012 2:43 PM, someone wrote: [snip] a = [1 2 3]; b = [11 12 13]; c = [21 22 23]. Then notice that c = 2*b - a. So c is linearly dependent on a and b. Geometrically this means the three vectors are in the same plane, so the matrix doesn't have

Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread ksals
On May 1, 5:29 pm, John Gordon wrote: > In <3b5f65c4-cd95-4bb4-94f2-0c69cf2b1...@d20g2000vbh.googlegroups.com> ksals > writes: > > > The original choice looks like this when I print it: > > print(choice) > > ('ksals', '', 'alsdkfj', '3', '') > > I need to submit these as defaults to a multenterb

pyjamas pyjs.org domain has been hijacked

2012-05-01 Thread Luke Kenneth Casson Leighton
i have an apology to make to the python community. about 3 or 4 months ago a number of the pyjamas users became unhappy that i was sticking to software (libre) principles on the pyjamas project. they saw the long-term policy that i had set, of developing python-based pyjamas-based infrastructure

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

2012-05-01 Thread Robert Kern
On 5/1/12 10:21 PM, someone wrote: On 05/01/2012 10:54 PM, Russ P. wrote: On May 1, 11:52 am, someone wrote: On 04/30/2012 03:35 AM, Nasser M. Abbasi wrote: What's the limit in matlab (on the condition number of the matrices), by the way, before it comes up with a warning ??? The threshold

RE: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread Prasad, Ramit
> > That looks like a tuple which contains five strings. > The original choice looks like this when I print it: > > print(choice) > ('ksals', '', 'alsdkfj', '3', '') Based on the print statement, choice is a tuple or a string. try doing `print(type(choice))`. On the assumption it is a tuple a

Re: Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread John Gordon
In <3b5f65c4-cd95-4bb4-94f2-0c69cf2b1...@d20g2000vbh.googlegroups.com> ksals writes: > The original choice looks like this when I print it: > print(choice) > ('ksals', '', 'alsdkfj', '3', '') > I need to submit these as defaults to a multenterbox. Each entry above > ksals, "", "alsdkfj', 3 , '

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

2012-05-01 Thread someone
On 05/01/2012 10:54 PM, Russ P. wrote: On May 1, 11:52 am, someone wrote: On 04/30/2012 03:35 AM, Nasser M. Abbasi wrote: What's the limit in matlab (on the condition number of the matrices), by the way, before it comes up with a warning ??? The threshold of acceptability really depends on

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

2012-05-01 Thread someone
On 05/01/2012 09:59 PM, Colin J. Williams wrote: On 01/05/2012 2:43 PM, someone wrote: [snip] a = [1 2 3]; b = [11 12 13]; c = [21 22 23]. Then notice that c = 2*b - a. So c is linearly dependent on a and b. Geometrically this means the three vectors are in the same plane, so the matrix doesn't

Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread ksals
On May 1, 4:26 pm, John Gordon wrote: > In <316efebe-7f54-4054-96b1-51c7bb7b7...@f5g2000vbt.googlegroups.com> ksals > writes: > > > Please help a newbe.  I have a string returned from an esygui > > multchoicebox that looks like > >   this:  ('ksals', '', 'alsdkfj', '3', '') I need to convert thi

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

2012-05-01 Thread Russ P.
On May 1, 11:52 am, someone wrote: > On 04/30/2012 03:35 AM, Nasser M. Abbasi wrote: > > > On 04/29/2012 07:59 PM, someone wrote: > > I do not use python much myself, but a quick google showed that pyhton > > scipy has API for linalg, so use, which is from the documentation, the > > following code

Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread Pedro Kroger
Have you tried to use the function list?: foo = (1,2,3) list(foo) Cheers, Pedro -- http://pedrokroger.net On May 1, 2012, at 5:18 PM, ksals wrote: > Please help a newbe. I have a string returned from an esygui > multchoicebox that looks like > this: ('ksals', '', 'alsdkfj', '3', '') I ne

Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread John Gordon
In <316efebe-7f54-4054-96b1-51c7bb7b7...@f5g2000vbt.googlegroups.com> ksals writes: > Please help a newbe. I have a string returned from an esygui > multchoicebox that looks like > this: ('ksals', '', 'alsdkfj', '3', '') I need to convert this to > this: ['ksals', '', 'alsdkfj', '3', '']

Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread ksals
Please help a newbe. I have a string returned from an esygui multchoicebox that looks like this: ('ksals', '', 'alsdkfj', '3', '') I need to convert this to this: ['ksals', '', 'alsdkfj', '3', ''] This is so I can submit this to a multenterbox with 5 fields -- http://mail.python.org/mailm

Converting a string to list for submission to easygui multenterbox

2012-05-01 Thread ksals
Please help a newbe. I have a string returned from an esygui multchoicebox that looks like this: ('ksals', '', 'alsdkfj', '3', '') I need to convert this to this: ['ksals', '', 'alsdkfj', '3', ''] This is so I can submit this to a multchoicebox with 5 fields -- http://mail.python.org/mailm

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

2012-05-01 Thread Colin J. Williams
On 01/05/2012 2:43 PM, someone wrote: [snip] a = [1 2 3]; b = [11 12 13]; c = [21 22 23]. Then notice that c = 2*b - a. So c is linearly dependent on a and b. Geometrically this means the three vectors are in the same plane, so the matrix doesn't have an inverse. Does it not mean that there

[RELEASED] Python 3.3.0 alpha 3

2012-05-01 Thread Georg Brandl
On behalf of the Python development team, I'm happy to announce the third alpha release of Python 3.3.0. This is a preview release, and its use is not recommended in production settings. Python 3.3 includes a range of improvements of the 3.x series, as well as easier porting between 2.x and 3.x.

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

2012-05-01 Thread Prasad, Ramit
>I'm making my first steps now with numpy, so there's a lot I don't know >and haven't tried with numpy... An excellent reason to subscribe to the numpy mailing list and talk on there :) Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77

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

2012-05-01 Thread someone
On 04/30/2012 03:35 AM, Nasser M. Abbasi wrote: On 04/29/2012 07:59 PM, someone wrote: I do not use python much myself, but a quick google showed that pyhton scipy has API for linalg, so use, which is from the documentation, the following code example X = scipy.linalg.solve(A, B) But you still

Re: Sort comparison

2012-05-01 Thread Ian Kelly
On Tue, May 1, 2012 at 12:00 PM, Dan Stromberg wrote: > > On Tue, May 1, 2012 at 12:21 AM, Ian Kelly wrote: >> >> On Mon, Apr 30, 2012 at 11:25 PM, Dan Stromberg >> wrote: >> > >> > A while back I did a sort algorithm runtime comparison for a variety of >> > sorting algorithms, and then mostly s

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

2012-05-01 Thread someone
On 05/01/2012 08:56 AM, Russ P. wrote: On Apr 29, 5:17 pm, someone wrote: On 04/30/2012 12:39 AM, Kiuhnm wrote: You should try to avoid matrix inversion altogether if that's the case. For instance you shouldn't invert a matrix just to solve a linear system. What then? Cramer's rule? If yo

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

2012-05-01 Thread someone
On 04/30/2012 02:57 AM, Paul Rubin wrote: someone writes: A is not just close to singular: it's singular! Ok. When do you define it to be singular, btw? Singular means the determinant is zero, i.e. the rows or columns are not linearly independent. Let's give names to the three rows: a =

Re: syntax for code blocks

2012-05-01 Thread Ethan Furman
Arnaud Delobelle wrote: On May 1, 2012 6:42 PM, "Jerry Hill" wrote: On Tue, May 1, 2012 at 1:07 PM, Kiuhnm wrote: If you had read the module's docstring you would know that the public version uses Are you aware that you've never posted a link to your module, nor it's docstrings? Are you also

Re: Sort comparison

2012-05-01 Thread Dan Stromberg
On Tue, May 1, 2012 at 10:51 AM, Terry Reedy wrote: > On 5/1/2012 1:25 AM, Dan Stromberg wrote: > > Anyway, here's the comparison, with code and graph: >> http://stromberg.dnsalias.org/**~strombrg/sort-comparison/ >> >> (It's done in Pu

Re: Sort comparison

2012-05-01 Thread Dan Stromberg
On Tue, May 1, 2012 at 12:21 AM, Ian Kelly wrote: > On Mon, Apr 30, 2012 at 11:25 PM, Dan Stromberg > wrote: > > > > 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 o

Re: syntax for code blocks

2012-05-01 Thread Arnaud Delobelle
(sent from my phone) On May 1, 2012 6:42 PM, "Jerry Hill" wrote: > > On Tue, May 1, 2012 at 1:07 PM, Kiuhnm > wrote: > > If you had read the module's docstring you would know that the public > > version uses > > Are you aware that you've never posted a link to your module, nor it's > docstrings?

Re: Sort comparison

2012-05-01 Thread Terry Reedy
On 5/1/2012 1:25 AM, Dan Stromberg wrote: Anyway, here's the comparison, with code and graph: http://stromberg.dnsalias.org/~strombrg/sort-comparison/ (It's done in Pure python and Cython, with a little m4). Interesting, BTW, that an unstable quicksort in Cython was approaching timsort as a C

Re: syntax for code blocks

2012-05-01 Thread Jerry Hill
On Tue, May 1, 2012 at 1:07 PM, Kiuhnm wrote: > If you had read the module's docstring you would know that the public > version uses Are you aware that you've never posted a link to your module, nor it's docstrings? Are you also aware that your module is essentially unfindable on google? Certai

Re: Trouble splitting strings with consecutive delimiters

2012-05-01 Thread Emile van Sebille
On 5/1/2012 10:13 AM Temia Eszteri said... re.split(':|px;', "width:150px;height:50px;float:right") Emile That won't work at all outside of the example case. It'd choke on any attribute seperator that didn't end in px. It would certainly choke on all delimeters that are not presented in the

Re: syntax for code blocks

2012-05-01 Thread Temia Eszteri
Holy crap. Easy there, tiger. I understand you're frustrated, but the people here are trying to help, even if they've decided the means of helping is trying to explain why they feel your style of development isn't the best way to do things. You're going to wear out your welcome and not get any h

Re: Installing pygame on MacOS-X Lion with Python 3.3

2012-05-01 Thread Temia Eszteri
>I can't get it working : "No pygame module"... >Tried without success : >pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip >pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg > >I am using Python 3 last version on MacOS-X Lion. > >Where is a step-by-step installation procedure ? > >Thanks, > >

Re: Trouble splitting strings with consecutive delimiters

2012-05-01 Thread Temia Eszteri
>> re.split(':|;|px', "width:150px;height:50px;float:right") > >You could recognize that the delimiter you want to strip is in fact px; >and not px in and of itself. > >So, try: > >re.split(':|px;', "width:150px;height:50px;float:right") > >Emile That won't work at all outside of the example case

Re: syntax for code blocks

2012-05-01 Thread Kiuhnm
On 5/1/2012 17:11, Steven D'Aprano wrote: My way -- with func(some_args)<< ':dict': with when_odd as 'n': pass with when_prime as 'n': pass If you actually try that, you will see that it cannot work. You get: SyntaxError: can't assign to literal If you

Re: Trouble splitting strings with consecutive delimiters

2012-05-01 Thread Emile van Sebille
re.split(':|;|px', "width:150px;height:50px;float:right") You could recognize that the delimiter you want to strip is in fact px; and not px in and of itself. So, try: re.split(':|px;', "width:150px;height:50px;float:right") Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: Create directories and modify files with Python

2012-05-01 Thread ru...@yahoo.com
On 04/30/2012 05:24 PM, 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

Re: syntax for code blocks

2012-05-01 Thread Chris Angelico
On Wed, May 2, 2012 at 1:11 AM, Steven D'Aprano wrote: > So in this case, even though Python is slightly more verbose, and forces > you to have the discipline of writing named functions ahead of time, this > is actually a *good* thing because it encourages you to test them. > > If the callbacks ar

Re: Trouble splitting strings with consecutive delimiters

2012-05-01 Thread Steven D'Aprano
On Tue, 01 May 2012 04:50:48 +, deuteros wrote: > 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. As I would expect. After all, there *is*

Re: syntax for code blocks

2012-05-01 Thread Steven D'Aprano
On Tue, 01 May 2012 16:18:03 +0200, Kiuhnm wrote: > "Most Pythonic" doesn't mean better, unfortunately. Perhaps. But this example is not one of those cases. > For instance, assume that you want to write a function that accepts a > dictionary of callbacks: >func(some_args, callbacks) > > Py

Re: Some posts do not show up in Google Groups

2012-05-01 Thread Rotwang
On 01/05/2012 07:12, Frank Millman wrote: [...] I have had a look at this before, but there is one thing that Google Groups does that no other reader seems to do, and that is that messages are sorted according to thread-activity, not original posting date. This makes it easy to see what has chan

Re: Communication between C++ server and Python app

2012-05-01 Thread Adam Tauno Williams
On Sat, 2012-04-28 at 17:45 -0700, kenk wrote: > 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 ? Time to start us

Re: syntax for code blocks

2012-05-01 Thread Chris Angelico
On Wed, May 2, 2012 at 12:18 AM, Kiuhnm wrote: > "Most Pythonic" doesn't mean better, unfortunately. > > For instance, assume that you want to write a function that accepts a > dictionary of callbacks: >  func(some_args, callbacks) > > Pythonic way > > > def when_odd(n): >    pass > >

Re: Create directories and modify files with Python

2012-05-01 Thread Chris Angelico
On Tue, May 1, 2012 at 9:45 PM, Peter Otten <__pete...@web.de> wrote: > In that spirit I'd like to make an alternative offer: put some effort into > the job yourself, write a solution in bash and post it here. I (or someone > else) will then help you translate it into basic Python. That will typica

Re: For loop

2012-05-01 Thread Jabba Laci
Hi, Try this: import sys for i in range (1, 5+1): for j in range (i): sys.stdout.write(str(i)) print "print" adds a newline character print "hi", notice the comma, it won't add newline, however it adds a space With sys.stdout.write you can print the way you want, it won't add

Re: syntax for code blocks

2012-05-01 Thread Kiuhnm
On 5/1/2012 5:27, alex23 wrote: On Apr 30, 2:05 am, Peter Pearson wrote: Hey, guys, am I the only one here who can't even guess what this code does? When did Python become so obscure? Thankfully it hasn't. The most Pythonic way to pass around a code block is still to use a function. "Most

bus errors when the network interface is reset?

2012-05-01 Thread David M Chess
We have a system running Python 2.6.6 under RHEL 6.1. A bunch of processes spend most of their time sitting in a BaseHTTPServer.HTTPServer waiting for requests. Last night an update pushed out via xcat whimsically restarted all of the network interfaces, and at least some of our processes died

Installing pygame on MacOS-X Lion with Python 3.3

2012-05-01 Thread Franck Ditter
I can't get it working : "No pygame module"... Tried without success : pygame-1.9.2pre-py2.7-macosx10.7.mpkg.zip pygame-1.9.1release-python.org-32bit-py2.7-macosx10.3.dmg I am using Python 3 last version on MacOS-X Lion. Where is a step-by-step installation procedure ? Thanks, franck --

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

2012-05-01 Thread Eelco
There is linalg.pinv, which computes a pseudoinverse based on SVD that works on all matrices, regardless of the rank of the matrix. It merely approximates A*A.I = I as well as A permits though, rather than being a true inverse, which may not exist. Anyway, there are no general answers for this kin

Re: Trouble splitting strings with consecutive delimiters

2012-05-01 Thread Peter Otten
deuteros wrote: > 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"

pyjamas 0.8.1 - help requested for testing to reach stable release

2012-05-01 Thread Luke Kenneth Casson Leighton
hi folks, got a small favour to ask of the python community - or, more specifically, i feel compelled to alert the python community to "a need" with which you may be able to help: we're due for another release, and it's becoming an increasingly-large task. given the number of examples requiring te

Re: Create directories and modify files with Python

2012-05-01 Thread Peter Otten
deltaquat...@gmail.com wrote: > At this point, I go for a Fortran/C code, which takes me longer to write. If you already have a basic programming knowledge the tutorial that comes with Python should be an excellent starting point: http://docs.python.org/py3k/tutorial/index.html > Now I'd like

Re: geoinfo with python

2012-05-01 Thread Jabba Laci
I've found a web service for the task: http://www.geoplugin.com/webservices . It can produce JSON output too. Laszlo On Tue, May 1, 2012 at 09:35, Jabba Laci wrote: > Hi, > > I want to figure out where a host is located, in which country. There > are sites that look up this information (e.g. > h

Re: Create directories and modify files with Python

2012-05-01 Thread deltaquattro
Il giorno martedì 1 maggio 2012 01:57:12 UTC+2, Irmen de Jong ha scritto: > > 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 > > wi

Re: why () is () and [] is [] work in other way?

2012-05-01 Thread Albert van der Horst
In article <7xvckq4c2j@ruckus.brouhaha.com>, Paul Rubin wrote: >Kiuhnm writes: >> I can't think of a single case where 'is' is ill-defined. > >If I can't predict the output of > >print (20+30 is 30+20) # check whether addition is commutative >print (20*30 is 30*20) # check whether

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

2012-05-01 Thread Russ P.
On Apr 29, 5:17 pm, 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

geoinfo with python

2012-05-01 Thread Jabba Laci
Hi, I want to figure out where a host is located, in which country. There are sites that look up this information (e.g. http://geoip.flagfox.net/). Before writing a scraper, I would like to ask if you know a python API for this task. Thanks, Laszlo -- http://mail.python.org/mailman/listinfo/pyt

Re: Sort comparison

2012-05-01 Thread Ian Kelly
On Mon, Apr 30, 2012 at 11:25 PM, Dan Stromberg wrote: > > 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 real

Re: For loop

2012-05-01 Thread Daniel
You could also try http://docs.python.org/library/stdtypes.html#str.join like this: for i in range(5): print "".join(str(i) for j in range(i)) -- http://mail.python.org/mailman/listinfo/python-list