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
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
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
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