Re: How to replace space in a string with \n

2019-01-31 Thread Michael Poeltl
now we should use just what we studied, if than, > > else, sequences, etc.! > > > > ^Bart > > Hint: you can iterate over the characters of a string > > >>> for c in "hello": > ... print(c) > ... > h > e > l > l > o >

Re: How to replace space in a string with \n

2019-01-31 Thread Michael Poeltl
> > space = (' ') > > if text.count(' ') in text: > space=\n > > rightText = text-space > > print(rightText) > > I should have an output like this: > The > best > day > of > my > life! > > -- > https://

Re: How to replace space in a string with \n

2019-01-31 Thread Michael Poeltl
space=\n > > rightText = text-space > > print(rightText) > > I should have an output like this: > The > best > day > of > my > life! > > -- > https://mail.python.org/mailman/listinfo/python-list -- Michael Poeltl Computational Materials

Re: How to replace space in a string with \n

2019-01-31 Thread Michael Poeltl
n > > rightText = text-space > > print(rightText) > > I should have an output like this: > The > best > day > of > my > life! > > -- > https://mail.python.org/mailman/listinfo/python-list -- Michael Poeltl Computational Materials Physics at

Re: Can't find way to install psycopg2 in 3.5

2015-12-14 Thread Michael Poeltl
t. Ltd. Before opening attachment(s), please scan > for viruses. > > NCrypted is a registered trademark of NCrypted Technologies Pvt. Ltd. in > India and other countries. > > > > -- > https://mail.python.org/mailman/listinfo/python-list -- Michael Poeltl Computatio

Re: Bug in floating point multiplication

2015-07-02 Thread Michael Poeltl
ld not > happen. If you can reproduce that (for any value of i, not necessarily > 2049), please reply. > > See also http://bugs.python.org/issue24546 for more details. > > > > -- > Steven > > -- > https://mail.python.org/mailman/listinfo/python-list -

Re: Python Magazine

2013-05-24 Thread Michael Poeltl
python-books - > -- > http://mail.python.org/mailman/listinfo/python-list -- Michael Poeltl Computational Materials Physics at University Wien, Sensengasse 8/12, A-1090 Wien, AUSTRIA http://cmp.univie.ac.at/ http://homepage.univie.ac.at/michael.poeltl/ using elinks-0.12, m

Re: Python trademark - A request for civility

2013-02-16 Thread Michael Poeltl
. yeah - that's also my opinion! Michael > > http://pyfound.blogspot.com/2013/02/asking-for-civility-during-our.html > > > > -- > Steven > > -- > http://mail.python.org/mailman/listinfo/python-list -- Michael Poeltl Computational Materials Physics v

Re: Further evidence that Python may be the best language forever

2013-01-29 Thread Michael Poeltl
d to see the code is it available for 'download'? thx Michael > > > > What language was the web page hosted in? It comes up completely blank > > for me. :) > > Yep, same here. Hidden behind a flash wall, it seems. > > Stefan > > > --

Re: PyGreSQL 4.1 released

2013-01-05 Thread Michael Poeltl
with both MinGW and Visual Studio > - PostgreSQL 8.4, 9.0 and 9.2 32 and 64bit > - Python 2.5, 2.6 and 2.7 32 and 64bit > > -- > D'Arcy J.M. Cain > PyGreSQL Development Group > http://www.PyGreSQL.org IM:da...@vex.net > -- > http://mail.python.org/mailman/listin

Re: Books?

2012-08-22 Thread Michael Poeltl
mail.python.org/mailman/listinfo/python-list -- Michael Poeltl Computational Materials Physics voice: +43-1-4277-51409 Univ. Wien, Sensengasse 8/12 fax: +43-1-4277-9514 (or 9513) A-1090 Wien, AUSTRIA cmp.mpi.univie.ac.at

Re: find out whether a module exists (without importing it)

2012-08-06 Thread Michael Poeltl
; imp.find_module(), but > it didn't find any module name containing a '.' > > Am I doing anything wrong? > > Is there another existing implementation, that helps. > > I could do this manually, but this is something I'd just like to do > if necessary

Re: Python Book for a C Programmer?

2012-05-23 Thread Michael Poeltl
explain what an if..then..else statement is? > > Thanks. > -- > http://mail.python.org/mailman/listinfo/python-list -- Michael Poeltl Computational Materials Physics voice: +43-1-4277-51409 Univ. Wien, Sensengasse 8/12 fax: +43-1-4277-9514 (or 9513) A-1090 Wien,

Re: python segfault

2012-03-27 Thread Michael Poeltl
hi, * Dave Angel [2012-03-28 04:38]: > On 03/27/2012 06:27 PM, Michael Poeltl wrote: > >hi, > > > >can anybody tell why this 'little stupid *thing* of code' let's > >python-3.2.2, 2.6.X or python 2.7.2 segfault? > > > >>

python segfault

2012-03-27 Thread Michael Poeltl
ntation fault ?> funny, isn't it? I was able to reproduce this segfault on various machines (32bit 64bit), ubuntu, slackware, debian python.X segfaults on all of them thx Michael -- Michael Poeltl Computational Materials Physics voice: +43-1-4277-51409 Univ. Wien, Sensengasse 8/

Re: random number

2012-03-26 Thread Michael Poeltl
s = list(string.ascii_lowercase + ... string.ascii_uppercase + ... string.digits) ... coll_rand = [] ... for i in range(6): ... random.shuffle(characters) ... coll_rand.append(characters[0]) ... return ''.join(coll_r

Re: random number

2012-03-25 Thread Michael Poeltl
* Nikhil Verma [2012-03-26 08:09]: > Hi All > > How can we generate a 6 digit random number from a given number ? what about this? >>> given_number=123456 >>> def rand_given_number(x): ... s = list(str(x)) ... random.shuffle(s) ... return int(''.join(s)) ... >>> print (rand_given_nu

Re: Looking under Python's hood: Will we find a high performance or clunky engine?

2012-01-22 Thread Michael Poeltl
rect, the language is terribly archaic. I suggest you switch to > Ruby ASAP. why there is only one possibility to do so? in a second i found this ''.join(open('test').readlines()).split('\n') and if you don't like python, then stick to ruby. who cares???

Re: Commands for changing ownership of a file

2011-08-14 Thread Michael Poeltl
e. > In GNU Bash, the command is something like "chown myusername:users". > What's the equivalent Python command? I know that there is a command > that uses numbers for the username and group, but is there a command > that would allow me to use "myusername" and "users&

Re: how to solve it?

2011-08-01 Thread Michael Poeltl
* 守株待兔 <1248283...@qq.com> [2011-08-01 06:22]: > from matplotlib.matlab import * > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named matlab is this what you were looking for? >>> from matplotlib.pylab import

Re: how to solve it?

2011-08-01 Thread Michael Poeltl
//matplotlib.sourceforge.net/index.html choose the graph (click it) you need, and there you can browse the source-code (python-code) this is maybe the best starting-point, I guess. cheers Michael -- Michael Poeltl Computational Materials Physics voice: +43-1-4277-51409 Univ. Wien, Sensengas

Re: list comprehension to do os.path.split_all ?

2011-07-30 Thread Michael Poeltl
* Michael Torrie [2011-07-31 03:44]: > On Jul 29, 2011 6:33 PM, "Michael Poeltl" > wrote: > > > > what about this? > > >>> ' '.join('/home//h1122/bin///ghi/'.split('/')).split() > > ['home', 'h1122&#x

Re: PyWart: os.path needs immediate attention!

2011-07-29 Thread Michael Poeltl
gt; * sys > * warnings > > > Note: i did not check the Unix version of os.path for this. > > ~ > 4. Duplicated functionality. > ~ > > >>> os.path.lexists.__doc__ > 'Test whether a path exists. Returns F

Re: list comprehension to do os.path.split_all ?

2011-07-29 Thread Michael Poeltl
that something like a split_all() function should be available in > the stdlib, no? > > Actually, it isn't the first time, where I wonder why os.path.split() > doesn't do this already. I mean, str.split() doesn't only split on the > first part, right? > -- > http://mail.

Re: newbie in python

2008-02-21 Thread Michael Poeltl
A big help for 'easily" learning python was and is "Learning Python" (a book written by Mark Lutz) after having studied this book you are able to "think in python" another book I like very much is "Core Python Programming" (written by Wesley Chun) regards michael On Thursday 21 February 2008

Re: may be a bug in string.rstrip

2007-11-22 Thread michael poeltl
hi, what about this >>> 'exe.torrent'.split('.')[0] 'exe' >>> 'exe.torrent'.rstrip('toren').rstrip('.') 'exe' >>> that's what you need, isn't it? On Friday 23 November 2007 05:09:50 am kyo guan wrote: > Hi : > > Please look at this code: > >>> 'exe.torrent'.rstrip('.torrent') > > 'ex'

Re: What is python?????

2007-11-17 Thread michael poeltl
On Saturday 17 November 2007 01:32:52 pm Cope wrote: > On Nov 17, 5:00 pm, "Amit Khemka" <[EMAIL PROTECTED]> wrote: > > On 11/17/07, Cope <[EMAIL PROTECTED]> wrote: > > > In our place we eat pythons for curry. Its delicious. > > > And how about your python? > > > > > > Cope > > > > Not much of the