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 …
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 …
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 …