Go to advanced search

by Paeryn
Sun May 19, 2019 5:40 pm
Forum: Python
Topic: Question about Tkinter text widged in scrolledtext
Replies: 6
Views: 67

Re: Question about Tkinter text widged in scrolledtext

Glad I could help, have fun.
by Paeryn
Sun May 19, 2019 5:20 pm
Forum: Python
Topic: Question about Tkinter text widged in scrolledtext
Replies: 6
Views: 67

Re: Question about Tkinter text widged in scrolledtext

joseplaselva wrote:
Sun May 19, 2019 4:20 pm

Code: Select all

        self.textEvents.insert("1.0", texte)
The "1.0" in the insert function says to insert the text at line 1 column 0, i.e. before anything else. To insert at the very end use

Code: Select all

        self.textEvents.insert(tk.END, texte)
by Paeryn
Sun May 19, 2019 4:32 pm
Forum: Troubleshooting
Topic: GPIO pins not outputting
Replies: 5
Views: 140

Re: GPIO pins not outputting

As B.Goode said, you use GPIO.output(pin, value) To set the level of an output. By using GPIO.setup(33, GPIO.HIGH) you are effectively setting pin 33 back to being an input, when using GPIO.setup(33, GPIO.LOW) you are setting it back to being an output, and at no point are you setting the logic leve...
by Paeryn
Sun May 19, 2019 4:11 pm
Forum: Python
Topic: Question about Tkinter text widged in scrolledtext
Replies: 6
Views: 67

Re: Question about Tkinter text widged in scrolledtext

Your description is a bit confusing, Now when I write a line appears allways in the top when the first one appears in the botton. When I write on a simple text widget appears in the other way, the last line is allways at the botton... When you say write do you mean inserting text from within your pr...
by Paeryn
Sun May 19, 2019 2:08 am
Forum: Troubleshooting
Topic: [Investigation] pi's password is lost in every reboot issue
Replies: 8
Views: 163

Re: [Investigation] pi's password is lost in every reboot issue

Try creating a "wrapper" script that pretends to be usermod, but dumps information to a file instead. Something like #!/bin/bash ( echo "usermod called at $(date)" echo "env" env echo echo "command line" echo "[email protected]" ) >>/tmp/usermod.log There are probably more things you can add to track down what is...
by Paeryn
Sat May 18, 2019 9:03 pm
Forum: Beginners
Topic: dpi_output_format explanation?
Replies: 2
Views: 68

Re: dpi_output_format explanation?

519 is the decimal value, converting it to binary that is bits 0,1,2 & 9 set, looking at the format that means mode 7 (bits 0 to 3) which is 24 bit colour RGB888 and bit 9 means inverted pixel clock (data changes on falling edge, stable on rising). All other bits 0 so hsync, vsync & oe polarity are ...
by Paeryn
Sat May 18, 2019 1:03 pm
Forum: Python
Topic: tkinter Text Widget putting "{}" around text I insert
Replies: 6
Views: 113

Re: tkinter Text Widget putting "{}" around text I insert

Can you explain how this works # Note use of tilde to save typing :-) with open("~/Documents/song1.txt") as f: f1 = f.read() f1 = f1.strip() # Take out CR / LF from the text read from file T.insert("1.0", f1) If the CR/LF have been stripped out how does the insert know what is a line? I assumed "f1...
by Paeryn
Fri May 17, 2019 9:52 pm
Forum: Python
Topic: Editing in Python 3.5.3 Shell
Replies: 3
Views: 78

Re: Editing in Python 3.5.3 Shell

