title: How to Write List if Hex Values to a File Python
body: <p>I have written a simple python module that reads in a file and converts the read data to a list of hex values. I then incremented each value by 1. I was wondering how I could write this list of hex values to a new file. </p>
  
  <p>Using python 3.x</p>
  
  <p>Code:</p>
  
  <pre><code>inFilePath = input("Input File: ")
  inFile = open(inFilePath, "rb")
  data = inFile.read()
  hexVals = []
  for byte in data:
      hexVals.append(hex(byte))
  print("File Read")
  print("Original Data: " + str(hexVals))
  for x in range(hexVals.__len__()):
      hexVals[x] = hex(int(hexVals[x], 16) + 1)
  print("Altered Data: " + str(hexVals))
  outFilePath = input("Output File: ")
  outFile = open(outFilePath, "wb")
  outFile.write(???)
  </code></pre>