xurxia
I introduce myself: I am Galician and citizen of the World. Proud father. I love science (specially astronomy), technology, nature and photography. I play padel and surf and whenever I can I escape with my camper van.
- 2 Posts
- 10 Comments
Yes, the idea is use in the future Output.status as a way to route to different pages depending of the model result. For example, when /list endpoint is called I could return 1 to show the feed list, and 2 to render a page with a message and suggestions when the feed list is empty. The same with negative numbers but for errors.
Thanks! I will try it. I was an user of this sw but recently I have moved to Pyto as it has more libraries (OpenCV, etc), pip support and a newer Python version. Pythonista has its pros too.
I find it very interesting and I want to do one with my kids. The guide is good from a step by step point of view about how to make one, but I think a couple of examples about what kind of data can someone get with it and what can someone expect to “view” could be very helpfull too
Hi,
I have used goto instruction a lot when I started to program in Basic ( an Amstrad CPC 🥹). In this context goto had logic. But in modern languages like python I think it is a very bad idea:
- Understand the logic is more complex
- Functions and methods are a better and more powerfull alternative
- It is dangerous: add or remove a new line of code could have bad consequences
Regards
xurxia@mander.xyzto
Python@programming.dev•How do you make config data available to all classes?English
3·3 years agoYou can use global variables, it is true, but I prefer singleton because I have all config variables and logic encapsulated in a class. The first time the singleton object is created it reads all the config variables from a file, and with its methods get and set manages them. The Config class doesn’t know the parameters names of the config file neither the number, it dynamically reads the file and creates the attributes, so It is a very reusable code that when you program using OOP is a more natural way than implementing like a module.
Related to this, I group config variables by sections so it is more clearly for me, then the singleton object dynamically creates an array for each section, and a variable into the array for every variable in this section of the config file. Access to the config info is as easy like this:
conf = Config() conf.get('DB', 'server') conf.get('DB', 'login') conf.get('DB', 'password')
xurxia@mander.xyzto
Python@programming.dev•How do you make config data available to all classes?English
8·3 years agoI use a singleton class called Config (some times I use it as a Cache too)
Singleton pattern: https://www.geeksforgeeks.org/singleton-pattern-in-python-a-complete-guide/
Config class using Singleton pattern: https://charlesreid1.github.io/a-singleton-configuration-class-in-python.html
xurxia@mander.xyzto
Astronomy@mander.xyz•New Radio Astronomical Observations Confirm Unintended Electromagnetic Radiation Emanating from Large Satellite Constellations
1·3 years ago5G was only at example of new technologies. It is true that wireless internet need to be deployed in Africa and other areas, but Starlink need to be deployed in the space too. And in a short/medium term future will be easier upgrade earth based antennas than satellites in orbit. In the middle of the sea are satelital communications for important info actually, and this must be enough. See a film online in the middle of the Atlantic is not as important as the knowledge that the Galaxy give us (my personal and subjective opinion)
xurxia@mander.xyzto
Astronomy@mander.xyz•New Radio Astronomical Observations Confirm Unintended Electromagnetic Radiation Emanating from Large Satellite Constellations
11·3 years agoThere are more options to get internet access, the new ones like 5G are wireless and with a huge bandwidth. Is really internet access in the middle of the nothing a priority? More than the potential knowledge about who we are and from where we come? I don’t believe in a World where people doesn’t know enjoy the nature and the wild places without internet.
Hi! Other great book is “Fluent Python”. I think PCC could be better as first contact and then this one as next step.
https://www.oreilly.com/library/view/fluent-python/9781491946237/

There are free IoT cloud solutions to send and receive data and that work with MQTT protocol for this purpose.