Les membres ayant 30 points peuvent parler sur les canaux annonces, projets et hs du chat.
La shoutbox n'est pas chargée par défaut pour des raisons de performances. Cliquez pour charger.

Forum Casio - Projets de programmation


Index du Forum » Projets de programmation » [Bêta] PythonExtra.
Lephenixnoir Hors ligne Administrateur Points: 25212 Défis: 174 Message

[Bêta] PythonExtra.

Posté le 29/10/2022 09:49

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.

Version Bêta 0.4 (Changelog)
Graph 35+E II / Prizm / Graph 90+E / Math+ / ClassPad : PythonExtra-pe-0.4.0-beta.zip


Aperçu de PythonExtra sur Graph 90+E. (Cliquez pour agrandir)


Aperçu de PythonExtra sur Graph 35+E II (FxPyEdit par Mb88)

Description sommaire des fonctionnalités :
  • 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.

Dépôt Git : https://gitea.planet-casio.com/Lephenixnoir/PythonExtra
PythonExtra est notamment possible grâce à l'aide précieuse de Mb88.

Comparaison directe

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 !)

Fichier joint


Précédente 1, 2, 3 ··· 10 ··· 20 ··· 25, 26, 27, 28
Mb88 Hors ligne Rédacteur Points: 1260 Défis: 3 Message

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.

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…
Potchkee Hors ligne Membre Points: 29 Défis: 0 Message

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.
Slyvtt Hors ligne Maître du Puzzle Points: 2645 Défis: 17 Message

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.
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
Lephenixnoir Hors ligne Administrateur Points: 25212 Défis: 174 Message

Citer : Posté le 22/06/2025 09:16 | #


We're wrapping POSIX, that should be possible no?
Mon graphe (27 Juin): (MQ || Rogue Life) ; serial gint ; passe gint 3 ; Azur ; ...) || (shoutbox v5 ; v5)
Slyvtt Hors ligne Maître du Puzzle Points: 2645 Défis: 17 Message

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.
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
Lephenixnoir Hors ligne Administrateur Points: 25212 Défis: 174 Message

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.
Mon graphe (27 Juin): (MQ || Rogue Life) ; serial gint ; passe gint 3 ; Azur ; ...) || (shoutbox v5 ; v5)
Slyvtt Hors ligne Maître du Puzzle Points: 2645 Défis: 17 Message

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.
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
Slyvtt Hors ligne Maître du Puzzle Points: 2645 Défis: 17 Message

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.
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
Slyvtt Hors ligne Maître du Puzzle Points: 2645 Défis: 17 Message

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.
There are only 10 types of people in the world: Those who understand binary, and those who don't ...
Potchkee Hors ligne Membre Points: 29 Défis: 0 Message

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?
Lephenixnoir Hors ligne Administrateur Points: 25212 Défis: 174 Message

Citer : Posté le 25/06/2025 10:09 | #


You can include slashes in paths?
Mon graphe (27 Juin): (MQ || Rogue Life) ; serial gint ; passe gint 3 ; Azur ; ...) || (shoutbox v5 ; v5)
Potchkee Hors ligne Membre Points: 29 Défis: 0 Message

Citer : Posté le 26/06/2025 10:06 | #


ah ok
Précédente 1, 2, 3 ··· 10 ··· 20 ··· 25, 26, 27, 28

LienAjouter une imageAjouter une vidéoAjouter un lien vers un profilAjouter du codeCiterAjouter un spoiler(texte affichable/masquable par un clic)Ajouter une barre de progressionItaliqueGrasSoulignéAfficher du texte barréCentréJustifiéPlus petitPlus grandPlus de smileys !
Cliquez pour épingler Cliquez pour détacher Cliquez pour fermer
Alignement de l'image: Redimensionnement de l'image (en pixel):
Afficher la liste des membres
:bow: :cool: :good: :love: ^^
:omg: :fusil: :aie: :argh: :mdr:
:boulet2: :thx: :champ: :whistle: :bounce:
valider
 :)  ;)  :D  :p
 :lol:  8)  :(  :@
 0_0  :oops:  :grr:  :E
 :O  :sry:  :mmm:  :waza:
 :'(  :here:  ^^  >:)

Σ π θ ± α β γ δ Δ σ λ
Veuillez donner la réponse en chiffre
Vous devez activer le Javascript dans votre navigateur pour pouvoir valider ce formulaire.

Si vous n'avez pas volontairement désactivé cette fonctionnalité de votre navigateur, il s'agit probablement d'un bug : contactez l'équipe de Planète Casio.

Planète Casio v4.3 © créé par Neuronix et Muelsaco 2004 - 2025 | Il y a 126 connectés | Nous contacter | Qui sommes-nous ? | Licences et remerciements

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