nedit.py

Created by golem64

Created on October 07, 2020

1.38 KB

Nedit est un outil d’édition de texte pour Numworks écrit en python, pour le moment il ne marche qu’avec Omega car il nécessite la bibliothèque python nommée ‘os’ et également la gestion des fichiers implémentée.

Pour installer Omega sur votre calculatrice, rendez vous ici : https://getomega.dev/install/latest

C’est rapide, gratuit et vous ne perdrez pas certaines de vos données d’avant.

Nedit is an file editor for Numworks written in python, for now it works only with Omega because he needs the ‘os’ python library and also the file gesture directly implemented in Omega.

To install Omega, go here : https://getomega.dev/install/latest

It’s fast, free and you won’t lost some of your old files.

Updates : - Version 0.1 : File reading is functionnal


import os
from os import *
import turtle
from turtle import *
import kandinsky
from kandinsky import *
import ion
from ion import *
import time
from time import *
print("Chargement des fichiers...")
fichiers=listdir()
compats=fichiers
#compats=[]
#for i in range(len(fichiers)):
#  nom=fichiers[i]
#  if nom[len(nom)-4]=="." and nom[len(nom)-3]=="t" and nom[len(nom)-2]=="x" and nom[len(nom)-1]=="t":
#    compats.append(fichiers[i])
print("Termine")
kandinsky.draw_string("Nedit",140,0)
kandinsky.draw_string("--------------------------------",0,15)
for i in range(len(compats)):
  kandinsky.draw_string(compats[i],10,30+20*i)
sel=0
time.sleep(0.5)
while ion.keydown(KEY_BACK)!=True:
  kandinsky.draw_string(">",0,30+20*sel)
  if ion.keydown(KEY_DOWN):
    kandinsky.draw_string(" ",0,30+20*sel)
    sel=sel+1
    if sel>len(compats)-1:
      sel=0
  if ion.keydown(KEY_UP):
    kandinsky.draw_string(" ",0,30+20*sel)
    sel=sel-1
    if sel<0:
      sel=len(compats)-1
  if ion.keydown(KEY_EXE)==True or ion.keydown(KEY_OK)==True:
    turtle.reset()
    turtle.hideturtle()
    kandinsky.draw_string("Nedit:",0,0)
    kandinsky.draw_string(compats[sel],70,0)
    kandinsky.draw_string("-------------------------------------",0,20)
    kandinsky.draw_string(open(compats[sel]).read(),0,30)
    break
  if ion.keydown(KEY_BACK)==True:
    break
  kandinsky.draw_string(">",0,30+20*sel)
  time.sleep(0.15)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.