title: Write to Mifare sector NFC RFIDIOT Python
body: <p>I'm trying to write a number to sector 10 / block 40 on a Mifare 4k classic card</p>
  
  <p>Any ideas on how I can get this working?</p>
  
  <p>Here is my code:
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>BLOCK = 40
  KEY = 'FFFFFFFFFFFF'
  TYPE = 'AA'
  
  import rfidiot
  import re
  
  card = rfidiot.card
  if card.select():
      'card selected UID: ' + str(card.uid)
      if card.login(BLOCK, TYPE, KEY):
          if card.readMIFAREblock(BLOCK):
              print card.MIFAREdata
              data = card.ReadablePrint(card.ToBinary(card.MIFAREdata))
              id = re.findall('\d+', data)[0]
              print id
  
              if card.writeblock(BLOCK, '1234567'):
                  print 'write success'
              else:
                   print 'error %s %s' % (card.errorcode , card.ISO7816ErrorCodes[card.errorcode])
          else:
              print 'read failed'
      else:
          print 'Login failed'</code></pre>
  </div>
  </div>
  </p>
  
  <p>ouput+ error message:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>card selected UID: DBF93873
  33333735353334000000000000000000
  3375534
  error 6300 No information given</code></pre>
  </div>
  </div>
  </p>