print >> open("/1.txt", "a"), "{0}".format(variable)
print >> open("/2.txt", "a"), "{0}".format(variable)
print >> open("/1.txt", "a"), "{0}".format(variable)
print >> open("/2.txt", "a"), "{0}".format(variable)
class My(object):
def write(self,str):
print 1,str,
print 2,str,
my = My()
print >> my, 'hello world'
cout << str1 << str2 << str3;
import sys
class My:
def __init__( self, file ):
self.file = file
def __lshift__( self, obj ):
self.file.write( str( obj ) )
return self
cout = My( sys.stdout )
endl = "\n"
cout << "One " << 1 << " and " << 2 << endl;