piwheels / packages

Issue tracker for piwheels package issues
https://github.com/piwheels/packages/issues
20 stars 5 forks source link

tkterminal: get_output method is responding previous output not current #426

Closed samratahirwar closed 4 months ago

samratahirwar commented 4 months ago

Package name

tkterminal

Package version

all

PyPI URL

https://pypi.org/project/tkterminal/

piwheels URL

https://www.piwheels.org/project/tkterminal/

Python version

I am aware this is the issue tracker for a Python package index specifically for Raspberry Pi

I have checked for duplicate issues

I am the maintainer

More information

    self.terminal = Terminal(pady=5, padx=5)
    self.terminal.shell = True
    self.terminal.linebar = True
    self.terminal.pack(expand=True, fill='both')

def run_terminal(self,command):
    self.terminal.run_command(command)
    return self.terminal.get_output()

in this case the get_output method will return me the output of last command not the current one which processed, if current command is the first command then it will raise error

Traceback (most recent call last): File "/usr/lib/python3.10/tkinter/init.py", line 1921, in call return self.func(*args) File "/mnt/o/a/z/z.py", line 39, in compile_code output=self.get_output() File "/mnt/o/a/z/z.py", line 28, in get_output return self.terminal.get_output() File "/home/xxx/.local/lib/python3.10/site-packages/tkterminal/ternimal.py", line 402, in get_output if self._out or self._err: AttributeError: 'Terminal' object has no attribute '_out'

kindly provide the fix

bennuttall commented 4 months ago

This is not the place to report this issue