Okay, here's what I what to do
*--Target.py--*
print "Hello World"
*--Target.py Output--*
*Hello World*
*--Main.py--*
target=open("target.py", "r")
old=target.read()
target.close()
target=open("target.py", "w")
target.write('''
Str.__repr__ = Str.__repr__.swapcase()'''+old)
target.close()
*--Modified Target.py--*
Str.__repr__ = Str.__repr__.swapcase()
print "Hello World"
*--Modified Target.py Output--*
*hELLO wORLD*

The only problem is I don't think that "Str.__repr__ =
Str.__repr__.swapcase()" works. What should I use in its place to make the
above a reality.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to