Skip to content

Convert flash.py to python3 #57

Description

@sgall17a

I did a simple conversion to python3

  1. I ran 2to3 on flash.py. (this changes mostly print statements, I think)
  2. That left two remaining issues:

line 188. -- had to convert address into an int
def write_flash_many(self, tupl):
if not tupl: return
print('Flashing %s' % ', '.join('0x%x: %s' % (int(address), os.path.basename(path)) for (address, path) in tupl))

line 190 -- same thing
os.system("python esptool.py -p %s write_flash -fs 32m -fm %s -ff 40m %s" % (self.port, self.flashmode, ' '.join("0x%x %s" % (int(a),p) for a,p in tupl)))

flash.py seems to run OK now.
Surprisingly I did not seem to have to change esptool.py
A python3 version of esptool.py has been installed by pip, so it seems to use this one.

The changed file is attached.

(Sorry I am not used to this - I had to change to txt extension to get it to upload)

flash.py.txt

Also:-
This is for esp8266. I am running a macbook on catalina.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions