Logo

dev-resources.site

for different kinds of informations.

My Experience doing fun ( stupid ? ) stuff with Python

Published at
12/6/2019
Categories
python
learnings
tutorial
telegram
Author
thewritingdev
Author
13 person written this
thewritingdev
open
My Experience doing fun ( stupid ? ) stuff with Python

My Experience doing fun ( stupid ? ) stuff with Python & JS - Part I

Subtitle : How I learned to love Rust & Clojure

So, the last fortnight was nice. I tried to implement a bunch of stuff in Python & JS, and in the process, learned a few important things about both languages. I'll list below what I tried and what I learned :

Part Une : Python

https://www.pyinstaller.org/_images/pyinstaller-draft2b-windowed.png

So Telegram had a Data Clustering contest going on : https://contest.com/docs/data_clustering , where users were supposed to create binaries for a CLI-based app, which would perform a set of operations akin to Data Science on a certain dataset.

They recommended using C/C++, since performance was a factor. However, I chose Python, thinking 'since Python was already popular in Data Science applications, why not choose that ?'. Following this train of thought, I was not wrong, burning through the various operations was a breeze in Python. However, the part where I would get stuck is in building the binaries ( a very essential step here ).

I tried using PyInstaller, but try as I may, the library wouldn't make my binary run at all. I would keep running into some weird import issues ( hidden imports ). The solutions I tried were :

  1. Add hidden imports from CLI. But, multiple hidden imports couldn't be added this way.
  2. Create a spec file and write my hiddenimports there. PyInstaller kept overwriting my spec file.
  3. Add hidden imports using a hook. PyInstaller refused to detect my hook.
  4. Import hidden imports directly. This solution worked but my whatthelang import broke. I gave up at this point.

You can follow my past adventures here : https://github.com/akash-joshi/telegram-cluster

Conclusion Une : Don't F*ck with Python ( when you want to build binaries )

A naive conclusion I draw from this is not to use Python when I want to form binaries. I looked at C/C++ but they don't have functional conveniences like the map & reduce combinator, which I'm a huge fan of : https://www.youtube.com/watch?v=uM--v7XS5IY

Rust does support these functional concepts, so that is a lang which I would probably choose in the future, in case a contest with a binaries requirement pops up.

However, pkg is something I want to experiment with too.

learnings Article's
26 articles in total
Favicon
Microsoft OpenAI: Errors I Learned
Favicon
[HttpServer series] Will it support the Performance, and Scale ?
Favicon
[HttpServer Series] Frameworks, Annotations, and SpringBoot
Favicon
[HttpServer Series] Who uses Java anymore ?
Favicon
Transcribe Now - : Unlocking Cross-Cultural Language Understanding
Favicon
Real-Life Problem Solving: Lessons from My Engineering Principles
Favicon
Recent Learnings
Favicon
9 Learnings from a fast-growing startup
Favicon
10 Things That I Learned in 2022
Favicon
🎯 SaaS dev challenges - #02 - 🗝 ️Authentication
Favicon
🎯 SaaS dev challenges - #01 - 🎨 UI/UX & design system
Favicon
Simple Rock Paper Scissors game build using JuliaLang
Favicon
Learnings from daily dev job - Part 1
Favicon
Everything I learned at the first job I had as a developer
Favicon
How To Optimize for Change
Favicon
Why being a Codeslinger makes you worse than you think
Favicon
geek week local
Favicon
Are libraries/frameworks an overkill?
Favicon
Managing projects for software developers
Favicon
Learnings from my last assignment
Favicon
My Experience doing fun ( stupid ? ) stuff with Python
Favicon
Gzip Compression for Beginners
Favicon
Managers are wiser than average and subordinates are dumber?!
Favicon
Making and taking babysteps
Favicon
🔥 One year of my professional career and things I learned which might help you 🙏
Favicon
How I'm Managing Work-Life Balance

Featured ones: