Insert into text field?

B

Baltor

How do I enter weapondescription with a space before it at the end of
line 3. I tried this, but it is not working:

self.text.insert(3.0, END, " ", weapondescription)

Anyone?

Thanks.
 
M

Matthew Wilson

How do I enter weapondescription with a space before it at the end of
line 3. I tried this, but it is not working:

self.text.insert(3.0, END, " ", weapondescription)


If you're trying to pass a string that has the value

' weapondescription'

you should put quotes around the string, or make weapondescription a
variable that has the value ' weapondescription'.

Some more background about the project you're working on might help.
 
M

Michael Peuser

Baltor said:
How do I enter weapondescription with a space before it at the end of
line 3. I tried this, but it is not working:

self.text.insert(3.0, END, " ", weapondescription)

The syntax is:
insert(start, end, string,tags, string, tags,....)

So weapondescription is considered the tag for " ".
Thus you could write e.g.:
insert('3.0', 'end', " ", None, weapondescription)

Kindly
MichaelP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top