Operating environment
GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 14.04 LTS desktop amd64
TensorFlow v0.11
cuDNN v5.1 for Linux
CUDA v8.0
Python 2.7.6
IPython 5.1.0 -- An enhanced Interactive Python.
gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
sc_N = array.array('i')
sc_N.fromfile(rfp,1)
sc_sizes = array.array('i')
sc_sizes.fromfile(rfp, sc_N)
The above will result in an error.
TypeError: an integer is required
Because sc_N is a list, not a value (integer type).
It would be unpacking to take a value from a list of one element.
Reference http://stackoverflow.com/questions/3480184/unpack-a-list-in-python
I implemented it. (Addition: The following ideone is a Python 3 environment) http://ideone.com/1VUh3O
mylist = [ 3 ]
print (mylist)
print (*mylist)
Run
[3]
3
I got it.
@Knoguchi and @shiracamus told me about the difference between Python2 and Python3 in the print () example.
Considering the future, I will consider implementing it in Python3.