python - Appending/formatting a string -


in c# format string do:

string = string.format("/blah/blah/{0}_{1}/blah.html", int1, int2) 

in python, convert integer string automatically?

how similar above in python.?

in python 2.6 , above:

a = "/blah/blah/{0}_{1}/blah.html".format(int1, int2) 

in python 2.7/3.1 , above, do

a = "/blah/blah/{}_{}/blah.html".format(int1, int2) 

see docs on string formatting.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -