On 10/10/2011 08:56 PM, Christopher King wrote:
Okay, there is a python file called target.py. In the same directory there
is a file named main.py. You are the author of main.py. The code in main.py
will write to target.py. Then the antivirus catches main.py and removes, but
not the modification
Christopher King wrote:
Okay, there is a python file called target.py. In the same directory there
is a file named main.py. You are the author of main.py. The code in main.py
will write to target.py. Then the antivirus catches main.py and removes, but
not the modification to target.py. Main.py ca
Okay, there is a python file called target.py. In the same directory there
is a file named main.py. You are the author of main.py. The code in main.py
will write to target.py. Then the antivirus catches main.py and removes, but
not the modification to target.py. Main.py can not create new files. Wh
On 10/09/2011 11:27 AM, Christopher King wrote:
I know the method of finding every string, and inserting a swapcase in to
the code. Does anyone now a way just to insert code at the top though?
P.S. I use python 2.*
Would you consider answering the rest of my questions? Since this is
obviousl
On 09/10/11 16:27, Christopher King wrote:
I know the method of finding every string, and inserting a swapcase in
to the code. Does anyone now a way just to insert code at the top though?
Inserting code at the top of the file is just like inserting any kind of
text at the top of any kind of te
I know the method of finding every string, and inserting a swapcase in to
the code. Does anyone now a way just to insert code at the top though?
P.S. I use python 2.*
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
On 10/08/2011 03:03 PM, Christopher King wrote:
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.__
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()
*--Modifi
On 10/5/2011 5:51 PM, Christopher King wrote:
There is a program that will open another program, write code at the
top of the program. The code at the top will cause the program to
print all strings afterwards in swap case.
What you've told us so far may make total sense to you, but it is not
On 05/10/11 22:51, Christopher King wrote:
There is a program that will open another program, write code at the top
of the program. The code at the top will cause the program to print all
strings afterwards in swap case.
If I understand this correctly you have mainprog.py and subprog.py.
And y
On 10/5/2011 5:51 PM, Christopher King wrote:
There is a program that will open another program, write code at the
top of the program. The code at the top will cause the program to
print all strings afterwards in swap case.
Please provide a sample program that you wish to modify.
--
Bob Gail
There is a program that will open another program, write code at the top of
the program. The code at the top will cause the program to print all strings
afterwards in swap case.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription
Please always reply-all so a copy goes to the list. I'm forwarding this
one for you.
Please answer ALL questions that we ask. You did not answer
What do you mean by "all other strings"?
On 10/4/2011 4:55 PM, Christopher King wrote:
This is (to me) vague. What do you mean by "at the top"
On 03/10/11 01:33, Christopher King wrote:
Dear Tutors,
I was wondering how one would make it so all the cases of all the
strings in a python file where switched. I know that
for individual strings, you can use .swapcase(),
So just apply swapcase() to the whole file as a string:
s = open(
On 10/2/2011 8:33 PM, Christopher King wrote:
Dear Tutors,
I was wondering how one would make it so all the cases of all the
strings in a python file where switched. I know that
for individual strings, you can use .swapcase(), but I'm making a
program to edit others, so it would be easier
Dear Tutors,
I was wondering how one would make it so all the cases of all the
strings in a python file where switched. I know that for individual strings,
you can use .swapcase(), but I'm making a program to edit others, so it
would be easier to just do something at the top that would switch a
16 matches
Mail list logo