For getting the values from text field, we use ".get" function.
I would like to get all the contents from the text area.
What is the function to use.
yes you could use
what are these params?
You have to define what you want to read in your text. The syntax is:
some possible positions:
+count chars count characters after the current position
-count chars count characters before the current position
+count lines count lines after the current position
-count lines count lines before the current position
wordstart the first character of the word, which contains the character of the current position
wordend the character AFTER (not the last character) the last character of the word, which contains the character of the current position
linestart the first character of the line, that contains the character of the current position
lineend the LAST character (different from wordend!) of the line, that contains the character of the current position
example: if you want to read one line from the current position:
Hope that will help you a little bit.
Like this example, we are using the functions for getting the values of text field.
Any similar functions for text areas?
self.lbText1 = Label(self, text="User ID:")
"""Create the Entry, set it to be a bit wider"""
self.enText1 = Entry(self)
self.enText1.grid(row=0, column=1, columnspan=3)
self.lbText2 = Label(self, text="password:")
self.enText2 = Entry(self,show="*")
self.enText2.grid(row=1, column=1, columnspan=3)
name = self.enText1.get()
password = self.enText2.get()
hm, as I see you do not have a text area, but a Lable. That is quite different. In the Lable you put some predefined text you want to show the user, maybe to explain the use or name of an inputarea.
The textfield is something you provide to the user to fill in text on his own.
Try something like that (please fill in your code with the code-tags, so it is better to read
import Tkinter #get the module from Tkconstants import * #best is you have a look at the documentation of this, because then you can choose from all of the functions and find excactly what you need) mywindow=Tkinter.Tk() # there you can but everything in text = Tkinter.Text(mywindow, width=30, height=6) #here you call the textfield, the user could write in, the first parameter is the parent to which it belongs, as we want to put everything in mywindow, we choose that, then there are several possible parameters, here I use params to size the textfield) ... #here you can put something else concerning the window, maybe you want to write some predefined things in your window: text.pack() #in the end put your textfield in it's place tk.mainloop()
to test the text.get(parms) function, maybe you also put a button under the textfield, and say it shall print what the user wrote.
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
Hi. so this is actually a continuation from another question of mineHere but i was advised to start a new thread as the original question was already answered.
This is the result of previous question answered :
code for the listbox - datagridview interaction
At the top of the code ...