Is playing CD (ie. compact disc) music, not via a streaming means, but using a CD player, dead?! We hope not, but the options to playing a physical CD are getting harder, because the range of mechanical CD players available seems to be dwindling.
… as you do, R2-D2, and you too, CP-O3 (needing repairs to feel better again).
Anyway, setting it up, we‘re not saying it was all plain sailing, but with perseverance regarding the supplied configuration instructions supplied, in what felt like “delayed pairing”, we got it talking to the same Sonos bluetooth speaker talked about at Spotify and Sonos Bluetooth Speaker Tutorial, which pleased us “more than somewhat”, though, exactly how much more … well …
Okay, just need some CD cleaning ideas (and throw in some car upholstery ideas), now?!
… combination of products. Once arranged, given we had the Spotify app and subscription organized already (as we alluded to with Spotify Bluetooth Speaker Volume Tutorial below), and that is pretty simple as far as Sonos goes (it’s Era 100 pamphlette describing it …
1 Connect the power cord
2 Download the Sonos app for setup
on our iPhone with the Spotify app associated with the subscription and used to set up the Sonos speaker (and we’re not even going into some additional Wi-Fi functionality available too) …
Settings -> Bluetooth … tap (hopefully) On >
as required, if Room Name (SONOS) “Not Connected” tap to make it “Connected”
open Spotify app
pick music to play and tap it’s icon …
tap the Play button (perhaps only this once, for the day (and as a sometime media interfacing iOS programmer, that is a feat!))
That’s it! But let’s just hope all those great and entertaining musicians are getting rewarded appropriately too.
playing music through the bluetooth speakers … we find we want to …
change volume
? Do you think I can nail that last step?! I mean, that last step confounds me every time! Maybe this blog posting can help me, and maybe you, to commit to memory, where on Spotify you can get to change the volume on those bluetooth speakers …
There's a bluetooth icon down near the bottom of the screen a little right of centre (with special consideration for people who think Spotify is all smoke and mirrors)
… which gets you to a draggable volume controller. Yayyyyyyyy!
Spotify has changed the way a lot of us listen to music online. The huge pull for its audience are the number of arrangements it has with music labels to be able to build a huge music repository publicly available online.
Using Spotify though, the easiest way to arrange the music playing is via a “Shuffle Play” of the songs of the sources you choose, whether that be by individual artist or podcast or album or genre. Some albums though, at least to our mind, are like a story, and they have been developed with a purpose or theme in mind, and as such, can be best played in the song order chosen by the artist or that artist’s agents, for that album. Don’t think there are any buttons as such for this on the Spotify app, today’s video showing the iOS app version on an iPhone. But this is possible, and the purpose of today’s tutorial is to talk about the Spotify “play queue” and in the process how to achieve this.
Clear the existing queue first by …
Tap on song currently playing
Tap top right icon … shows songs on the queue
Check all the boxes on left
Tap “Remove” button at bottom left to clear the queue
Go back with down arrow top left icon tap
Search for album name via bottom magnifying glass icon tap … type in album name in resultant textbox … go (swipe) down to Album section and tap the album
Swipe to right on each song of that album in order … and a “Queued” message will briefly verify that operation
Optionally choose more music to be queued up by returning to step 2 above
Your choices will be played in that order after any currently playing song
Have a geek at this demonstrated by us, below …
We hope this might be of some use to some Spotify users out there! Happy listening!
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
Bird Identification via Merlin Bird ID App Tutorial
Here, in Australia, a study of the the Wallace Line explains a lot why we have a proliferation of birds. The Bird Quiz Peerage Tutorial below is inspired by the birds my sister sees up in south-eastern Queensland, for instance.
We’re hearing the “ornithology thing” is catching on with the younger crowd here in Australia, too, which is encouraging, because it is “Citizen Science” that might help push things along ecologically, in the right direction, as far as educating us all, we’re thinking.
A great mobile app we’ve come across, in this regard, is the …
… app (we’re accessing on an iPhone) by Cornell Lab. We’ve been using it our way to identify birds via their birds calls, though the app admits to only knowing 66% of them … but budding “Citizen Scientists” are informed on the app about how they can help improve that figure. Anyway, today’s animated GIF presentation gives a feel for some of this.
Did you know?
Fancy a fat bear?! Fancy voting about your favourite fat bear?!!
There are a couple of “peerage moves” we like for their simplicity around here, they being toggling between …
the just about totally equivalent [webApplicationName].html and [webApplicationName].htm usages … and/or …
the just about totally equivalent [imageFileName].jpg and [imageFileName].jpeg usages (starts with latter, with no local knowledge shown and Javascript DOM changes to former, after quiz questions all touched upon)
… and today, further to yesterday’s Bird Quiz Primer Tutorial, for the first time we can remember both feature in today’s work to set up a “couple of Bird Quiz” peers we allow either to call on the other via a user dropdown element onchange …
function changeit(osel) {
if ((document.URL.split('?')[0].split('#')[0] + '#').indexOf(osel.value + '#') == -1) {
location.href=osel.value;
}
}
… event function based on a new dropdown (ie. select element) …
<select size=2 onchange=changeit(this);><option value='bird_quiz.htm' selected>Out and About</option><option value='bird_quiz.html'>Bird Bath</option></select>
… which swaps around in option order for the other peer. Very simple means of extending functionality in the image map form (and thanks to mobilefish here) involving my sister’s great photography again, thanks, of the changedbird_quiz.htm‘s Bird Quiz you can try, again, below …
In Australia, a lot of our wildlife is of the bird variety, and you may want to research the Wallace Line for further research into why this is the case. The variety of birdlife can be tremendous, even in urban areas.
My sister lives in a great part of Australia for birdlife, and thanks to her great photography, and, no doubt, patience, today’s new …
Bird Quiz
… game asks quite a bit of the user as far as identifying (today’s fast and small) birds goes, but there are lots of Australians into ornithology, as, no doubt, in other parts of the world.
We’ve based the game on an image in a form without the local knowledge, and if the user completes the quiz, revealing that local knowledge, in the image map form (and thanks to mobilefish here) of bird_quiz.html‘s Bird Quiz you can try below …
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.
We recently got helped hugely acclimatizing to a new EV (electric vehicle) via a …
Solar Panel and Battery install to house … solar battery specialists …
EV Charging via Private Pole to house and grid … electrician …
EV Car … car sales specialist
… flurry of advice recently, leaving us with mobile apps for …
the house solar panels and battery
the car
the EV charger … it being today’s focus, and called the Ocular App, helping with AC (the top “trickle feed” slower (top car plug, and as you buy the EV Charger you get supplied the unsuitable lead) charging approach, as distinct from Evie App charging (oh, that makes four) at public charging stations where, hopefully available, is faster DC charging (the bottom car plug) many Australians will be getting a handle on this coming school holidays) …
Since then, the car people upgraded our car software in an indescribable set of steps … was this firmware?! Anyway, an ongoing matter of interest (it took us a month to address but read on) was the electrician leaving us with two RFIDs … these quite small rigid but smaller and fatter credit card …
… feeling do-dahs EV charging Plug and Charge precursor arrangements … in what you might categorize as a “security thaing”.
You’re probably getting the gist here …
Stick to the day job … software!
But luckily, yours truly gets inspiration in these “onboard hardware matters” from the gumption and fearlessness of my partner! Yayyy! So we found ourselves …
at the iPhone open with the Ocular App with the RFIDs and the EV Charger while it was not charging, but near The Car when …
the butler did it … no … at the Ocular App “My” tab …
… tapped “My Card” option …
tapped “Bind New Card” option
filled in a new Card Name
checked the Serial Number of the EV Charger serial number that appeared
tapped “Bind” option …
waved RFID card in front of front scanner (see image two down) … and the EV Charger beeped … and the app displayed “Success” … who’d have thought?!
and this is where security might happen if … back at “Group” tab “EV Charger of interest” tap screen unchecked Plug and Charge
… … meaning to charge you need to wave RFID card in front of front sensor …
… of EV charger
… and so it made sense to associate car fob with the RFID card as per …
If this was interesting you may be interested in this too.
Our Python Matplotlib More Involved Charts Tutorial‘s Python Matplotlib module accessing PHP web application is full of URLs featuring ? and & argumented parts via it’s use of an HTML form method=GET paradigm. As such, it is straightforward to add some …
email … or …
SMS
… based “a” link means to sharing user defined Python Matplotlib module based chart data with recipients …
… where, also, in the changedpie_chart_python.php PHP Python Matplotlib Chart Interfacing web application you can also try below, we decided textarea elements should replace those input type=text textboxes presented when the form has the device screen to itself. Those textarea elements have a great feature where their resizing talents are infectious when a few textarea elements are adjacent to each other!
… interesting in that the difference between the presentation of various chart types amounts to a couple of lines of Python code, in essence …
… assertion, and yes, as with today’s changes, some Python Matplotlib module chart type interfacings do only involve a couple of lines of code that change, and this amounts to today’s forward progress, but some other chart interfacings are more involved and we’ll be trying into the future … doh!
Today, we, in addition to Pie Chart and Bar Chart and Column Chart interfacing, are introducing Matplotlib module chart type interfacing to …
We doubt you’ll meet many programmers not interested in “peer to peer” software suite arrangements. Thinking about Python Matplotlib module, of course, “peer to peer” becomes interesting in that the difference between the presentation of various chart types amounts to a couple of lines of Python code, in essence.
With that in mind, we think to rewrite wholly fleshed out new code file pairs consisting of …
a Python code file specializing in creation of a display of a particular Matplotlib module chart type … supervised by a …
PHP supervising code file specializing in helping Python code file creation of a display of a particular Matplotlib module chart type
… for any one newly considered Matplotlib module chart type sounds like “too much hard work”. Why not add intelligence to that original Pie Chart code file pairing Python and PHP set and work off that? We came up with this idea, and it came to fruition.
And so, that is the long answer to yesterday’s question as to whether our …
strange idea
… would work?! The short answer …
Yes … the strange idea worked
… in the new workflow to getting up a new Matplotlib module chart type into the mix of our “peer to peer” web application software suite …
clone these two crontab records …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "plot_*.png" -mmin +122`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "output_image_*.png" -mmin +122`; do rm -f "$i"; done'
… to new ones, for the example of a Column Chart …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "columnchartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "columnchartpython_*.py"`; do rm -f "$i"; done'
and then … yay!!!! … the time saver … Linux web server command line soft links to the rescue again …
cd /home/rjmprogr/public_html/Python ln -s pie_chart_python.py bar_chart_python.py
ln -s pie_chart_python.php bar_chart_python.php
ln -s pie_chart_python.py column_chart_python.py
ln -s pie_chart_python.php column_chart_python.php
… to add onto the existant Matplotlib module Pie Chart coding, as of yesterday’s Python Matplotlib Pie Chart Labels Tutorial, interfacing now for Matplotlib module Bar Charts and Column Charts, where the logic for the new dropdown “peer to peer” links all happening via …
file naming conventions
… getting both Python and PHP to code differentiate chart types via what appears as the action URL/file name on the address bar/command line.
Feel free, as such, to try the Pie Chart++ (now public) web application you can also try below.
Do you cavye in?! Chortle, chortle. Well, our answer is …
Cater for lots of other chart types Python Matplotlib can help interface to.
… and we have a bit of a strange idea we want to try regarding this, while today’s second “not so strange” task preparatory work was to “abstract” the term “Pie Chart” and associated phrases out of being hardcodings to be a derivative of what URL is showing in the web browser address bar. Even if our “strange idea” disappoints, and we’ll let you know tomorrow, we think, we’d want to embark on this genericization anyway, the Earth being the distance away from Mars and Venus the way it is. As such …
further to local Apache/PHP web server, like MAMP, PHP understanding and supervising a Python Matplotlib module based Pie Chart web application … today …
extending that PHP meets Python theme on the public RJM Programming we involve …
updated PHP … to suit the use of …
crontab …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "plot_*.png" -mmin +122`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "output_image_*.png" -mmin +122`; do rm -f "$i"; done'
… means to run Python code where new arguments add image file folder and IP address personalization parts so that users do not stumble on other user Pie Chart specifications
… all still dealing with a minimalist Pie Chart we’ll add complexity to into the future with …
command line Pie Chart application … Python pie_chart_python.py (superceeding this) …
# pie_chart_python.py
# September - 2026
# RJM Programming
# Thanks to https://www.w3schools.com/python/default.asp
import os
import matplotlib
# Set backend to Agg before importing pyplot
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
#import plotly.express as px
from PIL import Image
nums = []
sofar = 0
if len(nums) <= 0:
while sofar < 100:
print(f"Enter your percentage value regarding a pie chart where so far {sofar} has already been allocated.")
anum = input()
nums.append(int(anum))
sofar += int(anum)
y = np.array(nums)
fig, ax = plt.subplots()
ax.pie(y)
fig.savefig("plot.png")
# 1. Load the image
img = mpimg.imread('plot.png')
# 2. Process or manipulate the image (Optional)
# For example, let's look at the shape or apply changes
#print(f"Image shape: {img.shape}")
# 3. Create the plot without displaying it
plt.imshow(img)
plt.axis('off') # Hide axis lines and labels
# 4. Save the result to a file instead of showing it
plt.savefig('output_image.png', bbox_inches='tight', pad_inches=0)
plt.close()
# Open the PNG image file
#with Image.open("plot.png") as img:
# Display the image using your system's default viewer
#img.show()
# Optional: Load the data into memory so you can safely close the file
#img.load()
exit()
… and …
working on our local Apache/PHP MAMP web server (only, so far, the reason being our public web server has no graphical $DISPLAY existant, and so the plt.show() Python codeline cannot be used, so we need to think more on integrations there) … PHP pie_chart_python.php …
<?php
// pie_chart_python.php
// RJM Programming - September, 2026
if (php_sapi_name() === 'cli') {
$command = '/usr/local/bin/python3 ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py'; // Your command
if (1 == 1) {
exec($command);
} else {
// Open the process pointer for reading
$handle = popen($command, 'r');
if ($handle) {
// Read and output the buffer until the end of the file
while (!feof($handle)) {
echo fread($handle, 2048);
flush(); // Send it to the browser immediately
}
pclose($handle);
}
}
exit;
} else if (strpos(str_replace('?','',$_SERVER['QUERY_STRING']), '&') === false) {
$waspy=file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.py');
if (strpos($waspy, "nums = []") !== false) {
if (isset($_GET['array'])) {
file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py', str_replace("nums = []","nums = [" . str_replace('+',' ',urldecode($_GET['array'])) . "]",$waspy));
}
}
//exec('php ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.php > /dev/null 2> /dev/null');
exec('cd ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . ' ; /Applications/MAMP/bin/php/php7.4.33/bin/php -n ./pie_chart_python.php > /dev/null 2> /dev/null ; open ./plot.png');
sleep(3);
}
echo "<html><body style=\"background:url(./plot.png);background-repeat:no-repeat;background-size:contain;\"></body></html>";
?>
… allowing a web browser address bar URL such as …
… interesting in that the difference between the presentation of various chart types amounts to a couple of lines of Python code, in essence …
… assertion, and yes, as with today’s changes, some Python Matplotlib module chart type interfacings do only involve a couple of lines of code that change, and this amounts to today’s forward progress, but some other chart interfacings are more involved and we’ll be trying into the future … doh!
Today, we, in addition to Pie Chart and Bar Chart and Column Chart interfacing, are introducing Matplotlib module chart type interfacing to …
We doubt you’ll meet many programmers not interested in “peer to peer” software suite arrangements. Thinking about Python Matplotlib module, of course, “peer to peer” becomes interesting in that the difference between the presentation of various chart types amounts to a couple of lines of Python code, in essence.
With that in mind, we think to rewrite wholly fleshed out new code file pairs consisting of …
a Python code file specializing in creation of a display of a particular Matplotlib module chart type … supervised by a …
PHP supervising code file specializing in helping Python code file creation of a display of a particular Matplotlib module chart type
… for any one newly considered Matplotlib module chart type sounds like “too much hard work”. Why not add intelligence to that original Pie Chart code file pairing Python and PHP set and work off that? We came up with this idea, and it came to fruition.
And so, that is the long answer to yesterday’s question as to whether our …
strange idea
… would work?! The short answer …
Yes … the strange idea worked
… in the new workflow to getting up a new Matplotlib module chart type into the mix of our “peer to peer” web application software suite …
clone these two crontab records …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "plot_*.png" -mmin +122`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "output_image_*.png" -mmin +122`; do rm -f "$i"; done'
… to new ones, for the example of a Column Chart …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "columnchartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "columnchartpython_*.py"`; do rm -f "$i"; done'
and then … yay!!!! … the time saver … Linux web server command line soft links to the rescue again …
cd /home/rjmprogr/public_html/Python ln -s pie_chart_python.py bar_chart_python.py
ln -s pie_chart_python.php bar_chart_python.php
ln -s pie_chart_python.py column_chart_python.py
ln -s pie_chart_python.php column_chart_python.php
… to add onto the existant Matplotlib module Pie Chart coding, as of yesterday’s Python Matplotlib Pie Chart Labels Tutorial, interfacing now for Matplotlib module Bar Charts and Column Charts, where the logic for the new dropdown “peer to peer” links all happening via …
file naming conventions
… getting both Python and PHP to code differentiate chart types via what appears as the action URL/file name on the address bar/command line.
Feel free, as such, to try the Pie Chart++ (now public) web application you can also try below.
Do you cavye in?! Chortle, chortle. Well, our answer is …
Cater for lots of other chart types Python Matplotlib can help interface to.
… and we have a bit of a strange idea we want to try regarding this, while today’s second “not so strange” task preparatory work was to “abstract” the term “Pie Chart” and associated phrases out of being hardcodings to be a derivative of what URL is showing in the web browser address bar. Even if our “strange idea” disappoints, and we’ll let you know tomorrow, we think, we’d want to embark on this genericization anyway, the Earth being the distance away from Mars and Venus the way it is. As such …
further to local Apache/PHP web server, like MAMP, PHP understanding and supervising a Python Matplotlib module based Pie Chart web application … today …
extending that PHP meets Python theme on the public RJM Programming we involve …
updated PHP … to suit the use of …
crontab …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "plot_*.png" -mmin +122`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "output_image_*.png" -mmin +122`; do rm -f "$i"; done'
… means to run Python code where new arguments add image file folder and IP address personalization parts so that users do not stumble on other user Pie Chart specifications
… all still dealing with a minimalist Pie Chart we’ll add complexity to into the future with …
command line Pie Chart application … Python pie_chart_python.py (superceeding this) …
# pie_chart_python.py
# September - 2026
# RJM Programming
# Thanks to https://www.w3schools.com/python/default.asp
import os
import matplotlib
# Set backend to Agg before importing pyplot
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
#import plotly.express as px
from PIL import Image
nums = []
sofar = 0
if len(nums) <= 0:
while sofar < 100:
print(f"Enter your percentage value regarding a pie chart where so far {sofar} has already been allocated.")
anum = input()
nums.append(int(anum))
sofar += int(anum)
y = np.array(nums)
fig, ax = plt.subplots()
ax.pie(y)
fig.savefig("plot.png")
# 1. Load the image
img = mpimg.imread('plot.png')
# 2. Process or manipulate the image (Optional)
# For example, let's look at the shape or apply changes
#print(f"Image shape: {img.shape}")
# 3. Create the plot without displaying it
plt.imshow(img)
plt.axis('off') # Hide axis lines and labels
# 4. Save the result to a file instead of showing it
plt.savefig('output_image.png', bbox_inches='tight', pad_inches=0)
plt.close()
# Open the PNG image file
#with Image.open("plot.png") as img:
# Display the image using your system's default viewer
#img.show()
# Optional: Load the data into memory so you can safely close the file
#img.load()
exit()
… and …
working on our local Apache/PHP MAMP web server (only, so far, the reason being our public web server has no graphical $DISPLAY existant, and so the plt.show() Python codeline cannot be used, so we need to think more on integrations there) … PHP pie_chart_python.php …
<?php
// pie_chart_python.php
// RJM Programming - September, 2026
if (php_sapi_name() === 'cli') {
$command = '/usr/local/bin/python3 ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py'; // Your command
if (1 == 1) {
exec($command);
} else {
// Open the process pointer for reading
$handle = popen($command, 'r');
if ($handle) {
// Read and output the buffer until the end of the file
while (!feof($handle)) {
echo fread($handle, 2048);
flush(); // Send it to the browser immediately
}
pclose($handle);
}
}
exit;
} else if (strpos(str_replace('?','',$_SERVER['QUERY_STRING']), '&') === false) {
$waspy=file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.py');
if (strpos($waspy, "nums = []") !== false) {
if (isset($_GET['array'])) {
file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py', str_replace("nums = []","nums = [" . str_replace('+',' ',urldecode($_GET['array'])) . "]",$waspy));
}
}
//exec('php ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.php > /dev/null 2> /dev/null');
exec('cd ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . ' ; /Applications/MAMP/bin/php/php7.4.33/bin/php -n ./pie_chart_python.php > /dev/null 2> /dev/null ; open ./plot.png');
sleep(3);
}
echo "<html><body style=\"background:url(./plot.png);background-repeat:no-repeat;background-size:contain;\"></body></html>";
?>
… allowing a web browser address bar URL such as …
… interesting in that the difference between the presentation of various chart types amounts to a couple of lines of Python code, in essence …
… assertion, and yes, as with today’s changes, some Python Matplotlib module chart type interfacings do only involve a couple of lines of code that change, and this amounts to today’s forward progress, but some other chart interfacings are more involved and we’ll be trying into the future … doh!
Today, we, in addition to Pie Chart and Bar Chart and Column Chart interfacing, are introducing Matplotlib module chart type interfacing to …
We doubt you’ll meet many programmers not interested in “peer to peer” software suite arrangements. Thinking about Python Matplotlib module, of course, “peer to peer” becomes interesting in that the difference between the presentation of various chart types amounts to a couple of lines of Python code, in essence.
With that in mind, we think to rewrite wholly fleshed out new code file pairs consisting of …
a Python code file specializing in creation of a display of a particular Matplotlib module chart type … supervised by a …
PHP supervising code file specializing in helping Python code file creation of a display of a particular Matplotlib module chart type
… for any one newly considered Matplotlib module chart type sounds like “too much hard work”. Why not add intelligence to that original Pie Chart code file pairing Python and PHP set and work off that? We came up with this idea, and it came to fruition.
And so, that is the long answer to yesterday’s question as to whether our …
strange idea
… would work?! The short answer …
Yes … the strange idea worked
… in the new workflow to getting up a new Matplotlib module chart type into the mix of our “peer to peer” web application software suite …
clone these two crontab records …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "plot_*.png" -mmin +122`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "output_image_*.png" -mmin +122`; do rm -f "$i"; done'
… to new ones, for the example of a Column Chart …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "columnchartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "columnchartpython_*.py"`; do rm -f "$i"; done'
and then … yay!!!! … the time saver … Linux web server command line soft links to the rescue again …
cd /home/rjmprogr/public_html/Python ln -s pie_chart_python.py bar_chart_python.py
ln -s pie_chart_python.php bar_chart_python.php
ln -s pie_chart_python.py column_chart_python.py
ln -s pie_chart_python.php column_chart_python.php
… to add onto the existant Matplotlib module Pie Chart coding, as of yesterday’s Python Matplotlib Pie Chart Labels Tutorial, interfacing now for Matplotlib module Bar Charts and Column Charts, where the logic for the new dropdown “peer to peer” links all happening via …
file naming conventions
… getting both Python and PHP to code differentiate chart types via what appears as the action URL/file name on the address bar/command line.
Feel free, as such, to try the Pie Chart++ (now public) web application you can also try below.
Do you cavye in?! Chortle, chortle. Well, our answer is …
Cater for lots of other chart types Python Matplotlib can help interface to.
… and we have a bit of a strange idea we want to try regarding this, while today’s second “not so strange” task preparatory work was to “abstract” the term “Pie Chart” and associated phrases out of being hardcodings to be a derivative of what URL is showing in the web browser address bar. Even if our “strange idea” disappoints, and we’ll let you know tomorrow, we think, we’d want to embark on this genericization anyway, the Earth being the distance away from Mars and Venus the way it is. As such …
further to local Apache/PHP web server, like MAMP, PHP understanding and supervising a Python Matplotlib module based Pie Chart web application … today …
extending that PHP meets Python theme on the public RJM Programming we involve …
updated PHP … to suit the use of …
crontab …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "plot_*.png" -mmin +122`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "output_image_*.png" -mmin +122`; do rm -f "$i"; done'
… means to run Python code where new arguments add image file folder and IP address personalization parts so that users do not stumble on other user Pie Chart specifications
… all still dealing with a minimalist Pie Chart we’ll add complexity to into the future with …
command line Pie Chart application … Python pie_chart_python.py (superceeding this) …
# pie_chart_python.py
# September - 2026
# RJM Programming
# Thanks to https://www.w3schools.com/python/default.asp
import os
import matplotlib
# Set backend to Agg before importing pyplot
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
#import plotly.express as px
from PIL import Image
nums = []
sofar = 0
if len(nums) <= 0:
while sofar < 100:
print(f"Enter your percentage value regarding a pie chart where so far {sofar} has already been allocated.")
anum = input()
nums.append(int(anum))
sofar += int(anum)
y = np.array(nums)
fig, ax = plt.subplots()
ax.pie(y)
fig.savefig("plot.png")
# 1. Load the image
img = mpimg.imread('plot.png')
# 2. Process or manipulate the image (Optional)
# For example, let's look at the shape or apply changes
#print(f"Image shape: {img.shape}")
# 3. Create the plot without displaying it
plt.imshow(img)
plt.axis('off') # Hide axis lines and labels
# 4. Save the result to a file instead of showing it
plt.savefig('output_image.png', bbox_inches='tight', pad_inches=0)
plt.close()
# Open the PNG image file
#with Image.open("plot.png") as img:
# Display the image using your system's default viewer
#img.show()
# Optional: Load the data into memory so you can safely close the file
#img.load()
exit()
… and …
working on our local Apache/PHP MAMP web server (only, so far, the reason being our public web server has no graphical $DISPLAY existant, and so the plt.show() Python codeline cannot be used, so we need to think more on integrations there) … PHP pie_chart_python.php …
<?php
// pie_chart_python.php
// RJM Programming - September, 2026
if (php_sapi_name() === 'cli') {
$command = '/usr/local/bin/python3 ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py'; // Your command
if (1 == 1) {
exec($command);
} else {
// Open the process pointer for reading
$handle = popen($command, 'r');
if ($handle) {
// Read and output the buffer until the end of the file
while (!feof($handle)) {
echo fread($handle, 2048);
flush(); // Send it to the browser immediately
}
pclose($handle);
}
}
exit;
} else if (strpos(str_replace('?','',$_SERVER['QUERY_STRING']), '&') === false) {
$waspy=file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.py');
if (strpos($waspy, "nums = []") !== false) {
if (isset($_GET['array'])) {
file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py', str_replace("nums = []","nums = [" . str_replace('+',' ',urldecode($_GET['array'])) . "]",$waspy));
}
}
//exec('php ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.php > /dev/null 2> /dev/null');
exec('cd ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . ' ; /Applications/MAMP/bin/php/php7.4.33/bin/php -n ./pie_chart_python.php > /dev/null 2> /dev/null ; open ./plot.png');
sleep(3);
}
echo "<html><body style=\"background:url(./plot.png);background-repeat:no-repeat;background-size:contain;\"></body></html>";
?>
… allowing a web browser address bar URL such as …
We doubt you’ll meet many programmers not interested in “peer to peer” software suite arrangements. Thinking about Python Matplotlib module, of course, “peer to peer” becomes interesting in that the difference between the presentation of various chart types amounts to a couple of lines of Python code, in essence.
With that in mind, we think to rewrite wholly fleshed out new code file pairs consisting of …
a Python code file specializing in creation of a display of a particular Matplotlib module chart type … supervised by a …
PHP supervising code file specializing in helping Python code file creation of a display of a particular Matplotlib module chart type
… for any one newly considered Matplotlib module chart type sounds like “too much hard work”. Why not add intelligence to that original Pie Chart code file pairing Python and PHP set and work off that? We came up with this idea, and it came to fruition.
And so, that is the long answer to yesterday’s question as to whether our …
strange idea
… would work?! The short answer …
Yes … the strange idea worked
… in the new workflow to getting up a new Matplotlib module chart type into the mix of our “peer to peer” web application software suite …
clone these two crontab records …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "plot_*.png" -mmin +122`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "output_image_*.png" -mmin +122`; do rm -f "$i"; done'
… to new ones, for the example of a Column Chart …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "columnchartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "columnchartpython_*.py"`; do rm -f "$i"; done'
and then … yay!!!! … the time saver … Linux web server command line soft links to the rescue again …
cd /home/rjmprogr/public_html/Python ln -s pie_chart_python.py bar_chart_python.py
ln -s pie_chart_python.php bar_chart_python.php
ln -s pie_chart_python.py column_chart_python.py
ln -s pie_chart_python.php column_chart_python.php
… to add onto the existant Matplotlib module Pie Chart coding, as of yesterday’s Python Matplotlib Pie Chart Labels Tutorial, interfacing now for Matplotlib module Bar Charts and Column Charts, where the logic for the new dropdown “peer to peer” links all happening via …
file naming conventions
… getting both Python and PHP to code differentiate chart types via what appears as the action URL/file name on the address bar/command line.
Feel free, as such, to try the Pie Chart++ (now public) web application you can also try below.
Do you cavye in?! Chortle, chortle. Well, our answer is …
Cater for lots of other chart types Python Matplotlib can help interface to.
… and we have a bit of a strange idea we want to try regarding this, while today’s second “not so strange” task preparatory work was to “abstract” the term “Pie Chart” and associated phrases out of being hardcodings to be a derivative of what URL is showing in the web browser address bar. Even if our “strange idea” disappoints, and we’ll let you know tomorrow, we think, we’d want to embark on this genericization anyway, the Earth being the distance away from Mars and Venus the way it is. As such …
further to local Apache/PHP web server, like MAMP, PHP understanding and supervising a Python Matplotlib module based Pie Chart web application … today …
extending that PHP meets Python theme on the public RJM Programming we involve …
updated PHP … to suit the use of …
crontab …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "plot_*.png" -mmin +122`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "output_image_*.png" -mmin +122`; do rm -f "$i"; done'
… means to run Python code where new arguments add image file folder and IP address personalization parts so that users do not stumble on other user Pie Chart specifications
… all still dealing with a minimalist Pie Chart we’ll add complexity to into the future with …
command line Pie Chart application … Python pie_chart_python.py (superceeding this) …
# pie_chart_python.py
# September - 2026
# RJM Programming
# Thanks to https://www.w3schools.com/python/default.asp
import os
import matplotlib
# Set backend to Agg before importing pyplot
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
#import plotly.express as px
from PIL import Image
nums = []
sofar = 0
if len(nums) <= 0:
while sofar < 100:
print(f"Enter your percentage value regarding a pie chart where so far {sofar} has already been allocated.")
anum = input()
nums.append(int(anum))
sofar += int(anum)
y = np.array(nums)
fig, ax = plt.subplots()
ax.pie(y)
fig.savefig("plot.png")
# 1. Load the image
img = mpimg.imread('plot.png')
# 2. Process or manipulate the image (Optional)
# For example, let's look at the shape or apply changes
#print(f"Image shape: {img.shape}")
# 3. Create the plot without displaying it
plt.imshow(img)
plt.axis('off') # Hide axis lines and labels
# 4. Save the result to a file instead of showing it
plt.savefig('output_image.png', bbox_inches='tight', pad_inches=0)
plt.close()
# Open the PNG image file
#with Image.open("plot.png") as img:
# Display the image using your system's default viewer
#img.show()
# Optional: Load the data into memory so you can safely close the file
#img.load()
exit()
… and …
working on our local Apache/PHP MAMP web server (only, so far, the reason being our public web server has no graphical $DISPLAY existant, and so the plt.show() Python codeline cannot be used, so we need to think more on integrations there) … PHP pie_chart_python.php …
<?php
// pie_chart_python.php
// RJM Programming - September, 2026
if (php_sapi_name() === 'cli') {
$command = '/usr/local/bin/python3 ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py'; // Your command
if (1 == 1) {
exec($command);
} else {
// Open the process pointer for reading
$handle = popen($command, 'r');
if ($handle) {
// Read and output the buffer until the end of the file
while (!feof($handle)) {
echo fread($handle, 2048);
flush(); // Send it to the browser immediately
}
pclose($handle);
}
}
exit;
} else if (strpos(str_replace('?','',$_SERVER['QUERY_STRING']), '&') === false) {
$waspy=file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.py');
if (strpos($waspy, "nums = []") !== false) {
if (isset($_GET['array'])) {
file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py', str_replace("nums = []","nums = [" . str_replace('+',' ',urldecode($_GET['array'])) . "]",$waspy));
}
}
//exec('php ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.php > /dev/null 2> /dev/null');
exec('cd ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . ' ; /Applications/MAMP/bin/php/php7.4.33/bin/php -n ./pie_chart_python.php > /dev/null 2> /dev/null ; open ./plot.png');
sleep(3);
}
echo "<html><body style=\"background:url(./plot.png);background-repeat:no-repeat;background-size:contain;\"></body></html>";
?>
… allowing a web browser address bar URL such as …
Do you cavye in?! Chortle, chortle. Well, our answer is …
Cater for lots of other chart types Python Matplotlib can help interface to.
… and we have a bit of a strange idea we want to try regarding this, while today’s second “not so strange” task preparatory work was to “abstract” the term “Pie Chart” and associated phrases out of being hardcodings to be a derivative of what URL is showing in the web browser address bar. Even if our “strange idea” disappoints, and we’ll let you know tomorrow, we think, we’d want to embark on this genericization anyway, the Earth being the distance away from Mars and Venus the way it is. As such …
further to local Apache/PHP web server, like MAMP, PHP understanding and supervising a Python Matplotlib module based Pie Chart web application … today …
extending that PHP meets Python theme on the public RJM Programming we involve …
updated PHP … to suit the use of …
crontab …
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do /usr/bin/python3 $i ${i##*/} /home/rjmprogr/public_html/Python/ ; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "piechartpython_*.py"`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "plot_*.png" -mmin +122`; do rm -f "$i"; done'
ksh -c 'for i in `find /home/rjmprogr/public_html/Python -name "output_image_*.png" -mmin +122`; do rm -f "$i"; done'
… means to run Python code where new arguments add image file folder and IP address personalization parts so that users do not stumble on other user Pie Chart specifications
… all still dealing with a minimalist Pie Chart we’ll add complexity to into the future with …
command line Pie Chart application … Python pie_chart_python.py (superceeding this) …
# pie_chart_python.py
# September - 2026
# RJM Programming
# Thanks to https://www.w3schools.com/python/default.asp
import os
import matplotlib
# Set backend to Agg before importing pyplot
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
#import plotly.express as px
from PIL import Image
nums = []
sofar = 0
if len(nums) <= 0:
while sofar < 100:
print(f"Enter your percentage value regarding a pie chart where so far {sofar} has already been allocated.")
anum = input()
nums.append(int(anum))
sofar += int(anum)
y = np.array(nums)
fig, ax = plt.subplots()
ax.pie(y)
fig.savefig("plot.png")
# 1. Load the image
img = mpimg.imread('plot.png')
# 2. Process or manipulate the image (Optional)
# For example, let's look at the shape or apply changes
#print(f"Image shape: {img.shape}")
# 3. Create the plot without displaying it
plt.imshow(img)
plt.axis('off') # Hide axis lines and labels
# 4. Save the result to a file instead of showing it
plt.savefig('output_image.png', bbox_inches='tight', pad_inches=0)
plt.close()
# Open the PNG image file
#with Image.open("plot.png") as img:
# Display the image using your system's default viewer
#img.show()
# Optional: Load the data into memory so you can safely close the file
#img.load()
exit()
… and …
working on our local Apache/PHP MAMP web server (only, so far, the reason being our public web server has no graphical $DISPLAY existant, and so the plt.show() Python codeline cannot be used, so we need to think more on integrations there) … PHP pie_chart_python.php …
<?php
// pie_chart_python.php
// RJM Programming - September, 2026
if (php_sapi_name() === 'cli') {
$command = '/usr/local/bin/python3 ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py'; // Your command
if (1 == 1) {
exec($command);
} else {
// Open the process pointer for reading
$handle = popen($command, 'r');
if ($handle) {
// Read and output the buffer until the end of the file
while (!feof($handle)) {
echo fread($handle, 2048);
flush(); // Send it to the browser immediately
}
pclose($handle);
}
}
exit;
} else if (strpos(str_replace('?','',$_SERVER['QUERY_STRING']), '&') === false) {
$waspy=file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.py');
if (strpos($waspy, "nums = []") !== false) {
if (isset($_GET['array'])) {
file_put_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'piechartpython.py', str_replace("nums = []","nums = [" . str_replace('+',' ',urldecode($_GET['array'])) . "]",$waspy));
}
}
//exec('php ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . 'pie_chart_python.php > /dev/null 2> /dev/null');
exec('cd ' . dirname(__FILE__) . DIRECTORY_SEPARATOR . ' ; /Applications/MAMP/bin/php/php7.4.33/bin/php -n ./pie_chart_python.php > /dev/null 2> /dev/null ; open ./plot.png');
sleep(3);
}
echo "<html><body style=\"background:url(./plot.png);background-repeat:no-repeat;background-size:contain;\"></body></html>";
?>
… allowing a web browser address bar URL such as …