https://github.com/beggsbanner/GETTIME_API
If this is the wrong place let me know please, but looks like it is. I am learning python. I feel like i have a pretty decent grip on it after the last 8 hours of work on this thing. Can a few people see if this works for you, It is linux. and let me know if it is not working for you. i have tested on a few vm's just want to make sure i have a basic understanding of structure, coding, committing and releasing. Thanks
#๐ TimeZones
29 messages ยท Page 1 of 1 (latest)
@shy seal
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
deb files are only for Debian and Debian-based distributions, so a deb won't work on Arch or Fedora
If this is a server-side application (a web server?), I think it's reasonable to just provide the instructions to get it working with Python and a venv. You could also provide a dockerfile if you want an isolation option with no manual steps
Typically you should not include build files (like deb and exe) into the repository. That's for releases.
You should not commit __pycache__ to the repository either.
You could blacklist these by using a .gitignore file, based on e.g. https://github.com/github/gitignore/blob/main/Python.gitignore
Gotya. Thanks. I have some reading to do then.
Also check out https://packaging.python.org/en/latest/
You could publish the project on PyPI or at least make it pip-installable from github
the debian dependencies only seem to include
python3, python3-tk, python3-venv
so the deb is probably not going to work if it's missing Flask and pytz
I know it's not the point of the question, but this is sometimes going to respond with several timestamps differing by one second ๐
https://github.com/beggsbanner/GETTIME_API/blob/main/gettime-api-deb/usr/bin/GETTIMEAPI.py#L18-L21
gettime-api-deb/usr/bin/GETTIMEAPI.py lines 18 to 21
time_data = {}
for zone in us_time_zones:
tz = pytz.timezone(zone)
time_data[zone] = datetime.now(tz).strftime('%Y-%m-%d %H:%M:%S %Z')```
Gotya. I just got fatigued. It should have both. I screwed it up the first 5 times and had to add them. So you are saying flask and pytz are still missing under dependencies? Ahhhh! Thanks
As I said, I think a deb package is probably overkill
Ok. I tried to go for what looked like the hardest one first
If it's a more user-facing application, there are standards like flatpak and AppImage that don't require you to make 10 packages for 10 different distros
Awesome
It is meant to be a desktop utility for people that have to know different time zones
I still have a ton to learn so I really do appreciate the information and you taking the time to look at it
Is it safe to say that I overcomplicated it?
well, depends on your goals
Just a desktop widget
if you want Linux users to easily install the program, either make it pip-installable or package it with flatpak/appimage
That max sense lol
though if you only care about Ubuntu/Debian users, a deb is fine
It was really a learning exercise for me because I have only ever dabbled in the alchemy of coding
I think this:
datetime.now(tz).strftime('%Y-%m-%d %H:%M:%S %Z')
might be better spelled:
datetime.now(tz).isoformat(' ')
It does bang the timezone up against the time part, but at least it's a nice ISO1806 timestamp. Lots of things can parse that without crafting their own strptime()-like call.
See. I just used the first thing that made sense to me. Thanks for the pointer
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.