Changing var names

Jean-Michel Pichavant jeanmichel at sequans.com
Fri Jan 15 13:26:45 EST 2010


Victor Subervi wrote:
> Hi;
> Well it took me *less than a day* to fix the following problems:
> -- bare excepts (accidentally left a couple I think)
> -- sql injection attacks
> -- recreating tables to make them more reasonable
>
> ******************************************
> "Programming is an ITERATIVE process."
> ******************************************
> See how easy that was??
>
> Now, I believe someone once mentioned that there is some s/w tool out 
> there for changing the names of my variables more easily than going 
> through every script one-by-one. If so, please share with me again 
> what it is. Also, if anyone has any other suggestions they've been 
> holding back, or had mentioned earlier, on how to improve my design, 
> please share them with me. Eventually, I'll get around to converting 
> it from monolithic code to class-based code (and maybe become a real 
> programmer, God forbid).
> beno
>
> -- 
> The Logos has come to bear
> http://logos.13gems.com/
under unix/linux, google tells me that:
|grep -lr -e '<searchterm>' * | xargs sed -i 
's/<searchterm>/<targetterm>/g'|

will do the trick.

To improve your code layout/design, you may want to try pylint.
It requires a little bit of tunning, because the default rules are not 
always that satisfying, but it should give you an idea how your code is 
in bad shape once you'll get those thousands warnings from pylint :o)

JM



More information about the Python-list mailing list