spica.wrk.ru

Search

Items tagged with: python

#programming feeling ashamed of my resistance to losing curly braces. doing #python in #vim last night was actually very enjoyable.

They need to fix their python2 vs python3 bullshit before I jump on board.
 
I am sorry to say, but every time I get in contact with #Python, it can't but think "How ugly is that!" Any suggestion for an article or video to change my mind?
 
Holy crap y'all #python generators are seriously mind blowingly cool. It's like a black box that you can make create infinite sequences of just about anything you can compute. Fibonacci numbers, random numbers, primes, birthdays of famous anarchists, whatever :) And for the folks who use it it's like:

for fib in fibonacci_sequence:
print(f"The next fibonacci number in sequence is: {fib}")

How freaking cool is that?
 
Pondering writing a dependency injection library in #Python, just for the sake of learning setuptools and maybe using it in one of my projects...
 
I don't claim this to be any sort of High Wisdom, but these rules have been working for me quite well through my #Python encounters of some years:

- If achieving 100% test coverage seems hard, then your code is probably too complicated and you should simplify it;
- If you feel an IDE makes you more productive, your code is probably too complicated and you should simplify it;
- If you feel types help you orient in your code, it's probably too complicated and you should simplify it.
 
Just published a #Python implementation of @WAHa_06x36 s blurhash algorithm to PyPi so you, too, can create or decode the neat blurred preview images that are part of Mastodon 2.8.2:

https://github.com/halcy/blurhash-python

Tomorrow, Mastodon.py will get an update that'll include this plus some convenience stuff and bug fixes, too. 🐍
Изображение / Фото
Изображение / Фото
 
If there are any Python developers that feel like answering a housekeeping question related to breaking apart multiple classes in one file have I got the question for you:

https://www.reddit.com/r/learnpython/comments/bj96n3/best_practices_for_splitting_up_a_file_with_many/

#python #reddit
 
Out of curiosity: what is the 2019 way of deploying a web application programmed in #Python? Just remembered that it was a real pain several years ago. 🧐
 
What do you think about the #poetry packaging and project management tool for #python ? I am starting a project in Python 3, and I just installed poetry b/c looks like it really helps with all the tasks when maintaining a Python program. But I couldn't find much critique of it, so that's what I'm wondering, if anybody here has any experience and/or comments.
 
Hello everyone !

📢 🔴 URGENT 🔴

An awesome software is dying, because its #developper has not time anymore to care of it.

It's an alternative of Adobe AfterEffect : Natron (https://natrongithub.github.io/)

Please, can Mastodon community search for a C++ dev, which want to maintain it ? or search for a company which work with free software ? It's very important.

Boost very appreciated

Thanks in advance for your contribution !

#Dev #Mastodon #C++ #Python
 
🐍🦀🕸 Python + WebAssembly, https://github.com/wasmerio/python-ext-wasm

🎉 I'm happy to announce a new Python extension to run WebAssembly binaries 🎉!

It works. It's a beta. Have fun.

• Instantiate a module ✅
• Call a function ✅
• Read/write the memory ✅

#python #webassembly #rustlang
Изображение / Фото
 
BTW, I'm teaching #WebScrapping in a #DataAnalysis course. I'm using #Python as a tool because the students had some python classes during the course, given by another teacher.

I proposed some exercises and I saw they iterate in lists like this:

``` python
for i in range( len( list ) ):
list

[i]```

#FacePalm
#WTF

What kind of python teacher did they have?
 
Man oh man, is it nice to find Python source that actually looks like it's written by a programmer that doesn't hate people. #python
 
I'm amused by that in #Python `test_list[0:0]` returns an empty list but `test_list[0]` returns the first item in the list, which is also returned by `test_list[0:1]`.

I've only realized that this is how it works after doing a bunch of mental gymnastics to understand why it's working this way, as I expected it to work differently.
 
"When we started working on Breezy, it was mostly as a way to keep Bazaar working going forward - in a world where #Python 2 has mostly disappeared in favour of Python 3)." #breezy #debian #gnu #linux
 
I have a question about #Python, code readability, and #SecureProgramming. I'm planning to do a blog post about this, but I would like to have some numbers about the community (and comments if you have some).

If you have a Twitter account, I would appreciate if you could vote there. https://twitter.com/X_Cli_Public/status/1108842982680219649

I wish Mastodon had the poll feature so I could create it here instead.
 
I am thinking about switching from #PyQt to #Kivy. to have no license-fees or such. Apart from this - is this a good or a bad idea?
Anyone with an opinion? #python
 
this #Python logging thing seems way too complicated, I just want:
1. formatted log messages
2. limiting logging level
3. not getting debug messages from #IPython when I'm in the REPL
 
My "senior curse" with #python questions on the Internet is, I want to answer most of them with "you're having this problem because your entire approach is wrong and will only lead to more problems, so you should rewrite everything". Which is of course not useful, so I simply don't say anything.

The sad truth about newbie questions is that they're asked in a short form without context in anticipation that it's a common problem with a definitive solution. And most things in software aren't.
 
more #MyPy things I'm finding out:
works:
@dataclass
class ServerState:
from socket import socket as Socket
sock: Socket
clients: List

[Socket]does not work:
import socket
@dataclass
class ServerState:
sock: socket.socket
clients: List[socket.socket]

#Python
 
Started to see a lot of #Python code out there painstakingly muddied with type annotations. I guess this battle is lost by now, and we now have to wait 10 years until the next generation of programmers suddenly realizes all of this cargo-culting is just another shiny toy that doesn't add any value. Like OOP.
 
#Python stdlib gems: collections.Counter http://softwaremaniacs.org/blog/2019/03/09/collections-counter/en/

I tried to orient it towards Python beginners, so if you consider yourself to be one, please tell me if it's too complicated or on point!
 
#Python is nice for doing #Selenium stuff but otherwise I'm really missing some more modern things from it
it has a pretty good repl and lots of libraries and that's it
 
@tapaniraja good luck with that! As far as I noticed, Fediverse has a lot of #Python folks around.
 
Probably the best way to start coding is learn the basics and start working your own programs. You learn so much when you have a project you're actually interested in.

#code #programming #python
 
Do you use Git for local projects?

I haven't and starting to think I should, especially when I start building more "real" projects other than just random 100 line scripts.

#git #programming #github #python #code #coding
 
#Python developers: what autoformatting do you use (and why)?
 
One day, I will know whether I need #Python strftime() or strptime() without requiring an Internet connection.
Today is not that day.
 
After actively working with #Kotlin I begin to realize why people might *like* static type checking… Because in a language where everything is drowned in custom classes writing good tests is *so* laborious (dependency injections, mocking, etc.) that type checking really looks like a more viable alternative.

In #Python I had no problem writing real tests for the actual program logic with 100% coverage. But here it's hardly worth it. Let's just pretend "if it compiles, it works"?
 
Very interesting interview with @gvanrossum about life, the universe and everything
Artificial Intelligence MIT: Guido van Rossum: Python https://lexfridman.com/guido-van-rossum/ #ai #python #philosophy #history
Guido van Rossum: Python
 
I think I went a little overboard with #python classes when they finally clicked.

I'm looking through some of the scripts I made at work to automate my reports, and all but one could have the class removed in favor of just one or two functions... I think I just wanted to use classes because it made me feel cool or something 😅 or like I knew more than what I was doing.
 
#TIL that when I enter !py3k in a #DuckDuckGo search field, I am directed to #Python 3.7.2 documentation.
 
@ekaitz_zarraga sure. Or you could provide a bunch of callbacks instead of one class. But classes as bags-of-methods just look more right in this case.

In recent years my #Python code is mostly pure functions passing data as tuples and dictionaries. And I have a hard time explaining to juniors that no, it's not less powerful just because it looks simpler. It's actually how everything *should* be :-)
 
@ekaitz_zarraga one use case is when you need different polymorphic implementations of a common interface (say, several available DB backends selected by a config file).

But yes, classes in #Python tend to be overused due to general indoctrination into OOP being "how things should be written". https://www.youtube.com/watch?v=o9pEzgHorH0

YouTube: Stop Writing Classes (Next Day Video)

 
@jrhawley Olga Kalinina has presented the way she works with #PostgreSQL and #R (via PL/R) during #fosdem #pgday in Brussels. She prefers R but other people also use #Python. I don't think she is on Mastodon but maybe it is a good reason to invite her and ask.
 
RT @raymondh: #Python 2.7 reaches end-of-life at the end of 2019. Afterwards, the interpreter will not get updates -- no bugfixes, no security fixes, nothing.

In the interim, the Python ecosystem is abandoning 2.7 support.
https://python3statement.org/

Don't wait to switch to Python 3.
 
if i were to hypothetically write an #activitypub library for use in both desktop clients and linux servers, would #python be a suitable option? and can i do so with minimal setup? #ProgrammingHelp
 
Ищем свободное парковочное место с #Python и глубоким обучением

https://tproger.ru/translations/parking-searching/amp/?__twitter_impression=true
 
Is it me or does #Django ORM try to keep it much closer to the #SQL than #RubyOnRails's ActiveRecord?

#Programming #WebDevelopment #Python
 
Obscure #python bit of knowledge: os.scandir() accepts not only strings, but also its own dir entries, so you can do:

for entry in os.scandir('.'):
if entry.is_dir():
os.scandir(entry) # not entry.path

It just saved me from thinking about how to split up a long line :-)
 
#Programming languages I know (for various definitions of “know”) by decade of invention:

10s: #Rust, #Elixir, #Crystal
00s: #Clojure
90s: #Ruby, #Python, #JavaScript
80s: #Perl
70s: #C, #Scheme
60s: #BASIC
50s: (none)

Is there a language from the fifties worth learning?
 
TIL about transducers in #Clojure. Pretty different to the way I usually do things in #Ruby or #Python... Never thought about transforming a reducer, basically building complex logic from simple "building block" reducers.
 
<rant>
#Python devs, stop supporting Python 2 in your new libraries. At this point you’re just enabling bad behavior.
</rant>
 
I just realized I never did an #introduction... So here we go!

My jams:

- #rust, #python, #clojure, #programming
- #gnu, #linux, #emacs, #orgmode
- #freesoftware, #hacker stuff
- #music, lots of weird music
- #politics, the one to the left
- #physics
 
#Days Завершил перенос всего функционала на #python. Познакомился с потоками, они в питоне сделано ну просто очень удобно, было приятно добавить их в код, не то, что перловый fork() с его монструозными многоуровневыми if-ами, где потом сам чёрт ногу сломит
 
Why doesn't #Python use significant whitespace in it's data structure literals?
 
Hey y'all! I work as a contract Web developer that specializes in #Elixir, #Python and #JavaScript (with some background with #PHP). I'm looking for some more leads in the space for this quarter - always gets a little dry around this time of year.

Resume: https://jacky.wtf/work/resume/tech/

Intake: https://www.black.af/intake/

#contracting #work #webdev #freelance
 
#Python: как уменьшить расход памяти вдвое, добавив всего одну строчку кода?
 
#100Days Итак, переписал #jabber бота с #perl на #python, доставка сообщений работает. Но это только начало. Для полного функционала не хватает работы с командами и процессами, слушающими мастодон. Но на сегодня и так большой дело сделал.
На завтра реализация парсера команд
 
Later posts Earlier posts