This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mallinath Akkalkot
Recipients Mallinath Akkalkot, ezio.melotti, mrabarnett
Date 2019-09-03.06:37:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1567492672.11.0.939939262697.issue38016@roundup.psfhosted.org>
In-reply-to
Content
Issue is explained in the attached presentation for the below python script.

# PYTHON script
import re

stringPassed = "START, 0.272342208623734, 0.122712611838329\nCIRCL, 0.2739, 0.1175, 0.2644, 0.1175\nCIRCL, 0.2644, 0.108, 0.2644, 0.1175\nLINE, 0.26237716818855, 0.108\nCIRCL, 0.2564, 0.102522934456486, 0.26237716818855, 0.102\nLINE, 0.255041919210401, 0.087\nLINE, 0.255041919210401, 0.072\nCIRCL, 0.239541747114243, -0.0106446715786942, 0.0269671265080016, 0.0720000000000296\nCIRCL, 0.2391, -0.0130000000000008, 0.2456, -0.0130000000000008\nLINE, 0.2391, -0.0350000000000008\nCIRCL, 0.243376868486329, -0.0411080018232587, 0.2456, -0.0350000000000008\nLINE, 0.24865951460066, -0.0430307277670375\nCIRCL, 0.255041919210401, -0.0521457461886608, 0.245341919210401, -0.0521457461886608\nLINE, 0.255041919210401, -0.087\nLINE, 0.2564, -0.102522934456486\nCIRCL, 0.26237716818855, -0.108, 0.26237716818855, -0.102\nLINE, 0.2644, -0.108\nCIRCL, 0.2739, -0.1175, 0.2644, -0.1175\nCIRCL, 0.272342208623734, -0.122712611838329, 0.2644, -0.1175\n"

retVal = re.findall(r"(\w+,\s+)(-\d+\.\d+)|(\d+\.\d+)", stringPassed, re.MULTILINE)

floatNumbersList = []		# List conatins all Folat numbers
for each in retVal:
	for each in each:
		if each != "":floatNumbersList.append(each)

newStringUpdated = stringPassed
for eachVal in floatNumbersList:
	newVal =  str(float(eachVal)*1000)
	retVals = re.sub(eachVal, newVal, newStringUpdated)
#	retVals = newStringUpdated.replace(eachVal, newVal)
	newStringUpdated = retVals

print(newStringUpdated)
History
Date User Action Args
2019-09-03 06:37:52Mallinath Akkalkotsetrecipients: + Mallinath Akkalkot, ezio.melotti, mrabarnett
2019-09-03 06:37:52Mallinath Akkalkotsetmessageid: <1567492672.11.0.939939262697.issue38016@roundup.psfhosted.org>
2019-09-03 06:37:52Mallinath Akkalkotlinkissue38016 messages
2019-09-03 06:37:51Mallinath Akkalkotcreate