0
import base64
image_base64 = 'Hello World\n'
print image_base64    
print 'Hello?\n'

Result:

Hello World    
Hello?    
Hello World    
Hello?
Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
Arturo Aviles
  • 179
  • 4
  • 16

1 Answers1

2

Your file must be named base64.py so when you import base64 at the top of the file, it is importing itself causing the print statements to execute twice (once on the import and once afterwards).

You should rename your script to something whose name does not conflict with the name of a standard module.

Suever
  • 64,497
  • 14
  • 82
  • 101