[Tutor] string fomatting

bob gailer bgailer at gmail.com
Sat Jan 31 19:29:55 CET 2009

Jay Jesus Amorin wrote:
> Hi,
> I'm a newbie trying to learn python. Kindly help me on string formatting.
> test = https://www.localhost.org/testmodule/dev/trunk/admin/sql/mytest.sql
> what will i use to print this output?
> 1, https://www.localhost.org/
> 2. testmodule
> 3. /dev/trunk/admin/sql/mytest.sql
Oh now I get it. I thought that you had posted code at that site. Now I 
think you want to do something  to the string

" https://www.localhost.org/testmodule/dev/trunk/admin/sql/mytest.sql"

Too bad you did not put it in quotes!

It is not clear as to how "string formating" applies to this question.

The obvious answer is:

print("1, https://www.localhost.org/""
print("2. testmodule")
print("3. /dev/trunk/admin/sql/mytest.sql")

If that is not what you are looking for please explain.

Bob Gailer
Chapel Hill NC

More information about the Tutor mailing list