this post was submitted on 25 Jun 2024
8 points (100.0% liked)
Aotearoa / New Zealand
1653 readers
2 users here now
Kia ora and welcome to !newzealand, a place to share and discuss anything about Aotearoa in general
- For politics , please use !politics@lemmy.nz
- Shitposts, circlejerks, memes, and non-NZ topics belong in !offtopic@lemmy.nz
- If you need help using Lemmy.nz, go to !support@lemmy.nz
- NZ regional and special interest communities
Rules:
FAQ ~ NZ Community List ~ Join Matrix chatroom
Banner image by Bernard Spragg
Got an idea for next month's banner?
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You could do this with python and a couple of libraries. This is just an example, but you could import the data from a DB or use a CSV file.
Ooh thanks! I'll definitely have a play with this. What's the step before this? Is it as simple as installing python, putting the code in somefile.py, then running it?
Yep, if you are running any type of Linux python is already installed.
I always have a path in my python files to allow for direct running rather than calling python first. This only works on Linux.
If you put
#!/usr/bin/env python3
as the very first line, you can make the file executable and it will just run
otherwise you will have to call python first, e.g.
python yourFile.py
Awesome, thanks! I'll have a play with this over the weekend.