Hello
I’m trying to help but I’ve looked at your code and I’m confused, what are you trying to achieve, you have referenced 3 questions, which question are you following and from which book?
What I’ve guessed, are you trying to modify and expand on q17
I think your using python 2 from your print statement syntax but why are you using %s and {to_file] syntax.
What are you using to write the code in as your speech marks look incorrect, you use single quotes on the second print statement and double quotes on the third print statement
I’ll try to help but you have to simplify so I can follow what your doing and also state what errors you are getting, I need to be able to replicate what you are doing and seeing.
Hi, can you please clean up your help request a bit to help others out? First, put these around your code:
[code]
# code here
[/code]
Next, type a message at the top that lays out what you want to do, what you tried doing already, and what is currently happening instead. Then I’ll see if I can give you some advice.
from sys import arg
script, from_file, to_file = argv
print "copying from %s to %s" % (from_file, to_file)
in_file = open(from_file)
indata = in_file.read()
print 'Are you Sure to copy the file %s to %s' %(from_file, to_file)
print "If 'yes' hit ENTER, If 'not' hit CTRL-C to abort."
raw_input('**')
out_file = open(to_file, 'w')
out_file.write(indata)
print "Ok your file is copied to %s" % to_file
print "if you want to see that copied file, then type that copied file name below.."
copied_file =raw_input('>>>>>> ')
text_of_file = open(copied_file)
print text_of_file.read()
[HERE I WANT TO OPEN TEXT IN TERMINAL WITH THE ABOVE CODE AS EXERCISE 15 OF LPTHW BOOK WITH SIMPLE MODIFYING EXCERCISE 17…
Well I am learning LPTHW
I just modified the Ex 17 and want to do like as 15 to see the copied file through the code in terminal with that modified code.