Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

That's literally what the article is about.


First, so many tutorials give you terrible information. People don't know about "-m", the "py" command, are told to use sudo and not --user.

The current situation is actually not that bad. With my students, the topic is quickly explained and mastered. But it's not a common occurrence.

However, it is true that it's still not as easy as it could be. Some reasons.

- Python is older than java.

- Python is shipped as part of MacOS and Linux, but using the system Python can cause issues, so it's a trap.

- Python deals with a lot of compiled extensions. Scipy embeds C, fortran and assembly. It's a hard problem.

- The Python project has *tremendously* less resources than java.

- Politics. Lots of it.

- Debian et Red Had packagers made a mess by splitting the python setup in many small packages.

- Python 2/3 transition took attention span from the problem during a decade.

- You often install many python versions on the same machine, which makes things harder.

- Python is used by a huge number of non programmers. Much more than java. This shows in the reported difficulties.

- There are way too many ways to install python. So many combinations of failure modes.

- Microsoft screw up with their store not packaging "py" or the core dev by not packaging it on Unix.

- Anaconda brings as many problems as it solves, and is popular because of enterprise limitations.


The “py” command?


I think that is referring to the Python launcher utility for Windows: https://docs.python.org/3/using/windows.html#python-launcher...


Poetry shell doesn't work on windows, and it doesn't have named venv which matters for some users. Also it's very slow, require to be installed and use proprietary fields in pyproject.toml.

It's a great tool but there are reasons you might want something else.

Alternative like raw pip, pip tools, or dephell all have various pros and cons.


>Poetry shell doesn't work on windows

What do you mean it doesn't work? It works fine on Windows here, unless I am missing something.


I'm being overly critical. Let's say it has problems:

- poetry shell didn't start the same shell that you were in: https://github.com/sarugaku/shellingham/issues/42. Looks like they fixed it 3 days ago though.

- It doesn't set the name of the project in the prompt, so you actually don't know you are in the shell. Very annoying if you have many windows.


>doesn't set the name of the project in the prompt

I agree with you there, it's very annoying and I've fallen for it a few times. Having not used Poetry on other platforms yet (still using Pipenv in a few projects), I wasn't even aware that this was a feature.


Not a solution, more a workaround, but on Windows I highly recommend developing using WSL, especially for Python. WSL + pyenv + poetry + VS Code with Remote WSL works amazingly well.


-m is the replacement for console scripts. Well behaved cli should define a _ _ main _ _. Py

Pytest, pylint, black, pip, poetry, mypy all have one.

Jupyter one is buggy.


That's a fair point actually.


Bit of a plug, but if you crave for that, and more, you can use AutoKey on Linux (not AutoHotKey which is Windows only): https://github.com/autokey/autokey

It will let you bind custom Python scripts to any mouse/keyboard sequence, including words on the fly. It can trigger word replacements just like Espanso (I use it to fill in emails, dates, addresses, timestamps et phone numbers), and of course, Python being Python, it lets you do a lot more.

The UI is probably not as good as Espanso's, and it may be harder to use (you need to script). On the other hand, it provides an API for prompting you with UI to select dates, files, input, etc., has timers and the whole Python 3 stdlib.

Some nice stuff I do with it:

- typing $email/$ phone present me with a list of email addresses/phone num (I have a lot of them) to insert one. Prevents typo. By pass web form limitations.

- $now and $date does something similar with dates (listing of various formats for the current date and a calendar). Very handy for documents and file name. Most of them don't have automated fields set up.

- $paste paste the clip board content, by passing any UI preventing me to do so, and screen/tmux limitations.

- I'm a heavy dynalist users (dynalist.io/) I love this software, but it lacks a lot of features, which are easy to add with AutoKey: just make a macro that inputs a serie of actions.


Hey, AutoKey is awesome indeed! I've used it myself for a while before developing espanso. In fact, I went through the code-base multiple times to understand how it could be so fast. I learned plenty of things about how the X server works thanks to you :)


Thanks for making your tool opens ource.

Do you plan to add scripting capabilities to Espanso or do you prefer to focus on the current use case ?


You're welcome! Espanso on Linux wouldn't be possible without other open-source projects, so that's the least I can do to give something back to the community :)

> Do you plan to add scripting capabilities to Espanso or do you prefer to focus on the current use case ?

We might add a "macro" feature to add delays and combine multiple keypresses, but I don't see espanso becoming a general "automation" tool. There are already plenty of great options for that (including AutoKey)!


In France at least. Our forests have been growing faster than we cut them for a few decades.


I took over the maintenance of 0bin.net, and FOSS client encrypted pastebin.

By design it's anonymous, so no account, and no tracking, hence not an obvious money maker.

But I like using it, and I feel no pressure to make it better or fix it, so I can work on it once a year and just be happy.


If it's just a crud app and not, a spa, even with a bit of ajax, sure I can, and so most devs I know.

Bu5 we are professionals, using frameworks. That changes things.


Ctrl + L then "*" will search in bookmarks for firefox.

Ctrl + L will focus the url bar, and then you can use several modifiers to search different things. E.G: ? will run a search engine query, even if you type something that looks like a domain name after it, such as a file anme.


It's a trade off. You don't want to write all your types for quick scripts, data analysis and small web sites.

As a trainer, experience teaches me that it's also much easier for beginners.

Now, types are nice to have for bigger code bases, but that doesn't mean there is no place for a language with optional typing.


There is Hindley-Milner type inference. Don't need to type types in most cases. See, for example, OCaml.


Type inference does not mean untyped. Arguably, getting a type error when you didn't write a single type hint makes things even more confusing if you are not an experienced programmer.


That comes with its own tradeoffs: increased compile time and more effort needed to create error messages that are helpful to the user.


Ocaml is probably the fastest compiling language I've ever used.


> more effort needed to create error messages that are helpful to the user.

Well, sure, but that's a tradeoff for the developers of the language to consider. As a user, there are already plenty of statically typed languages to choose from with many person-hours put into just that.


I want to offload as much work as we possibly can to the compiler. My brain will always be millions of times slower.


Is it really that burdensome for novice programmers? Maybe it's just been too long for me to remember the pains...but I'd expect most novices to heavily use primitive types which shouldn't be that hard to grok.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: