Re: Query about doing fortran-esque repeat formatting

2009-11-08 Thread Novocastrian_Nomad
How about: print ('%s ' + '%-5.4f ' * 7) % ('text',1,2,3,4,5,6,7) -- http://mail.python.org/mailman/listinfo/python-list

Re: Author of a Python Success Story Needs a Job!

2010-01-14 Thread Novocastrian_Nomad
Why is it so many, so called high tech companies, insist on the 19th century practice of demanding an employee's physical presence in a specific geographic location. This is the 21st century with climate change, carbon footprints, broadband internet, telecommuting, tele-presence, telephones, fax m

Re: Best Way to extract Numbers from String

2010-03-20 Thread Novocastrian_Nomad
Regular expression are very powerful, and I use them a lot in my paying job (unfortunately not with Python). You are however, basically using a second programing language, which can be difficult to master. Does this give you the desired result? import re matches = re.findall('([\d\.,]+)\s*', c

Re: Use Regular Expressions to extract URL's

2010-04-30 Thread Novocastrian_Nomad
Or perhaps more generically: >>> import re >>> string = 'scatter "http://.yahoo.com quotes and text anywhere >>> www.google.com" "www.bing.com" or not' >>> print re.findall(r'(?:http://|www.)[^"\s]+',string) ['http://.yahoo.com', 'www.google.com', 'www.bing.com'] -- http://mail.python

Re: Need direction on mass find/replacement in HTML files

2010-05-01 Thread Novocastrian_Nomad
One single line regex solution would be: re.sub(r'http\://www.mysite.org/\?page=([^"]+)',r'pages/\1.htm',html) -- http://mail.python.org/mailman/listinfo/python-list

Re: rstrip()

2010-07-16 Thread Novocastrian_Nomad
On Jul 16, 10:58 am, Jason Friedman wrote: > $ python > Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>> "x.vsd-dir".rstrip("-dir") > > 'x.vs' > > I expected 'x.vsd' as a return value. One way to

Re: Spurious issue in CPython 2.7.5

2016-05-24 Thread Novocastrian_Nomad
On Tuesday, May 24, 2016 at 5:47:55 AM UTC-6, thomas povtal.org wrote: ... >1: I get "RuntimeWarning: tp_compare didn't return -1 or -2 for >exception". It's a line like: > >"if Foo = False:" where Foo is a global variable (global Foo). ... Are you really using "if Foo = False:"? If s

Re: Martijn Faassen: The Call of Python 2.8

2014-04-15 Thread Novocastrian_Nomad
On Tuesday, April 15, 2014 12:32:14 PM UTC-6, Mark H. Harris wrote: > On 4/14/14 2:32 PM, Phil Dobbin wrote: > > On a related note, Guido announced today that there will be no 2.8 & > > that the eol for 2.7 will be 2020. > > > > Can you site the announcement? > > Thanks http://hg.python.org/peps/

Re: Working with HTML5 documents

2014-11-19 Thread Novocastrian_Nomad
On Wednesday, November 19, 2014 2:08:27 PM UTC-7, Denis McMahon wrote: > So what I'm looking for is a method to create an html5 document using "dom > manipulation", ie: > > doc = new htmldocument(doctype="HTML") > html = new html5element("html") > doc.appendChild(html) > head = new html5element("

Re: How can i use a dictionnary

2015-01-13 Thread Novocastrian_Nomad
On Tuesday, January 13, 2015 at 2:03:30 AM UTC-7, brice DORA wrote: > i consume a web service that return a element whose the type is "instance". > but this element seem be a dictionary but when i want to use it like a > dictionary, i got some errors. so this is the element and please someone can

Re: webware for python 3

2015-04-06 Thread Novocastrian_Nomad
On Monday, April 6, 2015 at 11:26:15 PM UTC-6, rah...@gmail.com wrote: > I have an old project which uses web ware, where i want to convert to latest > version 3.4 > > I am wondering whether any webware is available for python version 3.4. What > I am seeing is the webware version 1.1.1 which is

Re: Find and Replace Simplification

2013-07-19 Thread Novocastrian_Nomad
On Friday, July 19, 2013 7:22:48 AM UTC-6, Devyn Collier Johnson wrote: > I have some code that I want to simplify. I know that a for-loop would > > work well, but can I make re.sub perform all of the below tasks at once, > or can I write this in a way that is more efficient than using a for-loo

Re: Rant on web browsers

2011-06-14 Thread Novocastrian_Nomad
CoffeeScript maybe? http://jashkenas.github.com/coffee-script -- http://mail.python.org/mailman/listinfo/python-list