User Tools

Site Tools


python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
python [2026/03/12 01:50] – [Testing for odd] donaldpython [2026/04/28 16:34] (current) – [error: externally-managed-environment] donald
Line 1: Line 1:
 ====== Python ====== ====== Python ======
 +
 +===== create window usb install =====
 +
 +=== Using WoeUSB-NG (Recommended GUI) ===
 +<code>
 +sudo apt update
 +sudo apt install git p7zip-full python3-pip python3-wxgtk4.0
 +
 +sudo pip3 install WoeUSB-ng --break-system-packages
 +</code>
 +
 +Run woeusb from the application menu
 +
 +===== error: externally-managed-environment =====
 +
 +<code>
 +pip install <package-name> --break-system-packages
 +</code>
  
 ===== Testing for odd ===== ===== Testing for odd =====
Line 8: Line 26:
     print(f"{num} is odd.")     print(f"{num} is odd.")
 </code> </code>
 +
 +===== Lists =====
 +
 +  * Lists are Python's version of arrays.
 +  * They are mutable and zero based indexed.
 +  * list = ['tom', 'dick', 'harry']
 +  * if 'tom' in list returns true
  
 ===== Importing code ===== ===== Importing code =====
  
-from //machine import PIN// means get the PIN class from the file machine +  * from //machine import PIN// means get the PIN class from the file machine 
-from //ir_rx.nex import nec_8// means get the NEC_8 class from the file nec in the directory ir_rx+  from //ir_rx.nec import nec_8// means get the NEC_8 class from the file nec in the directory ir_rx 
 + 
 +===== Range ===== 
 + 
 +  * Range is start, stop, step to generate a range of numbers 
 +<code> 
 +# print 0 - 4 
 +for i in range(5): 
 +    print(i) 
 +</code> 
 + 
  
          
python.1773280256.txt.gz · Last modified: 2026/03/12 01:50 by donald