If you read a file directly at the command line with input and raw_input, and want to take the file directly into the command line to handle it,
The input method can be processed directly, and if you want to use the Raw_input method, the read-in file address is quoted, and you need to manually remove the quotation marks to process the file.
Test the code in Ipython: (read the address string of a picture file)
A = input ("Input a:\n") print "The Input method:", a B = raw_input ("Input b:\n") print "The Raw_input method: ", b input A: '/home/sunny/caffe-master/examples/images/cat.jpg ' the Input method:/home/sunny/ Caffe-master/examples/images/cat.jpg input B: '/home/sunny/caffe-master/examples/images/cat.jpg '
In addition, another visual difference between the two input methods is that input has an arithmetic processing function, that is, the input calculation will directly output the results, and Raw_input will be original (raw) output:
#! -*-coding:utf-8-*- print raw_input (U ' Test raw_input:\n ')
Test results: