-1

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

4
  • 2
    Can you be a bit more specific? I can't see what you mean by "without formatting". Commented Apr 7, 2012 at 6:08
  • @Blender For example, if i get the ouptput from query such as " select * mysql.user " and " show databases " all output query has different format. So, i need to print those output without any formatting . Commented Apr 7, 2012 at 6:20
  • 1
    Hmm, I still can't see what you mean by "format". Can you post what happens and what should happen? Commented Apr 7, 2012 at 6:22
  • I have found the solution, by using .fetchall() Commented Apr 7, 2012 at 9:43

1 Answer 1

1

Yes, just print it:

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

No formatting occurs, as opposed to:

>>> print "hello %s" % "there"
hello there
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.