Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > RE: replace %(word) in a string

Thread Tools

RE: replace %(word) in a string

Fred Pacquier
Posts: n/a
Fred Pacquier <(E-Mail Removed)> said :

> Yes, that's a wonderful feature. Recently though, I've wondered a
> couple of times : is there an easy way to substitute with both local
> AND global variables ?...

Thanks to all who responded to that one... I half-feared that I'd asked a
really silly question, but it turns out it's not quite so trivial in the
general case after all, and there's been quite some discussions about it
before. In any case I learned a few things from your input as usual, so it
was a useful question

In my very simple case I'm only missing *one* var from locals(), so the
ugly one-line hack of reassigning lvar = gvar inside the function seems
quite enough after all...

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace /n with a XHTML <br /> using string.replace Alun ASP .Net 3 02-18-2008 05:52 AM
how to make replace function replace globally in a string V S Rawat Javascript 5 07-03-2007 08:02 PM
Re: [Pyrex] pyrex functions to replace a method (Re: replace a method Greg Ewing Python 2 06-29-2006 05:25 PM
pyrex functions to replace a method (Re: replace a method in class:how?) Brian Blais Python 1 06-27-2006 12:13 PM
help with string replace - for doing selective replace Prasad S Javascript 2 08-27-2004 03:22 PM