Python's interactive shell uses the GNU Readline library for editing, seems to be working exactly as it should here. Note that IDLE's shell (and any other IDE's shell) is likely to have their own editing methods.

Link to Readline's editing commands
by Paeryn
Fri May 17, 2019 6:48 pm
Forum: Troubleshooting
Topic: Why Raspberry pi is storing different number of samples different second?
Replies: 13
Views: 186

Re: Why Raspberry pi is storing different number of samples different second?

Just noticed PEP 475, as of Python 3.5 time.sleep() won't return early on a signal unless a signal handler catches the signal and raises an exception. PEP 475 states that all standard library system calls that could terminate early due to interrupts will now (as of Python 3.5) automatically retry wi...
by Paeryn
Fri May 17, 2019 5:35 pm
Forum: Troubleshooting
Topic: Why Raspberry pi is storing different number of samples different second?
Replies: 13
Views: 186

Re: Why Raspberry pi is storing different number of samples different second?

Even taking into account the time taken to execute the code, as Ernst hinted at earlier time.sleep() doesn't sleep for exactly the specified length time, rather it sleeps for at least * the specified length of time. If, after the specified time has passed, there other processes (especially those wit...
by Paeryn
Thu May 16, 2019 9:57 pm
Forum: Python
Topic: tkinter Text Widget putting "{}" around text I insert
Replies: 6
Views: 113

Re: tkinter Text Widget putting "{}" around text I insert

scotty101 I put the "x" in place of "f1" and it worked but the lines were in reverse order, and 2 lines were in one line. You had the lines in reverse order because you had T.insert("1.0", x) which says "insert x at line 1, column 0", so the the first line was put in to the text widget then the sec...
by Paeryn
Thu May 16, 2019 11:27 am
Forum: C/C++
Topic: Problem with start program
Replies: 2
Views: 108

Re: Problem with start program

To know where the program crashes (and to debug it) compile with debugging info -g and run it with gdb [email protected]:~/Programming/sdl $ gcc -g sdltest.c -o sdltest $(pkg-config --cflags --libs sdl) -lSDL_image -lwiringPi [email protected]:~/Programming/sdl $ gdbtui sdltest When in gdb run the program with run , wh...
by Paeryn
Wed May 15, 2019 8:08 pm
Forum: General discussion
Topic: my service is not starting at power up [solved]
Replies: 16
Views: 279

Re: my service is not starting at power up

You look to be capturing stdout and strerr to your log file /home/pi/washup/blynk.log , at a guess Python is printing an error message in there telling you why it failed. Possibly your program is trying to create a graphical window before the X server has started or it is trying to access the networ...
by Paeryn
Tue May 14, 2019 3:35 am
Forum: OpenGLES
Topic: Is there a way to use gl_InstanceID in shaders?
Replies: 3
Views: 116

Re: Is there a way to use gl_InstanceID in shaders?

Good find, I assumed it wasn't supported as GL_EXT_draw_instanced isn't reported as an extension. Having looked at when instancing was added, my copy of the GLSL spec is from before then. Strange you say it is GL_ARB_ and not GL_EXT_ , the Khronos registry for extensions say that GL_ARB_draw_instanc...
by Paeryn
Mon May 13, 2019 12:37 am
Forum: OpenGLES
Topic: undefined reference to BlendFuncSeparateOES
Replies: 2
Views: 100

Re: undefined reference to BlendFuncSeparateOES

glBlendFuncSeparateOES() is an extension, if the driver doesn't say that it supports it then you can't call it. The driver doesn't say that it supports it, read the string returned by glGetString(GL_EXTENTIONS) If it was supported then GL_OES_blend_func_separate would be in that string. char *exts =...
by Paeryn
Sun May 12, 2019 1:03 pm
Forum: C/C++
Topic: GCC 9.1 released
Replies: 23
Views: 846

Re: GCC 9.1 released

Paeryn, That all makes sense, thanks. That is, until you build it on a Pi Zero :) The three stage build takes over 50 hours on the p0, but (surprisingly) it works perfectly. Just leave it running over the weekend. FYI, the new D front end added around one million lines of code ... I'll have to get ...
by Paeryn
Sun May 12, 2019 10:01 am
Forum: OpenGLES
Topic: Is there a way to use gl_InstanceID in shaders?
Replies: 3
Views: 116

Re: Is there a way to use gl_InstanceID in shaders?

