Skip to content

About

**Python IDE (Py2ME) ** is a complete Python development environment for Java ME (J2ME) MIDP 2.0 devices. It supports both **Python 2** and **Python 3** syntax, includes a built-in interpreter simulator, file management via JSR-75, and a full-screen code editor.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Python IDE for J2ME

๐Ÿ“ฑ Overview

Python IDE (Py2ME) is a complete Python development environment for Java ME (J2ME) MIDP 2.0 devices. It supports both Python 2 and Python 3 syntax, includes a built-in interpreter simulator, file management via JSR-75, and a full-screen code editor.


โœจ Features

๐Ÿ Dual Python Support

  • Python 3 Mode (modern syntax with print() parentheses)
  • Python 2 Mode (legacy syntax with print statements)
  • Switch between versions in Settings

๐Ÿ“ Code Editor

  • TextField editor with syntax helper (inline editing)
  • Full Edit mode - full-screen TextBox for comfortable typing
  • Live line counter - updates as you type
  • Keyword/snippet insertion - 80+ Python keywords and snippets
  • Support for 8000 characters per script

๐Ÿ’พ File Management (JSR-75)

  • Save scripts to device storage
  • Open scripts from file browser
  • Auto-detect .py files
  • Storage info display (available space, root directory)
  • Persistent storage via RMS (RecordStore)

๐ŸŽจ Additional Features

  • Splash screen with animated dash (Dash Animation V2)
  • Developer name personalization (first-run setup)
  • Graphics demo - low-level Canvas API demonstration
  • About screen - platform and environment details
  • Settings screen - Python version selector + developer name editor

๐Ÿš€ Getting Started

Requirements

  • MIDP 2.0 / CLDC 1.1 compatible device or emulator
  • JSR-75 (FileConnection API) for file operations (optional but recommended)
  • Java ME SDK or J2ME emulator for development

Installation

  1. Compile all .java files:
    javac -bootclasspath <path-to-midp-cldc-jars> *.java
  2. Package into .jar:
    jar cvfm PythonIDE.jar MANIFEST.MF *.class
  3. Create .jad descriptor file
  4. Deploy to device or run in emulator

๐Ÿ“‚ File Structure

PythonIDE.java           # Main MIDlet, menu, settings, RMS storage
EditorScreen.java        # Code editor with Full Edit mode
PythonInterpreter.java   # Python script parser/executor
FileManager.java         # JSR-75 file I/O operations
SplashScreen.java        # Animated splash screen
GraphicsDemo.java        # Low-level graphics demonstration

๐ŸŽฎ How to Use

First Launch

  1. Enter your developer name (personalizes the IDE title)
  2. Main menu appears with demo scripts

Editing Scripts

  1. Select a script from the main menu
  2. Edit code in the Code: field
  3. Press Insert to add Python keywords/snippets
  4. Press Full Edit for full-screen editing mode
  5. Press Run to execute

Full Edit Mode

  • Press Full Edit button in editor
  • Enjoy full-screen TextBox for easier typing
  • Press Done to save changes and return
  • Line count auto-updates on return

File Operations

  • Save: Press Save โ†’ enter filename โ†’ confirm
  • Open: Press Open from main menu โ†’ select .py file
  • Files saved to device's file:///root1/ or similar (JSR-75 dependent)

Settings

  • Python Version: Switch between Python 2 and Python 3
  • Developer Name: Change your personalization
  • Storage Info: View available space and root directory

๐Ÿ“ Sample Scripts Included

Script Description
Hello World Basic print statement
Variables Demo Variable assignment and types
Loop Demo for and while loops
Function Demo Function definition and calls
List Demo List operations (append, len, iteration)
String Demo String methods (upper, lower, replace)
Math Demo Math module usage (sqrt, pi, abs)
File I/O Demo JSR-75 file read/write operations
Graphics Demo Animated bouncing ball

๐Ÿ”ง Technical Details

Python Interpreter

  • Simulated execution (not real Python runtime)
  • Supports common keywords: print, if, for, while, def, import
  • Built-in functions: len(), range(), int(), str(), abs(), max(), min()
  • Variable storage and basic arithmetic
  • File I/O bridge to JSR-75

File I/O Commands

file_write('name.py', content)   # Write file
file_read('name.py')             # Read file
file_list()                      # List all .py files
file_exists('name.py')           # Check if file exists
file_delete('name.py')           # Delete file
file_append('log.txt', line)     # Append to file
storage_info()                   # Show storage details

Storage

  • RMS RecordStore for:
    • Developer name (PythonIDEPrefs)
    • Python version setting (PythonIDESettings)
  • JSR-75 FileConnection for .py script files

๐ŸŽฏ Keyboard Shortcuts (device-dependent)

Action Command
Select script OK / Select
Run code Run
Insert keyword Insert
Full-screen edit Full Edit
Save script Save
Open file Open
Back to menu Back
Exit app Exit

๐Ÿ› Troubleshooting

"Full Edit" button doesn't work

  • Ensure you're using the latest EditorScreen.java with instance field commands
  • Verify PythonIDE.getDisplay() method exists
  • Check device MIDP 2.0 compatibility

JSR-75 not available

  • Device may not support FileConnection API
  • IDE will still work but file operations disabled
  • Storage info will show "JSR-75 not detected"

Scripts don't run

  • Interpreter is simulated - only supports basic Python syntax
  • Complex libraries and advanced features not supported
  • Check syntax matches selected Python version (2 vs 3)

Text field too small

  • Use Full Edit button for full-screen editing
  • TextBox supports same 8000 char limit with better UX

๐Ÿ“œ Version History

v2.0 (Current)

  • โœ… Full Edit mode (full-screen TextBox)
  • โœ… Python 2 + Python 3 syntax support
  • โœ… JSR-75 file I/O integration
  • โœ… Developer name personalization
  • โœ… Settings screen with version selector
  • โœ… Animated splash screen v2
  • โœ… Graphics demo with Canvas API

v1.0

  • Initial release
  • Basic script execution
  • Basic editor with keyword insertion
  • Python 3 only
  • Simple file operations

๐Ÿ‘จโ€๐Ÿ’ป Developer Info

Platform: J2ME MIDP 2.0 / CLDC 1.1
APIs Used:

  • javax.microedition.lcdui.* - UI components
  • javax.microedition.rms.* - RecordStore persistence
  • javax.microedition.io.file.* - JSR-75 FileConnection
  • Low-level Canvas API for graphics

Author: DASH ANIMATION V2


๐Ÿ™ Credits

  • Python Software Foundation - Python language
  • Java ME platform - MIDP/CLDC runtime

Last updated: 2024

About

**Python IDE (Py2ME) ** is a complete Python development environment for Java ME (J2ME) MIDP 2.0 devices. It supports both **Python 2** and **Python 3** syntax, includes a built-in interpreter simulator, file management via JSR-75, and a full-screen code editor.

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages