a66ey, to python
@a66ey@mastodon.social avatar

About half a year ago I wrote myself a little #python script to automate #wikipedia #translation via #deepl.

Tried to use it on my second 💻 today, to no avail and much grinding of teeth.

I'm not setting up any more #venv . I'm fed up. I'm bloody rewriting everything, even libraries in #perl so it works proper on #unix damn it. And maybe throw a look at some #zig porting while at it.

villares, to python Portuguese
@villares@ciberlandia.pt avatar

Será que é hoje que eu vou aprender a usar um "ambiente virtual levinho" feito com o módulo do ?

  • docs: https://docs.python.org/3/library/venv.html
  • para criar: python -m venv <path_do_venv>
  • para ativar, no Linux pelo menos: source <path_do_ven>
  • para desativar: deactivate
  • para por nos scripts .py ("shebang"):#! <path_do_env>/bin/python
alatitude77, to python
@alatitude77@mastodon.social avatar
publicvoit, to NixOS
@publicvoit@graz.social avatar

TIL: #NixOS isn't compatible with my usual #Python #venv process: https://www.reddit.com/r/NixOS/comments/16bpe89/how_to_deal_with_python_venv_and_their_hardcoded/ 😩

All sorts of workarounds that either sound very dirty or require much more complexity such as docker images for simple Python scripts.

I guess I'll stick with a hard-coded Python version for now so that the path won't change. Let's learn how to accomplish that ... 🙄

#Yakshaving

Edent, to python
@Edent@mastodon.social avatar

Grrr. I have a stupid problem.

I use cron to trigger a script in a - like so:

5 * * * * /path/to/script/bin/python /path/to/script/example.py

That works. But when the script tries to read or write a file, it uses my home directory.

Is that normal? I would have thought it would use the directory the file is in. But it appears to use the home of the user running cron.

Is there a sensible way to fix this?

setebos, to python
@setebos@mastodon.online avatar

You usually want a separate virtual environment for your project. And it is quite annoying to activate it whenever you start your work on it.
Here is an example of how you can the activation of your env with Makefile. This makes it possible to just run make go to start your project in your automagically. You can also add a similar test target to run tests in the env you want by just running make tests.

djpeacher, (edited ) to random
@djpeacher@fosstodon.org avatar

Nice, spent the last two hours an upstream issue, only for the issue to be “yanked” upstream. Thankful, but dang does my head hurt!

djpeacher,
@djpeacher@fosstodon.org avatar

Poetry creates its own when it gets installed, separate from your installed dependencies 😵‍💫

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • khanakhh
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • everett
  • ngwrru68w68
  • Durango
  • megavids
  • InstantRegret
  • cubers
  • GTA5RPClips
  • cisconetworking
  • ethstaker
  • osvaldo12
  • modclub
  • normalnudes
  • provamag3
  • tester
  • anitta
  • Leos
  • lostlight
  • All magazines