#python3
Recently, I reached CS50's Week 6 which means python! Currently, working on the DNA problem(the code is hidden for the obvious reasons). There are times when I find indentations annoying. I really love the modules that the language contains.

I needed to remove all duplicates from ~/.bash_history, and since it contains the date and time for each command, I ended up with lots of dates and times with no commands (since they were duplicates and got removed).
And I didn't want to check 34k+ of lines manually. So, I wrote a Python script to solve that.
in case you're interested, here is the code: https://gitlab.com/ds.python/useful-scripts
#BASH #history #bashhistory #python #duplicates #duplicate #dedup #code #python3 #linux #gnulinux

Why does python3 on ubuntu doesn't come with pip? #packagemanagement #python3
Ubuntu Linux segfault when transferring files over SFTP #systemd #python3 #segmentationfault #glibc
ubuntu 23.04 python3 no module named ensurepip #python3
OPERBOT 200 released, see https://pypi.org/project/operbot
OPERBOT is a bot, intended to be programmable, with a client program to develop modules and a systemd version to run a 24/7 presence.
OPERBOT is a contribution back to society, placed in the Public Domain.

Música èpica a tot drap. #scripting #python3
Encountering "Fatal Python error: Segmentation fault" error in python script #2204 #python3 #segmentationfault
How fix errors repo #packagemanagement #launcher #repository #python3
Bé, ja tenim funcionant el bot @pixcat que us permet crear un compte en el servidor #Pixelfed a https://pix.mastodont.cat a tots els que en vulgueu un. 🎉
Només cal demanar-ho:
@pixcat registre
També he alliberat el seu codi:
https://git.mastodont.cat/spla/pixcat
El creador de Pixelfed, @dansup, m'ha ajudat dient-me com podia demanar el registre via #PHP (thank you!)
Pyhton version issues with 23.04 #python3 #2304
Syntax error in object.h file from python3.10-dev package #compiling #python3 #c++ #cmake #qtcreator
Novetat a #followers, ara deixa de seguir als usuaris que ja no et segueixen (va bé per mantenir el llistat de seguits al dia).
https://git.mastodont.cat/spla/followers/commit/45d795e947b3a3d92999a4e74e224b6534b7b8b5
Si l'usuari que ja no et segueix ja no existeix també t'ho diu.

Ubuntu 20 - Speech Recogntion - can't find pyAudio module #apt #2004 #sound #python3 #speechrecognition
Logical conundrum in automatically installing libraries #python3

Zum zweiten Mal seitdem ich die eigene DIY #Stromampel programmiert habe, funktioniert die "Energy Chart" Preis API fehlerhaft
Ich diverzifiziere meine Preis Quelle und wechsele die Quelle zu #Awattar API jede Stunde
Dafür habe ich ein zweites Programm geschrieben, und der Wechsel zw APIs findet im aktualisierten #Crontab statt



Weekend #python tip: keyword-only function arguments:
def do_it(what, *, now=False):
By using ✳️ you can no longer provide the value for "now" as a simple True/False like so:
do_it("chores", True)
You must call the function like this:
do_it("chores", now=True)
This makes code calling your function much more readable. Especially if you have lots of calls to do_it() in your code, some of which omit the "now" argument and others don't.

Ich hatte vergessen inwiefern Programmieren soviel Fummelarbeit beinhaltet
Jetzt stellte ich fest dass ich die Sommer-Winter Zeitverschiebung nicht berücksichtigt hatte
Fehler korrigiert

Speedtesting on a Raspberry Pi!
I have made a few improvements to the code I posted earlier. It now fails quietly when the speed test fails to provide a clean output.
I will be looking to let it pause and
try again on the first fail.
https://github.com/vwillcox/io-speedtest
#SpeedTest #RaspberryPi #VirginMedia #gig1 #Python #Python3 #github #foss
Today, I set myself a challenge of writing a new speed test Python script that publishes to the Adafruit IO Dashboard.
I wanted to get this done in under 5 hours!
Well-mission completed!!
https://github.com/vwillcox/io-speedtest
This uses the official speedtest.net client for Linux.
I have written an install script and a requirements file.
The API key was pulled into a secure file to ensure I don't share it!
https://io.adafruit.com/vwillcox/dashboards/speedtest
#speedtest #python3 #adafruit #adafruitIO #datalogging #challengeaccepted
I have created a Github repo for my MastoCloud Python script.

Nach vielen vielen Stunden in gemeinsam verbrachten Nachtsessions und immer weiteren Steigerungen ist mein erstes #python3 Projekt endlich fertig. Darf ich vorstellen?
#snake in #pixelflut 🐍🐍🐍
Mit freundlicher Unterstützung von @icet 😊



La última semana ha sido bastante productiva con #Python3 en 8 días he avanzado bastante, ahora a buscar poner en práctica los conocimientos
¿No existe el polimorfismo en #Python3 ?
It turns out, when you redirect stdout with the subprocess module, it doesn't give a shit, and happily writes coloring escape sequences to a file opened with "w" 🤷
#python #python3

📢 "Installing pyenv and managing Python versions in Ubuntu - From macOS to Ubuntu, Pt. 2"
New blog post!
https://thecesrom.dev/2023/03/10/installing-pyenv-and-managing-python-versions-in-ubuntu/
#python #python2 #python3 #macOS #linux #ubuntu #homebrew #linuxbrew #pyenv
While the world seems to have moved away from #Python2, I am still actively developing packages published on #PyPI, including some #Python3 #stubs packages.
The main challenges I've faced have been some of my "build" dependencies like #black, #pyflakes and #mypy dropping support for Python 2.
Always worrying about the future the next challenge we will face will be #github deprecating #ubuntu 20.04; as of now only 18.04 and 20.04 are the ones including Python 2.7, with 18.04 already deprecated.
Media posting through #Python3 accomplished. The trick was, of course, to set the scope for the application to include writing media files.
🧑💻 New learning unit in our #NetworkAutomation eAcademy: #Python!
Learn how to program using Python, why it is useful and how it can be used 👉 https://connect.geant.org/2023/02/27/new-learning-unit-in-the-network-eacademy-automation-tools-python
👤 Trainer: Iacovos Ioannou – CyNet
⏳ Course duration: 90 Minutes
PS you can also follow your self-paced OAV (#Orchestration, #Automation, #Virtualisation) training via our interactive map 🗺️ https://wiki.geant.org/display/NETDEV/OAV+Training+Portal
#pythonlearning #python3 #pythoncoding #OpenSource #Network #Research #Education #Networking #Training #learning
I made some algorithmically generated minimalist landscapes. Cool Perlin noise math and Python.
#GenerativeArt #Python3
TIP: Calculate the age of a file using Python’s os module
ZikTIPS #Python #pythonprogramming #Python3 #pythonlearning #pythoncode
Ebenso kannte ich zwar "#unittest", aber "#doctest" war neu für mich, und auf den ersten Blick sogar eleganter, da die Tests im jeweiligen #docstring definiert werden, damit sofort erkennbar sind und auch noch als Dokumentation herhalten können. #python3
Da ich nun seit einer Woche etwas ungeplant in der #Klinik festhänge, habe ich mir das unten verlinkte eBook gekauft.
Ich habe zwar schon einiges mit #Python (#Python3) gemacht, aber jetzt habe ich die Zeit, es systematischer anzugehen.
Dazu kam die #Android-App "Pydroid 3", mit der ich auf dem #Smartphone gleich einiges ausprobieren kann.
https://www.degruyter.com/document/doi/10.1515/9783110473650/html?lang=de
https://play.google.com/store/apps/details?id=ru.iiec.pydroid3
@dmnelson @scriptingosx Good thing you stuck to grep and awk as the years-long #macOS scriptocalypse rolls on: https://tidbits.com/2019/06/25/apple-to-deprecate-scripting-languages-in-future-versions-of-macos/
On life support:
😵 #Python3 (needs #Xcode Command Line Tools)
Dead pool (specifically called out for future deprecation):
😷 #Perl
😷 #Ruby
Just decided to do a little housekeeping on my #InkyImpression weather display code!
https://github.com/vwillcox/Inky-Impression-Weather-Station
Won't affect runtimes but is a bit easier to read the code.
#Python3 Cheat sheets ds-cheatsheets/mementopython3-english.pdf at master · FavioVazquez/ds-cheatsheets · GitHub https://github.com/FavioVazquez/ds-cheatsheets/blob/master/Python/Others/mementopython3-english.pdf
#python #python3.11.2 #python3.12.0a5
"Hi everyone,
I am happy to report that after solving some last-time problems, we have a bunch of fresh releases for you:
### Python 3.12.0 alpha 5
Check the new alpha of 3.12 with some Star Trek vibes:
https://www.python.org/downloads/release/python-3120a5/
210 new commits since 3.12.0a4 last month
### Python 3.11.2
A shipment of bug fixes and security releases for the newest Python!
https://www.python.org/downloads/release/python-3112/
194 new commits since 3.11.1
### Python 3.10.10
Your trusty Python3.10 just got more stable and secure!
https://www.python.org/downloads/release/python-31010/
131 new commits since 3.10.9
## We hope you enjoy the new releases!
Thanks to all of the many volunteers who help make Python Development and
these releases possible! Please consider supporting our efforts by
volunteering yourself or through organization contributions to the Python
Software Foundation.
Your friendly release team,
Ned Deily @nad
Steve Dower @steve.dower
Pablo Galindo Salgado @pablogsal
Łukasz Langa @ambv
Thomas Wouters @thomas
"
🐍 Never stop coding - python forever
#pythonprogramming #python #python3 #programminghumor #programming
Want to use my #Mastocloud script but do not know how?
Playing with creating my own masks for my #MastoCloud script in #python3.
Here is the #Mastodon Logo.

Installing #Python3 on a recent MacOS is quite a thing. You will need XCode, its command-line tools, and then fire up homebrew.
And if you, like me, do this to keep your text editor #lyx running, you might notice the strangeness of caring for open infrastructures. I just wanted to start writing a paper!
Un/stable #platforms, again.
This article helped quite a bit though: https://medium.com/front-end-weekly/how-to-install-the-latest-python-3-on-mac-with-no-issues-5db0045e1429
Good evening #hivemind. Best way to make #Python imports work for both #PyPI #package #builds and also when running as a #script? #python3 #pythonista #build #setuptools
Python GUI Development Using PySide6 and Qt
https://www.freecodecamp.org/news/python-gui-development-using-pyside6-and-qt/
Si la resposta del bot Xat necessitava tres tuts, el contingut del tercer sempre era "...".
He programat una nova Class que gestiona la longitud de la resposta, partint-la en tants tuts com calgui i desa cadascun en un array per a poder publicar-los correctament.
https://git.mastodont.cat/spla/xat/commit/663125fdf875fcc44e7be2c5b40c5790c610ab4c
Aquests son els canvis del codi de Xat que permeten generar imatges:
https://git.mastodont.cat/spla/xat/commit/e65290a78d09aebb0aa3714103e3b098102e251b
It took only a few days and he has now graduated to playing around with #python3!
I found a #jupyter app for #ipad which seems to work really well. He's mostly been self learning by tinkering (attaboy!), coming to me only when he can't figure out a bug or an error.
The other day I discovered him trying to install `!pip install opengl` on the ipad! He was severely disappointed when I told him that that's not going to work.
🐍 python quiz
Hello new python and non-python programmers, can you guess the output?
#python #programmers #developers #python3 #pythonprogramming #programming
Python quiz
What is the output?
A. 10
B. 2
C. Syntax error
D. 5
Python quiz
What is the output?
A. 5
B. 2
C. Syntax error
D. None
TIL - Just because your code works for you doesn't mean it will work for everyone. Coding is hard work. Coding for Open Source projects requires a lot of extra thought about how the end user will use your code and potentially break your code or wind up with unexpected outcomes from using your code in a way that was unintended.
Don't let this be a discouraging message though, because the success is worth the hard work.
Finally, take a moment to thank those open source developers for all their hard work!
Font editor progress: I rewrote the entire app architecture from scratch 😔. Now new tools simply need to implement a glib interface, and that's pretty much it. All of this is implemented in Rust, and #python3 API is possible without a lot of effort.
In this video I show two new tools I made very quickly, one that creates a quadrilateral out of 4 linear Bezier curves and one that approximates a circle with 4 cubic Bezier curves.
✨ Over 100+ Machine Learning projects solved & explained using Python
➡️ 66 Beginners level projects
➡️ 46 Advanced Level projects
https://thecleverprogrammer.com/2020/11/15/machine-learning-projects/
#MachineLearning #artificalintelligence #AI #python #python3 #pythonprogramming
Can Anyone Successfully Change My Dog’s Gender?
➡️ Python Dog class with read-only attributes
Python quiz:
What is the output of this code?
Python quiz
a. [1, 4]
[1, 4, 5]
b. [1, 4, 5]
[1, 4, 5]
c. [1, 4]
[1, 4]
#python #pythonprogramming
#pythontips #programmer #Python3 #pythonquiz
Python quiz
What is the result
A. Invalid syntax, should use 'if' for condition
B. [80,73,82,64]
C. [True, True, True, True, False]
D. [80]
📢 I updated the IDA, Ghidra, x64DBG & OllyDBG plugins and scripts repository to include the following OpenAI GPT plugins for reversing! 👇
🔶 DAILA: Decompiler Artificial Intelligence Language Assistant. Utilize OpenAI to improve decompilation experience in most modern decompilers.
🔶 Gepetto is a Python script which uses OpenAI's davinci-003 model to provide meaning to functions decompiled by IDA Pro.
🔶 VulChatGPT is an IDA PRO plugin to help finding vulnerabilities in binaries.
🔶 GptHidra is a Ghidra plugin that uses the OpenAI Chat GPT to explain functions.
👇 Check out the plugins on my Github! #infosec #ReverseEngineering #malware #cybersecurity #vulnerability #python3
https://github.com/fr0gger/awesome-ida-x64-olly-plugin/blob/master/README.md
🐍 Python quiz
What is the language that never gets printed ?
A. Golang
B. Java
C. Python
D. Python and JavaScript
E. Java and JavaScript
🐍 vs ☕
Difference between Java and Python
#java #python #python3 #programming #developers #ProgrammersLife #programminghumor
🤖 OpenAI Cookbook -Examples and guides for using the OpenAI API
▶️ Shares example code and example prompts for accomplishing common tasks with the OpenAI API
https://github.com/openai/openai-cookbook
#openai #chatgpt #ArtificialIntelligence
#NLP #MachineLearning #python #python3
A free open source book: Modern Polars.
This is a side-by-side comparison of the Polars and Pandas dataframe libraries, based on Modern Pandas by Tom Augsburger.
https://kevinheavey.github.io/modern-polars/
#opensource #pythonprogramming #python #pandas #polars #books #python3
Understanding Two-Point Perspective Drawing using Python by @s_gruppetta_ct
https://thepythoncodingbook.com/2022/04/10/understanding-two-point-perspective-drawing-using-python/
Python quiz time
What is the result?
A.
0 Sunday
1 Monday
2 None
3 None
4 None
5 None
6 None
B.
0 Sunday
1 Monday
C.
1 Sunday
2 Monday
3 None
4 None
5 None
6 None
7 None
D.
Gives error since list size mismatched
🚀 Fastapi new version feature:
Response Model - Return Type
That's awesome 😎
▶️ You can declare the type used for the response by annotating the path operation function return type
▶️ You can use type annotations the same way you would for input data in function parameters, you can use Pydantic models, lists, dictionaries, scalar values like integers, booleans, etc.
https://fastapi.tiangolo.com/tutorial/response-model/
Via @FastAPI #fastapi #python #python3 #restapi #programming #development
🐍 "else" statement can be used in both for loops and while loops also
How does it work?
▶️ Executed only if the loop completes normally
▶️ If the loop is terminated by a "break" statement,"else" block won't be executed
Example syntax:
####
for i in range(10):
print(i)
else:
print("for loop ended without break ")
####
This will print 0 to 9 then prints the "for loop ended without break"
--
▶️ In this code snippet(of the image), we generate random number(n) between 1 to 10.
▶️ We loop through the list
▶️ If the "n" matches with the list's index,it will "break" the loop. In that case it won't execute else
▶️ If the 'n' didn't match with any index,it will execute "else"
🐍 A high-performance, zero-overhead, extensible Python compiler using LLVM
▶️ Compiles Python code to native machine code
▶️ Typical speedups over Python are on the order of 10-100x or more, on a single thread
So I put together a list of examples for python format specifiers with f-strings, you can check them out in the three pics below
Python 3.11 improvement:
This is a graph of CPU utilization for the web services that power #PyPI.
▶️ They upgraded from python 3.10 to 3.11
▶️ a significant and correlated drop in CPU usage
@plone Special thanks to #plone community members:
* @sneridagh, the leader of the #react frontend initiative.
* @thet, who did a lot of heavy lifting on the Classic UI
* @pbauer, who steered this project towards #Python3 land.
* @rikupekka, Marketing leader and the brain behind the new https://plone.org
* @stevepiercy, our documentation overlord
@jimdonegan Wow! Python 4! Should I be full of joy or fear? Or, maybe overflown with both? 🤣
⚠️ #typosquatting packages published to #pypi this morning.
- ulrlib3
- btoocore
- typing-extnesions
These #malware #python packages send host information to remote machine.