diff --git a/bigos/lecture20241203a/Directions.txt b/bigos/lecture20241203a/Directions.txt new file mode 100644 index 0000000..7b26248 --- /dev/null +++ b/bigos/lecture20241203a/Directions.txt @@ -0,0 +1,87 @@ + +How to Create a Virtual Environment +=================================== + +Mac OS X & Linux +---------------- + +python3 -m venv venv + +Windows (Anaconda Prompt) +-------------------------- + +python -m venv venv + + + +How to Activate the Virtual Environment +=================================== + +Mac OS X & Linux +---------------- + +deactivate + +Windows (Anaconda Prompt) +-------------------------- + +deactivate + + +Sample Dialogs +=============== + +Windows (Anaconda Prompt) +-------------------------- + + +(base) C:\Users\edbigos>mkdir project01 +A subdirectory or file project01 already exists. + +(base) C:\Users\edbigos>cd project01 + +(base) C:\Users\edbigos\project01>python -m venv venv + +(base) C:\Users\edbigos\project01>venv\Scripts\activate + +(venv) (base) C:\Users\edbigos\project01>pip freeze + +(venv) (base) C:\Users\edbigos\project01>python --version +Python 3.11.5 + +(venv) (base) C:\Users\edbigos\project01>which python +'which' is not recognized as an internal or external command, +operable program or batch file. + +(venv) (base) C:\Users\edbigos\project01>pip install segno +Collecting segno + Obtaining dependency information for segno from https://files.pythonhosted.org/packages/27/7c/abc460494640767edfce9c920da3e03df22327fc5e3d51c7857f50fd89c4/segno-1.6.1-py3-none-any.whl.metadata + Downloading segno-1.6.1-py3-none-any.whl.metadata (7.9 kB) +Downloading segno-1.6.1-py3-none-any.whl (73 kB) + ---------------------------------------- 73.9/73.9 kB 677.5 kB/s eta 0:00:00 +Installing collected packages: segno +Successfully installed segno-1.6.1 + +[notice] A new release of pip is available: 23.2.1 -> 24.3.1 +[notice] To update, run: python.exe -m pip install --upgrade pip + +(venv) (base) C:\Users\edbigos\project01> + + +(venv) (base) C:\Users\edbigos\project01>pip freeze +segno==1.6.1 + +(venv) (base) C:\Users\edbigos\project01>deactivate +(base) C:\Users\edbigos\project01> + + + + + + + + +Mac OS X & Linux +---------------- + + diff --git a/bigos/lecture20241203a/requirements.txt b/bigos/lecture20241203a/requirements.txt new file mode 100644 index 0000000..9f4641f --- /dev/null +++ b/bigos/lecture20241203a/requirements.txt @@ -0,0 +1,9 @@ +barcode==1.0.4 +Levenshtein==0.26.1 +pillow==11.0.0 +pypng==0.20220715.0 +PyQRCode==1.2.1 +python-barcode==0.15.1 +python-Levenshtein==0.26.1 +RapidFuzz==3.10.1 +segno==1.6.1 diff --git a/bigos/lecture20241210/Img.py b/bigos/lecture20241210/Img.py new file mode 100644 index 0000000..021c335 --- /dev/null +++ b/bigos/lecture20241210/Img.py @@ -0,0 +1,6 @@ +# https://dzone.com/articles/display-and-convert-images-in-python + +from PIL import Image +image = Image.open('image.jpg') +image.show() + diff --git a/bigos/lecture20241210/Img2.py b/bigos/lecture20241210/Img2.py new file mode 100644 index 0000000..96e80d2 --- /dev/null +++ b/bigos/lecture20241210/Img2.py @@ -0,0 +1,15 @@ +# https://dzone.com/articles/display-and-convert-images-in-python + +from PIL import Image + +image = Image.open('ani.gif') + +print("Filename: ", image.filename) +print("Format: ", image.format) +print("Mode: ", image.mode) +print("Size: ", image.size) +print("Width: ", image.width) +print("Height: ", image.height) +print("Is Animated: ", (getattr(image, "is_animated", False))) + +image.close() # close image file diff --git a/bigos/lecture20241210/Img3.py b/bigos/lecture20241210/Img3.py new file mode 100644 index 0000000..994a03d --- /dev/null +++ b/bigos/lecture20241210/Img3.py @@ -0,0 +1,8 @@ +# https://dzone.com/articles/display-and-convert-images-in-python + + +from PIL import Image + +image = Image.open('image.jpg') +image.save("NewImage.gif") + diff --git a/bigos/lecture20241210/MyQRCode2.png b/bigos/lecture20241210/MyQRCode2.png new file mode 100644 index 0000000..b38988f Binary files /dev/null and b/bigos/lecture20241210/MyQRCode2.png differ diff --git a/bigos/lecture20241210/NewImage.gif b/bigos/lecture20241210/NewImage.gif new file mode 100644 index 0000000..2c3f3cc Binary files /dev/null and b/bigos/lecture20241210/NewImage.gif differ diff --git a/bigos/lecture20241210/WinterCarnivalChinooks1922.jpg b/bigos/lecture20241210/WinterCarnivalChinooks1922.jpg new file mode 100644 index 0000000..bb2788a Binary files /dev/null and b/bigos/lecture20241210/WinterCarnivalChinooks1922.jpg differ diff --git a/bigos/lecture20241210/ani.gif b/bigos/lecture20241210/ani.gif new file mode 100644 index 0000000..32a7595 Binary files /dev/null and b/bigos/lecture20241210/ani.gif differ diff --git a/bigos/lecture20241210/image.jpg b/bigos/lecture20241210/image.jpg new file mode 100644 index 0000000..bb2788a Binary files /dev/null and b/bigos/lecture20241210/image.jpg differ diff --git a/bigos/lecture20241210/qrcode1.py b/bigos/lecture20241210/qrcode1.py new file mode 100644 index 0000000..b5514e0 --- /dev/null +++ b/bigos/lecture20241210/qrcode1.py @@ -0,0 +1,16 @@ +# https://reeganalward.com/fully-customizable-qr-codes-in-python-7eb8a7c3b0da + +import qrcode +img = qrcode.make(''' +BEGIN:VCALENDAR +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:Lunchtime meeting +DTSTART;TZID=America/New_York:20230420T120000 +DURATION:PT1H +LOCATION:Meeting Room 1 +END:VEVENT +END:VCALENDAR +''') +type(img) +img.save("vcal.png") \ No newline at end of file diff --git a/bigos/lecture20241210/qrcode2.py b/bigos/lecture20241210/qrcode2.py new file mode 100644 index 0000000..4a7675c --- /dev/null +++ b/bigos/lecture20241210/qrcode2.py @@ -0,0 +1,32 @@ +# https://reeganalward.com/fully-customizable-qr-codes-in-python-7eb8a7c3b0da +# https://www.geeksforgeeks.org/generate-qr-code-using-qrcode-in-python/ + +# Importing library +import qrcode + +# Data to encode +data = ''' +BEGIN:VCALENDAR +VERSION:2.0 +BEGIN:VEVENT +SUMMARY:Lunchtime meeting +DTSTART;TZID=America/New_York:20230420T120000 +DURATION:PT1H +LOCATION:Meeting Room 1 +END:VEVENT +END:VCALENDAR +''' + +# Creating an instance of QRCode class +qr = qrcode.QRCode(version = 1, + box_size = 10, + border = 5) + +# Adding data to the instance 'qr' +qr.add_data(data) + +qr.make(fit = True) +img = qr.make_image(fill_color = 'blue', + back_color = 'white') + +img.save('MyQRCode2.png') diff --git a/bigos/lecture20241210/requirements.txt b/bigos/lecture20241210/requirements.txt new file mode 100644 index 0000000..b0eabab --- /dev/null +++ b/bigos/lecture20241210/requirements.txt @@ -0,0 +1,2 @@ +pillow==11.0.0 +qrcode==8.0 diff --git a/bigos/lecture20241210/vcal.png b/bigos/lecture20241210/vcal.png new file mode 100644 index 0000000..bc5dbe4 Binary files /dev/null and b/bigos/lecture20241210/vcal.png differ