4

We are using versioning. The current version is 0.2.3 i would like to increment by 0.0.1 using python. Getting below error.

tagNumber = 0.2.3 ^ SyntaxError: invalid syntax

1 Answers1

6

You could do something like this:

def increment_ver(version):
    version = version.split('.')
    version[2] = str(int(version[2]) + 1)
    return '.'.join(version)
eicksl
  • 852
  • 8
  • 8