Mughil
Mughil

Reputation: 710

How to print the string without formatting in python?

Is there any possibility or way to print the string with out passing any arguments or without formatting in python?

To @Blender.

I have done an simple script using mysqlDB module to interact with the mysql server. Using that script i can execute the mysql query to get the output of it.

For an example, if i pass the input as " show master logs " into the script i am getting the error as

TypeError: not enough arguments for format string.

Here i cannot pass the enough agrumnet to print the output. Because, if i pass the enough argument to print the output, the i cannot print the output of query which has more argument. So, i want to print the output without any argument.

It is possible or any alternative solution is there, suggest me. I am learner in python

Upvotes: -1

Views: 6453

Answers (1)

Mark Tolonen
Mark Tolonen

Reputation: 178304

Yes, just print it:

>>> print "hello %s"
hello %s

No formatting occurs, as opposed to:

>>> print "hello %s" % "there"
hello there

Upvotes: 1

Related Questions