Jump to content

- - - - -

Python - Files

  • Please log in to reply
No replies to this topic

#1 HappyCalc


    Casio Fan

  • Members
  • PipPip
  • 42 posts
  • Gender:Male
  • Location:Germany
  • Interests:Programming, On-Calc Programming(C.Basic), Gaming, Origami, Eating Chocolate

  • Calculators:

Posted 24 November 2021 - 08:36 PM

I recently started coding python on the cg-50. I wanted to create an image viewer and started programming various functions to compute the math behind JPEG.

Originally i thought of coding that in C.Basic, my favorite on-calc-interpreter (thx sentaro21 :D ). But the problem is, C.Basic is not object-oriented and i had to use matrices, byte lists and much code. So I thought I would first code the algorithms in python and then port it to C.Basic. I knew that it is hard to get raw data to python since there is no file access, so I decided to create a C.Basic program that converts my 1,5kb sample image to a python byte-string (.py file) (like data in bad apple). This works fine, but is a very dirty solution.

Randomly, I saw, that python on the calc accepts open() as a function and is also marked blue. I tried multiple thing, but using it does not open a file, throw an exception or anything else, it just returns None. Searching in the internet and the python docs also only shows  it as file open function. Maybe CASIO wanted to add it in  the future or removed the feature, but left a bit there?

open() seems to accept at least 1 argument but does not set a limit.

Maybe someone knows more than me (disassembled the os).

Thanks  :nod:

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users