What's the problem here !?

Started by
11 comments, last by Scouting Ninja 9 years, 8 months ago

from sys import argv 
script , myfile=argv[0],argv[1]
print "here bro : %r" %(rfile)
rfile=open(myfile)
print rfile.read() 
print "*" * 5
print "type ur file again"
another=raw_input("^_^ ")
mfile=open(another)
print mfile.read()

VjO6ELxw.png

Advertisement
I dunno... what is the problem? Please ask an actual question :-)

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

<open file 'Never give up .txt ,mode 'r' at 0x00485230> :) !

You're still not asking a question.

The program is doing exactly what you told it to do.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

Looks fine to me. What do you expect it to do on that line?

ApochPiQ smile.png

i shouldn't see this line !!!

<open file 'Never give up .txt ,mode 'r' at 0x00485230> i think not problem but why i saw this line !!!

in

Exercise 15: Reading Files

he didn't get this line !!

If you wan't to wright something into the file use:

Myfile = open('Name of file',w)
Myfile.write( 'Text')
Myfile.close()

If you want to read something use this:

Myfile = open('Name of file',r)
OutText = Myfile.readline()
Myfile.close()
 
print(OutText )

I also think you have to import the pickel module

import pickle

It looks like you used: print(rfile)

That prints the object and it's place in the memory not the contents of the file.

edit: fixed code blocks

I'm doing like Zed in pythonhardway :(

& when i type the file again it should read it again !

why ????

sry i wrote my last post wrong & i don't know how to delete it :D

This topic is closed to new replies.

Advertisement