I Apologise for being a noob - both to asking questions, and python.
I've writen a program, which will be running full time. I have that working ok. It uses the try function to look for an input from a touchscreen.
I now wish to try for 30s,and if there is no input, jump to a blackscreen routine (screensaver), from which it will be looking for any touch to go back to the original try
I think i need an except routine, but i'm tying myself up in knots working out with where to put everything.
Any guidance appreciated
edit
this is Python for use on a raspberry PI.
all i have in code now, is the basic try as follows.
while(True):
try:
get_call()
except SystemExit:
the get_call() routine, sets up some pygame screens, then looks to an on_click() routine for touchscreen input.
I wish to try to get_call() for 30s, and if nothing happens from that, go to screensave()
I know its not much to go on, my code is that of a self taught noob, with no knowledge of best practices, or decent formatting. If anyone wants to look through what i've done, i'll happily zip it all up, and send it through.
Related
I'm not asking for someone to write out specific codes for me, but rather just point me towards the general direction.
Sometimes after writing and pinning a comment under a Youtube video, it disappears!
It may happen hours later, it may happen a few minutes later, all randomly. Then re-appears hours later, not sure why.
Since I am currently learning programming (python), I might as well try to tackle the problem myself. I want to make a program that regularly checks if the pinned comment is still present, and if not, send me an alert in whatever way so I can go write and pin a new comment for the time being. (and maybe learn a few things during the process)
So far I learned some basic stuff like how to get source code from a webpage, output it to somewhere like a txt file, and also searching with Regex. However when I check out the source code of a Youtube video, the comments text aren't there. Where do I begin learning about the necessary things needed to make this program work?
Im trying to create an upgrader/tycoon game and realised to have the money continuously going up, I would have to start a different process so I can have my GUI which can be used as the money goes up without either stopping the other from working.
What is the best way to do this?
I've looked around on this site and nothing I could find has helped me!
(If you need any more information just let me know!)
Use threading.
Python has a module named threading, and you need
threading.Thread(target=somefunc).start()
My old answer in the same topic: Here.
If you consider adding some code to your question, I am happy to help in threading! Also, if you need help in designing the code, feel free to ask, threads can be messy.
I want to create a program with a GUI using Python. This program should show a list of nodes somewhere and allow me to insert them on a working diagram. I also need this nodes connected in some sequence. The following image is similar to what I need, it's from Orange3.
I come from a web development background and I've used Python for some Data Science but all using Terminal so right now I feel a little lost on where to get started.
I would much appreciate some help on where to look. Also I would like to use, if possible, existing tools instead of having to develop everything from scratch. Maybe there even is a project that does what I need and I could fork it from Github.
Thanks a lot for the help.
Check out Tkinter. Its great for GUI. Hard to add in images though. You could use Base64 to add in images.
There are plenty but it's best to create it yourself. There are infinite tutorials. Besides its gonna be full of bugs if you try to alter code that isn't yours.
I've found a Python telnet file, which works fine (at binary tides) but I'm hoping to (learn to) implement control over the input area such that I have shell like history and editing of the input line, uninterrupted by the feed from the telnet server I'm logged into.
I've seen some posts on this, would I be right to think that I need to learn threading so that I can simultaneously watch the server, the input line and handle the division of the console area, to do this? Similar to the discussion of threads/sockets here (SO separate threads for sockets..) except that is for Java and I'm trying to study Python.
Or perhaps SO TKinter is what I should put in my study list..?
EDIT: I should mention that I hope to move to GUI presentation eventually for my small projects but for this one I'm happy to use the console...I figured it might be a smaller step (learning curve).
Alright, so I got a question and hopefully you guys will be able to help me out with this.
Basically what I'm trying to do is this:
Read what users write in Skype (using the Skype4Py lib).
Convert specific lines from users into a keyboard event.
Pass keyboard events to another (non-python-related) process (.exe) running locally.
Now the first two bullets are definitely doable but I'm not really sure how one would go about the last one. I'm assuming it's possible but I have absolutely no clue which module(s) I would need. If anyone has suggestions, modules or even examples for the last bullet I would very much appreciate it.