PythonExtra est un add-in Python alternatif pour (à ce stade) Graph 35+E II, Prizm et Graph 90+E. L'objectif est de fournir plus de fonctionnalités : modules standard, getkey(), fonctions de dessin plus performantes, etc.
Compile pour Graph 90+E (fx-CG 10/20/50) et Graph 35+E II (fx-9860G III)
Peu de RAM sur Graph 35+E II (c'est difficile d'en trouver sur ce modèle)
Un shell pas trop mal (saisie rapide, scrolling) avec de bonnes performances
Plein de modules standard
array, builtins, cmath, collections, io, math, random, struct, sys, time
Le module spécifique CASIO : casioplot (fidèle à part sur les polices)
Un nouveau module gint avec les fonctionnalités avancées de gint :
Pour l'instant, une bonne partie de <gint/display.h> et <gint/keyboard.h>
Donc getkey() (attente de touche) ainsi que keydown() (test instantané) !
Et des fonctions de dessin rapides comme dline() ou drect()
Le plan actuel :
Être sensiblement compatible avec l'appli Python officielle.
Pousser les fonctionnalités ajoutées pour vraiment relever le niveau de Python !
Si du temps de développement se débloque : support autres Graph mono (pas de promesses).
Updates et screenshots à venir. Je n'ai pas l'intention d'implémenter un million de fonctionnalités, juste ce qu'il faut pour s'assurer que ça ne finisse pas mal documenté et non maintenu comme CasioPython.
Dans l'exemple ci-dessous (réalisé par Mb88), un Flappy Bird déjà bien optimisé (dessin partiel etc, à gauche) est accéléré un bon gros coup en utilisant PythonExtra et le module gint pour le dessin (à droite).
Contexte historique
Aux journées APMEP 2022, redgl0w racontait comment le port MicroPython pour Numworks n'était finalement pas super difficile. Moi je parlais de comment un port maison résoudrait le problème de getkey(), et Critor m'a convaincu d'essayer sur-le-champ.
En fin de compte, j'ai clôné MicroPython Dimanche à midi et à 1 heure du matin j'avais un port fonctionnel avec getkey() sur ma Graph 90+E (que j'ai d'ailleurs montré à CASIO Lundi, pour la démo). Comme quoi, des fois ça marche tout seul !
(Enfin, le début marche tout seul. Faire une bonne UI et gérer tous les détails ensuite c'est une autre paire de manches !)
Et pas de PR pour l'instant svp, je suis en train de faire du refactoring. J'accepterai les PR au plus tôt lorsque j'en serais à la v.1.0b1.
Captainluigi a écrit : Btw I was just gonna take a look to fix the fact that the menu option doesn't work very well on my fx cg / 90+e (I've to let menu pressed to let it be visible)
C'est intentionnel.
J'ai pas encore trouvé de bugs sur master (dans la v.1.0a1 il y en a que j'ai corrigé depuis).
Je sais qu'il manque plein de fonctionnalités, ça arrive…
So far this is not planed cause the fileIO interface we are currently using is quite old (outdated), there is a possiblity to mode to a better file support but we will have to rely on most modern interfaces from micropython and there are plenty of work within gint to make them running on the fxCG50 and Cie.
So maybe one day, but not for today and tomorrow.
I'll check when I will have time if we can have a "simple" version of these two functions, but let say, the answer might be "no" at the end.
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
But this implementation is clearly outdated and not anymore in line with file support in micropython 1.25.
I would prefer working on a up-to-date method (based on fs modules) rather than putting a patch on a patch on a vintage implementation.
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
Yes, it just depends on what we really want
If we stay with this old implementation, then yes it is just a matter of making ioctl running, that should not be that hard.
If we want something more "up-to-date" regarding latest micropython implementation, it would require much more work.
We can also have a kind of "in-between" position: make a quick and dirty, ioctl-based implementation for now, keeping in mind that it has "no future", and work on a nice implementation on the long run.
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
Planète Casio est un site communautaire non affilié à Casio. Toute reproduction de Planète Casio, même partielle, est interdite.
Les programmes et autres publications présentes sur Planète Casio restent la propriété de leurs auteurs et peuvent être soumis à des licences ou copyrights.
CASIO est une marque déposée par CASIO Computer Co., Ltd
Citer : Posté le 18/05/2025 21:10 | #
Non c'est bon je suis français hein
EDIT:
Et pas de PR pour l'instant svp, je suis en train de faire du refactoring. J'accepterai les PR au plus tôt lorsque j'en serais à la v.1.0b1.
Btw I was just gonna take a look to fix the fact that the menu option doesn't work very well on my fx cg / 90+e (I've to let menu pressed to let it be visible)
C'est intentionnel.
J'ai pas encore trouvé de bugs sur master (dans la v.1.0a1 il y en a que j'ai corrigé depuis).
Je sais qu'il manque plein de fonctionnalités, ça arrive…
Citer : Posté le 22/06/2025 02:23 | #
Are there plans to implement the seek() and tell() functions? I can't seem to get them to work and I'm assuming they haven't been implemented yet.
Citer : Posté le 22/06/2025 09:15 | #
So far this is not planed cause the fileIO interface we are currently using is quite old (outdated), there is a possiblity to mode to a better file support but we will have to rely on most modern interfaces from micropython and there are plenty of work within gint to make them running on the fxCG50 and Cie.
So maybe one day, but not for today and tomorrow.
I'll check when I will have time if we can have a "simple" version of these two functions, but let say, the answer might be "no" at the end.
Citer : Posté le 22/06/2025 09:16 | #
We're wrapping POSIX, that should be possible no?
Citer : Posté le 22/06/2025 09:38 | #
I think the implementation we are currently useing relies on ioctl wrapping of micropython which has been "disabled".
https://git.planet-casio.com/Lephenixnoir/PythonExtra/src/branch/dev/ports/sh/fdfile.c#L101-L128
But this implementation is clearly outdated and not anymore in line with file support in micropython 1.25.
I would prefer working on a up-to-date method (based on fs modules) rather than putting a patch on a patch on a vintage implementation.
Citer : Posté le 22/06/2025 09:41 | #
As you prefer... although on the surface I do suspect it could be just add a method or recognize this one ioctl.
Citer : Posté le 22/06/2025 10:06 | #
Yes, it just depends on what we really want
If we stay with this old implementation, then yes it is just a matter of making ioctl running, that should not be that hard.
If we want something more "up-to-date" regarding latest micropython implementation, it would require much more work.
We can also have a kind of "in-between" position: make a quick and dirty, ioctl-based implementation for now, keeping in mind that it has "no future", and work on a nice implementation on the long run.
Citer : Posté le 22/06/2025 10:07 | #
I will add an issue not to forget, cause right now I am just "flooded" and won't be able to code I think before end of July.
Citer : Posté le 22/06/2025 12:06 | #
Looking a bit more deeply at vfs_posix extmod in micropyhon 1.25, we may not be that far from having something running.
We may have to scrap some directories management features, but for files management at least, it should be quite smooth ...
Will look at this when I'll have time.
Citer : Posté le 25/06/2025 01:39 | #
Thanks. Was also wondering if there's a way to create/access files within a specific folder?
Citer : Posté le 25/06/2025 10:09 | #
You can include slashes in paths?
Citer : Posté le 26/06/2025 10:06 | #
ah ok