Go to advanced search

by Paeryn
Mon Oct 21, 2019 2:28 am
Forum: Python
Topic: My first Python app--Age Calculator(need suggestions!)
Replies: 3
Views: 71

Re: My first Python app--Age Calculator(need suggestions!)

The datetime module deals with dates and times which you can use to get the date (amongst other things), e.g. import datetime today = datetime.date.today() day = today.day month = today.month year = today.year print('Today's day is', day) print('The month is', month) print('The year is', year) A ran...
by Paeryn
Mon Oct 21, 2019 12:38 am
Forum: Python
Topic: What does this error mean (thonny)
Replies: 3
Views: 116

Re: What does this error mean (thonny)

Under X11 iconbitmap() wants an xbm image, I don't think it accepts anything else. If you want to use png (or gif / jpg) you can load it as a PhotoImage and use iconphoto() . Don't forget that the PhotoImage has to be kept alive for as long as the image is used, if it goes out of scope and gets garb...
by Paeryn
Sun Oct 20, 2019 9:03 pm
Forum: General programming discussion
Topic: Liberation through Computer Literacy
Replies: 1189
Views: 58015

Re: Liberation through Computer Literacy

I would think that the people using these powerful supercomputers have more pressing jobs to run on them than calculating pi. It's not like us buying a new RPi where it may be sat idling for hours / days at a time.
by Paeryn
Sun Oct 20, 2019 8:27 pm
Forum: General discussion
Topic: "Click here..." is annoying
Replies: 8
Views: 647

Re: "Click here..." is annoying

Did ask once before about disabling tool tips on buster but no one ever came back with an answer. From a quick look at the source code the tooltips are always added for the menu items (including the menu button itself) if there is a description present. It doesn't support the tooltips=0 setting tha...
by Paeryn
Sun Oct 20, 2019 1:15 pm
Forum: General discussion
Topic: "Click here..." is annoying
Replies: 8
Views: 647

Re: "Click here..." is annoying

Open autostart and remove or comment out point-rpi. sudo nano /etc/xdg/lxsession/LXDE-pi/autostart #point-rpi Tried the above edit and rebooted pi , still get the "Click here to open applications menu" on my pi4 running buster. Have you got a local config for lxsession? If so that is used rather th...
by Paeryn
Sun Oct 20, 2019 3:33 am
Forum: General discussion
Topic: RPi 4 power consumption vs. RAM
Replies: 8
Views: 341

Re: RPi 4 power consumption vs. RAM

Is the RAM on the main (SOIC ?) chip ? No, the RAM is on a separate chip. The RPi0 and RPi1 have the RAM chip sat directly on top of the SoC (so it looks like one chip unless you look closely) but for all other RPis they are on different parts of the PCB. The SoC does have some cache memory on-chip...
by Paeryn
Sun Oct 20, 2019 3:16 am
Forum: General discussion
Topic: RPi 4 power consumption vs. RAM
Replies: 8
Views: 341

Re: RPi 4 power consumption vs. RAM

The static power will increase (that needed to keep the memory refreshed) but the power needed for accessing the memory (reading & writing) will largely be the same as the bandwidth doesn't change. I'd think the power usage of the rest of the system would make power consumption fairly negligible bet...
by Paeryn
Sun Oct 20, 2019 1:42 am
Forum: General discussion
Topic: python doesnt wanna download pip
Replies: 1
Views: 63

Re: python doesnt wanna download pip

Hello, I have a problem with command : sudo apt install python-pip when i activate it in python 3.5.3 on NOOBS v2_4_3 it says sudo apt install python-pip SyntaxError: invalid syntax How can i fix this Problem? Firstly, NOOBS isn't your operating system, it's an operating system installer . Typicall...
by Paeryn
Fri Oct 18, 2019 9:31 pm
Forum: Beginners
Topic: How to auto-boot a python3 program in Thonny
Replies: 32
Views: 737

Re: How to auto-boot a python3 program in Thonny

Glad you managed to sort it out. That's the main downside of IDLE and Thonny (and possibly other python IDEs), when running programs in them your program never really exits unless you restart the shell (either manually or by re-running your progran). Whilst this makes it easier to debug your program...
by Paeryn
Fri Oct 18, 2019 7:04 pm
Forum: Beginners
Topic: How to auto-boot a python3 program in Thonny
Replies: 32
Views: 737

Re: How to auto-boot a python3 program in Thonny

That looks like you haven't put the shebang line at the start of the file. It needs to be the very first line and the #! has to be the first two characters. If you so much as have a blank line above it or a space before the characters then it won't be recognised, the #! literally has to be the first...
by Paeryn
Fri Oct 18, 2019 5:21 pm
Forum: Beginners
Topic: How to auto-boot a python3 program in Thonny
Replies: 32
Views: 737

Re: How to auto-boot a python3 program in Thonny

The chmod command given is entered on its own, not as an argument to either python3 or thonny. From how you are trying to do it I assume the file you are wanting to run is in /home/pi/Projects . Enter these lines individually at the command line in a terminal. The first line makes sure you in the di...
by Paeryn
Fri Oct 18, 2019 2:25 am
Forum: Beginners
Topic: How to auto-boot a python3 program in Thonny
Replies: 32
Views: 737

Re: How to auto-boot a python3 program in Thonny

commands in autostart need the @ in front of them. But the not running from the command line is odd. Does it work if you add #!/usr/bin/python3 as the very first line of your TrackPlayer.py, make it executable with chmod +x TrackPlayer.py , then run it in the terminal with ~/Projects/TrackPlayer.py...
by Paeryn
Fri Oct 18, 2019 1:36 am
Forum: Raspbian
Topic: Why am I getting this syntax error?
Replies: 3
Views: 116

Re: Why am I getting this syntax error?

You solved my issue, thank you. I still needed sudo because these are write protected files, so I moved it in front of ffmpeg and it worked fine. I would have thought that ffmpeg is creating new files rather than overwriting current files, but if you need to overwrite write-protected files you shou...
by Paeryn
Thu Oct 17, 2019 9:44 pm
Forum: Raspbian
Topic: Why am I getting this syntax error?
Replies: 3
Views: 116

Re: Why am I getting this syntax error?

When I run the following from the terminal of Raspbian in my Pi 4B I get a "syntax error near unexpected token 'do'": sudo for f in *.flac; do ffmpeg -i "$f" "${f%.flac}.wav"; done rm *.flac This batch file statement comes from the GPIO Music Box example. Its purpose is to convert .flac files to .w...
by Paeryn
Thu Oct 17, 2019 2:59 am
Forum: C/C++
Topic: Where can I begin learning C/C++?
Replies: 57
Views: 2318

Re: Where can I begin learning C/C++?

I take it you held your ground, especially if you had already implemented it! GCC has been printing a caret showing the start position of the error on the line for quite a while but it used to be just that. I think it was in 6 that they added tildes with it to highlight the extent of the error rathe...
by Paeryn
Wed Oct 16, 2019 10:24 pm
Forum: C/C++
Topic: Where can I begin learning C/C++?
Replies: 57
Views: 2318

Re: Where can I begin learning C/C++?

It is all the massive complex machinery just below the surface that scares me. This a C++ hello world program: #include <iostream> int main() { std::cout << "Hello, world!\n"; } Seems innocuous enough, after you accept the peculiar way you have to do output. But look what happens when you type >> i...
by Paeryn
Wed Oct 16, 2019 12:37 am
Forum: C/C++
Topic: Running C/C++ on Raspberry Pi
Replies: 32
Views: 1244

Re: Running C/C++ on Raspberry Pi

vi is really a cumbersome crutch from times when the rock'n'roll was invented and which honestly makes me vomite - instead, Geany is a handsome and reasonable editor and IDE. I somehow doubt the honesty of your said reaction to vi. There's nothing wrong with vi (though vim has replaced vi nowadays)...
by Paeryn
Wed Oct 16, 2019 12:18 am
Forum: Python
Topic: Pi-4: Python shell (idle) is missing - why?
Replies: 6
Views: 197

Re: Pi-4: Python shell (idle) is missing - why?

. . . but Thonny isn't a Python shell, which is what the book is asking for - at least in the beginning. I've played with mu too on other platforms and it's OK. IDLE isn't a shell either, it's an IDE just like Thonny. Have you tried running Thonny? It has a shell pane just like IDLE has a shell win...
by Paeryn
Wed Oct 16, 2019 12:04 am
Forum: Advanced users
Topic: OpenGL
Replies: 4
Views: 237

Re: OpenGL

just so I can play SuperTuxKart, requires OpenGL 3.1 or something.. ;) From a quick look at the source code, SuperTuxKart can be compiled for either OpenGLES2 or OpenGL3 (looks like it might need 3.3). The RPi 4 (well, all RPi's to date) can do OpenGLES2 natively (the RPi4 can go upto OpenGLES3) bu...
by Paeryn
Tue Oct 15, 2019 8:07 pm
Forum: Troubleshooting
Topic: Segmentation Fault On Pi Zero when trying to run executable which is compiled in raspberry 4.
Replies: 2
Views: 110

Re: Segmentation Fault On Pi Zero when trying to run executable which is compiled in raspberry 4.

If the program was compiled on the RPi4 specifically for armv7 then the program would likely fail in the RPi0 with a SIGILL the moment it tries executing an instruction that armv6 doesn't have, and usually that happens very early as gcc uses MOVT a lot in armv7 which the RPi0's armv6 doesn't underst...
by Paeryn
Tue Oct 08, 2019 2:52 pm
Forum: General programming discussion
Topic: Liberation through Computer Literacy
Replies: 1189
Views: 58015

Re: Liberation through Computer Literacy

So what I'm hearing is Python's internal BIGINT is crap and GMP should be installed by default to make the language usable? No, Python's multi-precision integers are fine for most cases, you probably won't notice much difference in performance to GMP's until you get to really big numbers. The bigge...
by Paeryn
Mon Oct 07, 2019 3:17 pm
Forum: General discussion
Topic: RPI4: Why is everything still 32-bit?
Replies: 180
Views: 6572

Re: RPI4: Why is everything still 32-bit?

My plan is to win Powerball, buy the Pi foundation and force deprecation of 32 bit. If so many people love it let them maintain it while the supported OS goes 64 bit. Actually I'd probably just use the money to make a RISCV board This post is 100% humor Whilst humour, might be worth saying that you...
by Paeryn
Mon Oct 07, 2019 1:41 am
Forum: General discussion
Topic: piRoot: A way to run x86_64 Debian apps on Raspbian
Replies: 77
Views: 3432

Re: piRoot: A way to run x86_64 Debian apps on Raspbian

One mystery someone may be able to explain to me - since 'sudo apt-get install qemu-user-static' I can now run any X86 Linux binaries. Eg FASM and FASMARM, outside the chroot piRoot sets up. Why ? Is it that installing qemu-user-static has enabled doing that or is it something which installing and ...
by Paeryn
Sun Oct 06, 2019 9:46 pm
Forum: C/C++
Topic: qtcreator: memory overflow in text box (PlainTextEdit) ? [solved]
Replies: 14
Views: 561

Re: qtcreator: memory overflow in text box (PlainTextEdit) ? [solved]

Yes you can do it there, but its property can also be set is in qtcreator's form editor which will automatically set it in the window's ui_setupUi(), I've just tried it...
QPlainTextEdit.png
QPlainTextEdit
QPlainTextEdit.png (29.49 KiB) Viewed 275 times
by Paeryn
Sun Oct 06, 2019 9:34 pm
Forum: C/C++
Topic: qtcreator: how to write in a text frame widget by the program? [solved]
Replies: 12
Views: 501

Re: qtcreator: how to write in a text frame widget by the program?

You can move to an absolute position within the document with QTextCursor::setPosition(int pos, QTextCursor::MoveMode m = MoveAnchor) Setting it to an arbitrary line and column (assuming by line y you mean block y and by column x you mean xth character of block y ) then you could always do this to p...

Go to advanced search