Python comes to the Casio fx-CG 50
|
12-26-2024, 09:37 PM
Post: #41
|
|||
|
|||
RE: Python comes to the Casio fx-CG 50
Thanks for that review.
One consequence of the lack of Unicode is there is no copyright ©️ symbol. The documentation does mention that ASCII must be used, but never makes clear what to expect if the source contains one. Leaving one wondering whether to expect an alternative symbol printed, a compilation error or a factory reset? Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
12-26-2024, 10:48 PM
(This post was last modified: 12-26-2024 10:50 PM by bxparks.)
Post: #42
|
|||
|
|||
RE: Python comes to the Casio fx-CG 50
(12-26-2024 09:37 PM)StephenG1CMZ Wrote: One consequence of the lack of Unicode is there is no copyright ©️ symbol. The documentation does mention that ASCII must be used, but never makes clear what to expect if the source contains one. Just to make sure that we are on the same page: When I say "unicode support" in MicroPython, I looking at whether the internal implementation of the `str` type in the Python interpreter supports unicode characters. Not whether the Python interpreter supports unicode characters embedded in the source file. Generally, I never use unicode characters within the source code. I stick to ASCII characters only. Because too many programming tools don't work correctly with unicode (e.g. searching for text inside or outside editors) And I really hate seeing emojis, flags icons, and other such things inside the source code. The darned things are often unrecognizable due to the fonts used by text editors on various computers. So in your example, the copyright symbol would be replaced with (c) in the source file. But any modern programming language ought to be able to read, manipulate, and write unicode characters. The CG50 MicroPython v1.9.4 cannot do that, because its internal `str` type cannot represent unicode characters. |
|||
Yesterday, 02:08 PM
(This post was last modified: Yesterday 02:09 PM by StephenG1CMZ.)
Post: #43
|
|||
|
|||
RE: Python comes to the Casio fx-CG 50
By comparison, I have used the Copyright symbol in strings in Numworks without problems. - It displays as a rectangle there, but doesn't cause any issues.
Stephen Lewkowicz (G1CMZ) https://my.numworks.com/python/steveg1cmz |
|||
Yesterday, 04:04 PM
Post: #44
|
|||
|
|||
RE: Python comes to the Casio fx-CG 50
I discovered that there is another MicroPython implementation for the Casio fx-CG50 called PythonExtra. The git repo is here: https://git.planet-casio.com/Lephenixnoi...a/releases. Download the `PythonExtra-pe-0.3.0-beta.zip` file, and copy over the `PythonExtra-pe-0.3.0.g3a` file to the CG50. The forum discussions are here (https://www.planet-casio.com/Fr/forums/t...extra.html), but the vast majority of the discussions are in French.
PythonExtra provides MicroPython v1.23.0 which solves many of the issues that I posted about. In particular, PythonExtra supports unicode strings and f-strings. However, the software is in "beta" phase, and has some deficiencies. Specifically, it currently has an even worse support for entering special ASCII symbols than Casio's MicroPython implementation: there is absolutely no ability to enter them at all through the calculator keypad, in both REPL mode and during `input()`. The maintainer responded that he is now aware of the problem, but will not be able to fix the issue for a while due to time constraints. |
|||
Today, 12:16 AM
Post: #45
|
|||
|
|||
RE: Python comes to the Casio fx-CG 50
(Yesterday 04:04 PM)bxparks Wrote: I discovered that there is another MicroPython implementation for the Casio fx-CG50 called PythonExtra. The git repo is here: https://git.planet-casio.com/Lephenixnoi...a/releases. Download the `PythonExtra-pe-0.3.0-beta.zip` file, and copy over the `PythonExtra-pe-0.3.0.g3a` file to the CG50. The forum discussions are here (https://www.planet-casio.com/Fr/forums/t...extra.html), but the vast majority of the discussions are in French. How do you actually run a program? I have a program called Nqueens.py in the \PYTHON folder and I can't run it directly in shell mode, nor can I import it and run it. Tom L Cui bono? |
|||
Today, 12:24 AM
Post: #46
|
|||
|
|||
RE: Python comes to the Casio fx-CG 50
(Today 12:16 AM)toml_12953 Wrote: How do you actually run a program? I have a program called Nqueens.py in the \PYTHON folder and I can't run it directly in shell mode, nor can I import it and run it. - Upload the program to the CG50 using USB Mass Storage. I placed my files at the top level. - Fire up PythonExtra. - Press the FILES soft menu (F1) if not already there. - You should see your file in a list. - Scroll down to the file using the UP and DOWN arrow keys. - Hit EXE to run. My FILES screen looks like this: |
|||
Today, 02:25 AM
(This post was last modified: Today 02:44 AM by toml_12953.)
Post: #47
|
|||
|
|||
RE: Python comes to the Casio fx-CG 50
(Today 12:24 AM)bxparks Wrote:(Today 12:16 AM)toml_12953 Wrote: How do you actually run a program? I have a program called Nqueens.py in the \PYTHON folder and I can't run it directly in shell mode, nor can I import it and run it. That works if I don't have the program in a def block but if I do (see below) I get back to the >>> prompt and nothing I type seems to be able to run the program. Code: def nqueens(): Tom L Cui bono? |
|||
Today, 02:39 AM
(This post was last modified: Today 02:41 AM by bxparks.)
Post: #48
|
|||
|
|||
RE: Python comes to the Casio fx-CG 50
(Today 02:25 AM)toml_12953 Wrote: That works if I don't have the program in a def block but if I do (see below) I get back to the >>> prompt and nothing I type seems to be able to run the program. The easiest solution is probably to add the single line Code: nqueens() It *might* be possible to type the following in the SHELL screen: Code: >>> from nqueens import * But it is sooo painful to type anything on the calculator keypad, I typed "from" then wanted to shoot myself. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)