<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Modules &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:Modules</link>
    <description>Personal Blog</description>
    <pubDate>Tue, 05 May 2026 16:29:11 +0000</pubDate>
    <item>
      <title>Code Club - Trinket and python Modules</title>
      <link>https://personaljournal.ca/paulsutton/code-club-trinket-and-python-modules</link>
      <description>&lt;![CDATA[Code Club - Trinket and python Modules&#xA;&#xA;Trinket allows you to use a number of different modules to add functionality to your programs.&#xA;&#xA;Code Club have added a py5 module for their own projects.  So this post will examine how to add one of the available libraries to your program.&#xA;&#xA;Firstly a list of the modules that Trinket.io provides can be found here. along with some documentation for each.&#xA;&#xA;builtins&#xA;math&#xA;matplotlib.pyplot&#xA;numpy&#xA;operator&#xA;processing&#xA;random&#xA;string&#xA;time&#xA;turtle&#xA;pygal&#xA;re&#xA;urllib.request&#xA;&#xA;So to add a module we need to use the import command.  &#xA;&#xA;Start with a blank new Python 3 project  and enter the following&#xA;&#xA;#!/usr/bin/env python3 #use python 3&#xA;Then the instruction to import the required module.&#xA;import numpy&#xA;&#xA;Now test if you don&#39;t get errors proceed to add&#xA;&#xA;from numpy import *&#xA;And test again. &#xA;&#xA;iframe src=&#34;https://trinket.io/embed/python3/5e0497e6e3?runOption=run&#34; width=&#34;100%&#34; height=&#34;356&#34; frameborder=&#34;0&#34; marginwidth=&#34;0&#34; marginheight=&#34;0&#34; allowfullscreen/iframe&#xA;&#xA;Should give no errors, in which case you can now start to use module numpy&#xA;&#xA;Other info&#xA;&#xA;You can use modules such as Numpy and matplotlib in software such as Jupyter Notebook&#xA;&#xA;Tags&#xA;&#xA;#Python,#Trinket,#Modules,#HowTo,#CodeClub&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Code Club – Trinket and python Modules</p>

<p>Trinket allows you to use a number of different modules to add functionality to your programs.</p>

<p>Code Club have added a py5 module for their own projects.  So this post will examine how to add one of the available libraries to your program.</p>

<p>Firstly a list of the modules that Trinket.io provides can be <a href="https://trinket.io/docs/python" rel="nofollow">found here</a>. along with some documentation for each.</p>
<ul><li>builtins</li>
<li><a href="https://docs.python.org/3/library/math.html" rel="nofollow">math</a></li>
<li><a href="https://matplotlib.org/stable/tutorials/introductory/pyplot.html" rel="nofollow">matplotlib.pyplot</a></li>
<li><a href="https://numpy.org/" rel="nofollow">numpy</a></li>
<li><a href="https://docs.python.org/3/library/operator.html" rel="nofollow">operator</a></li>
<li><a href="https://py.processing.org/" rel="nofollow">processing</a></li>
<li><a href="https://docs.python.org/3/library/random.htm" rel="nofollow">random</a></li>
<li><a href="https://docs.python.org/3/library/string.html" rel="nofollow">string</a></li>
<li><a href="https://docs.python.org/3/library/time.html" rel="nofollow">time</a></li>
<li><a href="https://docs.python.org/3/library/turtle.html" rel="nofollow">turtle</a></li>
<li>pygal</li>
<li>re</li>
<li>urllib.request</li></ul>

<p>So to add a module we need to use the import command.</p>

<p>Start with a blank new <em>Python 3</em> project  and enter the following</p>

<pre><code>#!/usr/bin/env python3 #use python 3
</code></pre>

<p>Then the instruction to import the required module.</p>

<pre><code>import numpy
</code></pre>

<p>Now test if you don&#39;t get errors proceed to add</p>

<pre><code>from numpy import *
</code></pre>

<p>And test again.</p>

<iframe src="https://trinket.io/embed/python3/5e0497e6e3?runOption=run" height="356" frameborder="0" allowfullscreen=""></iframe>

<p>Should give no errors, in which case you can now start to use module numpy</p>

<p><strong>Other info</strong></p>

<p>You can use modules such as Numpy and matplotlib in software such as <a href="https://jupyter.org/" rel="nofollow">Jupyter Notebook</a></p>

<p><strong>Tags</strong></p>

<p><a href="/paulsutton/tag:Python" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Python</span></a>,<a href="/paulsutton/tag:Trinket" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Trinket</span></a>,<a href="/paulsutton/tag:Modules" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Modules</span></a>,<a href="/paulsutton/tag:HowTo" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">HowTo</span></a>,<a href="/paulsutton/tag:CodeClub" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">CodeClub</span></a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/code-club-trinket-and-python-modules</guid>
      <pubDate>Sun, 04 Jun 2023 06:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>