Let's imagine, I have a simple tkinter program: only tkinter.Entry(), where I can write down some text. The main goal I have set to this tkinter.Entry() is to make next: when I try to input there some symbol, it is immediately deleted from tkinter.Entry(). So the question is how to make tkinter.Entry() delete every symbol, when it have been just input there?
I hope the problem is fully described. Thanks in advance for your help.
I apologize, but it seems to me that this question has lost its former relevance for me. Sorry for letting you take all of your precious time. I took all the answers and tips into account. I will delete the question soon. Thank you for your attention to me
From what I deduced, you're trying to delete the content from the entry widget.
tkinter.Entry.delete('0',END)
This should do it.
Related
My code is pretty long and has a lot of If statements. There are also a few small for loops all nested within a larger for loop. I am getting a compiler error "Next without for". I am sure I am missing something pretty simple. I just can't find it. Is there some editor that I can use that will pair the statements and show me where the disconnect is? Is there some great method for tracking down an error like this? I certainly hate to ask anyone to pick through my code and find the error. I'd like to learn to help myself. I am in learning mode.
I was missing an End If statement. That was my issue.
Thank for the replies. I thought I had indented properly, and I think that going through line by line and checking that would have found my issue.
I ended up finding it by going through and cutting some of the blocks of ifs and loops inside of the big loop until I found the offending section.
EDIT: I tried the code lines in the link to other questions that were similar, however the programs did not execute correctly
I am a full-on noob trying to complete some free online resources for self improvement and learning. I am using University of Waterloo's 'Python from scratch' and CS circles course I have tried to answer this question and cannot seem to:
Write a program that asks the user for a string and then prints the string in upper case.
I have tried:
print (str(input()).upper)
AS WELL AS
text = input()
print (text.upper)
AND
print(input().upper())
all programs run, but dont have correct output so I dont know what I am missing here. It's likely obvious and I may feel foolish
I would love to learn and move on, thanks for any assistance!
this is 'Python from scratch' 2.11 problem 'g' (7th problem in set)
You were very close, the following works:
input.upper()
so, print(input.upper())
should work for you.
text=input()
print(text.upper())
print(input().upper())
This should have worked for you in Python 3.x
I am trying to make a macro that will cycle through and update browser tabs when hitting 'F10'.
Currently it only updates the page I'm currently on, it doesn't cycle through them, I tried googling for it but all the answers were for 'AutoHotKey'. So I looked at the documentation for 'AutoKey' and tried to convert a 'AutoHotKey' script to 'AutoKey' (python) but it doesn't work and I have no idea why.
Here's the script
keyboard.send_keys("< f5>")
keyboard.press_key("< ctrl>")
keyboard.send_keys("< tab>")
keyboard.release_key("< ctrl>")
replacing lines 2 -> 4 with just a "keyboard.press_key("< ctrl>" + "< tab>") doesn't work (I'm not quite sure if it's ("< ctrl> + < tab>") instead, but none works, sadly)
(Please bare in mind that the spaces in front of the "keycodes" are so that Stackoverflow will show them)
Thank you all in advance!!!
I asked in the Google group of AutoKey and they came up with this:
keyboard.send_keys("<f5><ctrl>+<tab>")
And that's all you need, it works flawlessly.
I would later change the 'f5' to 'enter' instead and it never skips any browser tab, it's awesome!
Thank you all for your time!
It strangely worked only the other way around for me, but I think that might still suite your task:
keyboard.press_key("<ctrl>")
keyboard.press_key("<tab>")
time.sleep(0.3)
keyboard.release_key("<ctrl>")
keyboard.release_key("<tab>")
keyboard.send_key("<f5>")
I hope this helps.
Sublime Text 3 user configuration directory is, by default, at:
~/.config/sublime-text-3/
I would like to change it to somewhere else. Is it possible? The workaround I've done so far is to create the above directory as a symbolic link pointing to the folder I want, but it doesn't seem right. Is there a better way of doing this?
Thanks for your attention in advance.
It's been one year and no answer, so I'll describe what I've been doing, so I can close this topic. The best way to deal with it is by creating a symbolic link, as I mentioned before. The second way to do this is by editing Sublime's code, what I didn't figure out completly how to do, but I know it's possible. If someone knows a better solution, please post in the comments. This topic is being closed now.
I'm starting to learn about the io. functions, and am trying to implement them in my code. I've searched for the answer to this and nothing seems to give a clear cut yes or no, or at least I don't see one. I'm hoping someone here will know the answer and be able to help with this.
I'm wanting to create a text file that I can write to as time progresses. It'll basically be a log to which I'll be appending lines of output. Apparently io.open("textfile.txt") does not create the file, or so it appears.
Is there a way to create a text file in Lua that can later be accessed with io.read/write? Additionally, do I need to call io.close() before opening or creating a new text file? I appreciate any help given. Thanks!
You need to open the file for writing as follows: f=io.open("textfile.txt","w"). Then use f:write() to write stuff to it. When finished writing, call f:close().