Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/Lessons/samples/editor.py does not work #645

Open
Rhababaer opened this issue Jan 14, 2022 · 0 comments
Open

docs/Lessons/samples/editor.py does not work #645

Rhababaer opened this issue Jan 14, 2022 · 0 comments
Labels

Comments

@Rhababaer
Copy link

Bug Report


Expected Behaviour


saving and opening text files should work

Actual Behaviour


produces errors for saveBox and openBox respectively

Any error messages produced by appJar


Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.10/tkinter/__init__.py", line 1921, in __call__
    return self.func(*args)
  File "/home/name/.local/lib/python3.10/site-packages/appJar/appjar.py", line 3783, in <lambda>
    return lambda *args: funcName(param)
  File "/home/name/example.py", line 43, in menus
    if win.textAreaChanged("win"): save()
  File "/home/name/example.py", line 19, in save
    file.write(text)
AttributeError: 'str' object has no attribute 'write'
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.10/tkinter/__init__.py", line 1921, in __call__
    return self.func(*args)
  File "/home/name/.local/lib/python3.10/site-packages/appJar/appjar.py", line 3783, in <lambda>
    return lambda *args: funcName(param)
  File "/home/name/example.py", line 38, in menus
    open()
  File "/home/name/example.py", line 9, in open
    contents = file.read()
AttributeError: 'str' object has no attribute 'read'

Fix

add asFile=True parameter to saveBox and openBox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants