Go to advanced search

by mmkw43
Thu Jan 20, 2022 7:41 pm
Forum: Python
Topic: Place mouse on startup ?
Replies: 4
Views: 135

Re: Place mouse on startup ?

Ok. Yeah, I had seen that but was wondering if there was a way without installing a module. Looks like I'll probably go ahead with that.
by mmkw43
Thu Jan 20, 2022 4:09 pm
Forum: Python
Topic: Place mouse on startup ?
Replies: 4
Views: 135

Re: Place mouse on startup ?

I see the mouse module but don't see anything that will do it. It can move but I don't see a "set".
by mmkw43
Thu Jan 20, 2022 3:57 pm
Forum: Python
Topic: Place mouse on startup ?
Replies: 4
Views: 135

Place mouse on startup ?

Searched everywhere with no luck. I have a tkinter program and would like the mouse to be readily visible inside a text widget when the program starts. I know I can set focus and the insertion cursor will blink but I want the actual mouse arrow in there as well. (if possible). -- thank you for any h...
by mmkw43
Fri Dec 31, 2021 2:34 pm
Forum: Python
Topic: Reversing lines in a text file
Replies: 13
Views: 349

Re: Reversing lines in a text file

by blimpyway » Thu Dec 30, 2021 8:29 pm "" is empty string " " is a blank space, which breaks formatting. See, this is my problem. I'm a hobbyist programmer and don't do it everyday so these simple things get lost. (Especially at my age). The minute I saw that, I kicked myself an...
by mmkw43
Thu Dec 30, 2021 11:45 pm
Forum: Python
Topic: Reversing lines in a text file
Replies: 13
Views: 349

Re: Reversing lines in a text file

So, here's where I'm at with this. the write part (and using a formatted string) -- ww = open('alog.txt','a') self.logw = (f'{self.cl:9}{self.nm:9}{self.bnd:5}{self.loc:15}{self.st:5}{self.country:16}{timez:12}\n') ww.write(self.logw) ww.close self.logbox.insert(0.0,self.logw) and alog.txt looks per...
by mmkw43
Thu Dec 30, 2021 10:09 pm
Forum: Python
Topic: Reversing lines in a text file
Replies: 13
Views: 349

Re: Reversing lines in a text file

actually tac didn't misalign thought it did.

subprocess.call("sudo tac myfile? etc
how would I get the result from tac into another string variable?

using \n and join is perfect except giving me an empty line in between.
by mmkw43
Thu Dec 30, 2021 9:54 pm
Forum: Python
Topic: Reversing lines in a text file
Replies: 13
Views: 349

Re: Reversing lines in a text file

I think maybe I should be writing the file backwards and just read it normally (will try that) because right now I'm doing the conversion on read and if I -- use "\n".join(lines) then I get an extra space between my lines line1 line2 etc using " ".join(lines) then I lose my forma...
by mmkw43
Thu Dec 30, 2021 9:20 pm
Forum: Python
Topic: Reversing lines in a text file
Replies: 13
Views: 349

Re: Reversing lines in a text file

Ok fellas. Thanks very much -- got it going. There's a limit to my patience when things need to be manipulated so much :).
by mmkw43
Thu Dec 30, 2021 7:39 pm
Forum: Python
Topic: Reversing lines in a text file
Replies: 13
Views: 349

Re: Reversing lines in a text file

Ok. What's giving me trouble (and errors) is that my objective is not to write another file that is reversed but trying to insert the reversed text into a tkinter text box. Is there any way to create a variable from lines.reverse() that will work? I know with readlines I now have a list (need a stri...
by mmkw43
Thu Dec 30, 2021 4:27 pm
Forum: Python
Topic: Reversing lines in a text file
Replies: 13
Views: 349

Reversing lines in a text file

This is driving me nuts and just can't seem to solve it no matter what I try. What is thee simplest way to reverse the order of lines in a text file? line 1 line 2 line 3 (the way the file is written) I need to get a variable with -- line 3 line 2 line 1 I'm writing the file in my program (appending...
by mmkw43
Wed Dec 29, 2021 9:03 pm
Forum: Python
Topic: Limit mouse area?
Replies: 5
Views: 180

Re: Limit mouse area?

I'll look into pymouse. Maybe that will do it.
by mmkw43
Wed Dec 29, 2021 7:42 pm
Forum: Python
Topic: Limit mouse area?
Replies: 5
Views: 180

Re: Limit mouse area?

Ok. Just to try and make myself clearer maybe. Let's say I have a tkinter screen (as I do now) but I on'y want the mouse to function with the lower right 1/4 of the screen. I want to limit any cursor activity to that area and have zero cursor visibility in the remaining 3/4. cursor = none in that 3/...
by mmkw43
Wed Dec 29, 2021 6:59 pm
Forum: Python
Topic: Limit mouse area?
Replies: 5
Views: 180

Limit mouse area?

I have a python/tkinter GUI where I have used a cursor = none because I don't want it to appear on most of the screen. I do however have an area in the lower right corner that has some entry boxes that need mouse activity obviously. And the cursor does manage to appear when I manage to move the mous...
by mmkw43
Mon Dec 27, 2021 10:50 pm
Forum: Graphics programming
Topic: Tkinter -- insert text file into text widget
Replies: 1
Views: 139

Re: Tkinter -- insert text file into text widget

solved it myself.
need a fixed width font.
by mmkw43
Mon Dec 27, 2021 10:21 pm
Forum: Graphics programming
Topic: Tkinter -- insert text file into text widget
Replies: 1
Views: 139

Tkinter -- insert text file into text widget

I have a text file that is perfectly formatted the way I want with 3 words per line but all of the first letters line up so it looks like a spreadsheet really. Everything is nicely justified vertically. When I insert the file into a text box, I get some bad placement. What should I expect? And maybe...
by mmkw43
Wed Oct 20, 2021 2:39 pm
Forum: Python
Topic: Network monitor
Replies: 1
Views: 187

Network monitor

Has anyone ever seen a script or maybe something from the PI software collection that will simple let me monitor my internet connection ? Maybe that will store time on/time off etc ? Just want to monitor the connection for any disconnects. Guess it would be simple enough to write but want to ask fir...
by mmkw43
Sat Aug 14, 2021 7:27 pm
Forum: General discussion
Topic: Application launch bar crashes
Replies: 2
Views: 191

Re: Application launch bar crashes

Ok, but sounds like a detail that needs to be fixed and doing my duty to report.
Thanks.
by mmkw43
Sat Aug 14, 2021 4:50 pm
Forum: General discussion
Topic: Application launch bar crashes
Replies: 2
Views: 191

Application launch bar crashes

PI 3B and latest OS and here's what happens -- I removed all the items in the application launch bar because I just wanted one item, raspi config. It won't add it and prompts that it's not responding so I terminate. In fact, it won't add ANY other programs (I tried) and crashes. Maybe (for some reas...
by mmkw43
Thu Aug 05, 2021 11:24 pm
Forum: Graphics programming
Topic: Tkinter and serial port -- needs thread?
Replies: 1
Views: 748

Re: Tkinter and serial port -- needs thread?

Needed to add --

ser.reset_input_buffer()

Live and learn.

If anyone can confirm, I'm guessing when I was opening the port in the loop over and over again it automatically resets the buffer.

Open it once (as I can now do), you must add the reset line.
by mmkw43
Thu Aug 05, 2021 7:07 pm
Forum: Graphics programming
Topic: Tkinter and serial port -- needs thread?
Replies: 1
Views: 748

Tkinter and serial port -- needs thread?

This is some code that works perfectly. It grabs data from a microcontroller. As you can see the port is opened in the loop "test". But if I move ser = serial.Serial etc out of the loop to initialization to open it just once and use self of course, I get no data at all. Also, I tried putti...
by mmkw43
Sat Jul 31, 2021 10:22 pm
Forum: Python
Topic: Buster ver 10 -- serial port
Replies: 5
Views: 531

Re: Buster ver 10 -- serial port

I'm just going to make a complete image of my original, OS and all. Probably best practice anyway? Will slow down that loop also -- doesn't need to be that fast at all. When I put it in initialize -- I don't get any errors but get nothing from the microcontroller. I remember it was my first instinct...
by mmkw43
Sat Jul 31, 2021 2:12 pm
Forum: Python
Topic: Buster ver 10 -- serial port
Replies: 5
Views: 531

Re: Buster ver 10 -- serial port

Ok -- thanks you guys. I'll get back later after looking at it. For one, I was under the impression you couldn't initialize the port and had to do it "on the fly". Your tips give me hope. Has to be something simple. Like I say, the original and a complete image of it are flawless. The prob...
by mmkw43
Fri Jul 30, 2021 10:47 pm
Forum: Python
Topic: Buster ver 10 -- serial port
Replies: 5
Views: 531

Buster ver 10 -- serial port

I have a script that I wrote using python3.7 and raspian 10 and the program works flawlessly 24/7 for months on end. The only possibly "touchy" item in the script is the use of the serial port but like I say, no issues at all. This is the segment with the serial port. It uses 4 qualifiers ...
by mmkw43
Sun Jun 06, 2021 3:15 pm
Forum: Python
Topic: Threads -- need better understanding
Replies: 13
Views: 608

Re: Threads -- need better understanding

Thanks scruss. I wasn't familiar with Xorg at all but see that it is the linux backbone? of the GUI? Don't know anything about it or whether there is an issue seeing it around 20% on cpu usage as my tkinter script is running? There is always some sort of ongoing tkinter activity in the script. The s...
by mmkw43
Sat Jun 05, 2021 8:18 pm
Forum: Python
Topic: Threads -- need better understanding
Replies: 13
Views: 608

Re: Threads -- need better understanding

Awesome ! -- then you know what I'm saying. Can I call you Fil for short? Yeah, me a ham early on (which I haven't messed with in years -- mostly idiots now) and going to the radio/tv repair shop to dig through their trash. Worked in radio a long time. Don't know if you remember Allied radio but act...

Go to advanced search