Re: forced spaces when inserting a variable between strings

2006-01-17 Thread Xavier Morel
mjteigen wrote: > I'm very new at Python, but have been trying it in conjunction with > CGI. I've encountered a problem that I'm pretty sure is a trivial one, > but I don't know enough Python to work it out. Here's an example. > Imagine that I have a file named "5.jpg" in the same directory as this

Re: forced spaces when inserting a variable between strings

2006-01-17 Thread Stephen Illingworth
mjteigen wrote: > My goal is print out ''. However, when I view the > source on the generated html page, I see this: > > > > In other words, that "5" has a space tacked on either side of it, and > of course a browser can't find the file. Is there a way I can avoid the > tacking of spaces on

Re: forced spaces when inserting a variable between strings

2006-01-17 Thread snoe
You can use: print "" % (number) or print "" or a number of others, but for short strings one of these two generally work fine. -- http://mail.python.org/mailman/listinfo/python-list

forced spaces when inserting a variable between strings

2006-01-17 Thread mjteigen
I'm very new at Python, but have been trying it in conjunction with CGI. I've encountered a problem that I'm pretty sure is a trivial one, but I don't know enough Python to work it out. Here's an example. Imagine that I have a file named "5.jpg" in the same directory as this Python script: prin