Message from Python discussions
December 2018
— Is there TK gui expert in the house?
How can i put two widgets against each other?
like:
panel.pack(side = tk.BOTTOM,anchor='w')one in the east and other in west
debuging_button.pack(side=tk.BOTTOM,anchor="e")
but the east\west one stays on top of the west\east one.
— What is the best way to split the text and asign it to variable?
— Like
firstName, lastName = text.split(' ')
— Wrap splited text to the tuple class/function
— (uh, my perfect English)
— It will depends on how many words, separated by spaces, will your text
variable will have
— Language:
python3
Source:
text = "Guido van Rossum"
print(text.split())
Result:
['Guido', 'van', 'Rossum']
— Check that and think how could you do your script to not have an ValueError with Guido's name
— The best way to store splited string in a variable it store it in one variable as list
— This kind of things, splitting text to get first_name
and last_name
are really tricky... how would you manage these:
- Guido van Rossum
- Richard Matthew Stallman
Which will be the first_name
and the second_name
?
— Sorry, if I confuse you