Reputation: 29445
I want to get the following output:
"my_www.%first_game_start_time%("REN", "233_736")"
Would you please tell me what is wrong in code below:
u = "my_www.%%first_game_start_time%%(%s, %s)" %("REN", "233_736")
Best Regards
Upvotes: 0
Views: 173
Reputation: 304117
If you are asking how to embed "
in the string, triple quotes is an easy way
u = """my_www.%%first_game_start_time%%("%s", "%s")"""%("REN", "233_736")
Another way is to escape the "
with a \
u = "my_www.%%first_game_start_time%%(\"%s\", \"%s\")"%("REN", "233_736")
Since you have no '
in the string, you could also use those to delimit the string
u = 'my_www.%%first_game_start_time%%("%s", "%s"))'%("REN", "233_736")
Upvotes: 4
Reputation: 14633
I'm going to guess that you want this:
c = "222"
u = "my_www." + first_game_start_time("REN", "233_736", c)
Upvotes: 0
Reputation: 19953
Generally you need to post your expected output and point out the difference between that and the output you receive, or include an error message you are receiving, to get a usable answer. But, I suspect the problem is that you want the value of c
to be inserted into the string u
and instead the literal letter c
is being inserted. If that is the case, the solution is:
c = "222"
u = "my_www.%%first_game_start_time%%(%s, %s, %s)" %("REN", "233_736", c)
Upvotes: 1