I'd like to do instanced drawing like I do on iOS and OSX. But neither gl_InstanceID nor gl_InstanceIDEXT are defined when compiling OpenGL ES shaders. Is there a way to make this work on PI? The RPi has native GL|ES 2 which uses GLSL version 100, gl_InstanceID comes from GLSL version 300 which typ...
by Paeryn
Sat May 11, 2019 12:41 pm
Forum: Other programming languages
Topic: ScriptBasic
Replies: 624
Views: 12359

Re: ScriptBasic

PeterO wrote:
Sat May 11, 2019 8:39 am
Heater wrote:
Sat May 11, 2019 8:20 am
I now have the correct million digits in fibo.dat. Excellent!
Which would not have fitted onto most BBC floppies !
PeterO
I wonder how long a tape (or rather how many C90s) would be needed.
by Paeryn
Tue May 07, 2019 7:45 pm
Forum: C/C++
Topic: GCC 9.1 released
Replies: 23
Views: 846

Re: GCC 9.1 released

I've been using the following code for a few years now without any problems. The salient option for speed is the "--disable-bootstrap". Instead of 3 passes it only passes once. Thanks. Sounds all that's needed anyway if the current installed compiler is a recent GCC (say you are upgrading from 8.3 ...
by Paeryn
Sun May 05, 2019 8:43 pm
Forum: C/C++
Topic: Lightweight ping program in C code * requires root *
Replies: 6
Views: 261

Re: Lightweight ping program in C code * requires root *

Nit-picking (and is from the original code), but the percentage packet loss can only ever show 0% or 100% if more than one packet is used e.g. #define MAX_NO_PACKETS 10 printf("%d packets transmitted, %d received , %%%d lost\n", nsend, nreceived, (nsend - nreceived) / nsend * 100); nsend and nreceiv...
by Paeryn
Sat May 04, 2019 5:36 pm
Forum: Beginners
Topic: 3.3v pin shorted to 5v
Replies: 7
Views: 285

Re: 3.3v pin shorted to 5v

this is a $35 lesson. throw away the PI and buy a new one. shorting the 3V3 to 5V will irreparably damage the quad voltage regulator chip. If i removed pmic and connect 1.2v, 1.8v and 3.3v to rpi as like schematic diagram it will wor? I doubt it, part of the job of the chip is to bring up the power...
by Paeryn
Tue Apr 30, 2019 9:12 pm
Forum: Python
Topic: Getting crazy with tkinter text widget
Replies: 2
Views: 137

Re: Getting crazy with tkinter text widget

I made a tkinter script with some text widgets where display some data during a initial procedures... showing day, hour, temperatures ... etc , but the first text widget with the day doesn't show nothing until all the others has been updates... Nit-picking, but saying the opposite of what you mean ...
by Paeryn
Tue Apr 30, 2019 10:04 am
Forum: Python
Topic: When I run the program, the file does not open and does not make any error.
Replies: 4
Views: 137

Re: When I run the program, the file does not open and does not make any error.

When I run the program, the file does not open and does not make any error. How I can fix it? import subprocess, os, signal from time import sleep p = subprocess.Popen("/home/pi/Desktop/d.pdf", shell=True, preexec_fn=os.setsid) sleep(5) os.killpg(p.pid, signal.SIGTERM) Is d.pdf an executable file? ...
by Paeryn
Sun Apr 28, 2019 9:31 pm
Forum: Python
Topic: Hiding and Replacing items in tkinter
Replies: 4
Views: 156

Re: Hiding and Replacing items in tkinter

Oops, in the canvas.itemconfigure() it should be state= not status=, sorry, I was writing it on my phone. I'll edit the post above to correct it.
by Paeryn
Sun Apr 28, 2019 6:00 pm
Forum: Python
Topic: Hiding and Replacing items in tkinter
Replies: 4
Views: 156

Re: Hiding and Replacing items in tkinter

Are you just talking about elements on a canvas? Those can be hidden / revealed by setting their status state to HIDDEN / NORMAL. There is a third state, tk.DISABLED where the element remains visible but will not react to binds, also some element properties can be set separately for NORMAL and HIDDE...

Go to advanced search