saadmairaj / tkterminal Goto Github PK
View Code? Open in Web Editor NEWTerminal widget for Tkinter library.
Home Page: https://pypi.org/project/tkterminal
License: Apache License 2.0
Terminal widget for Tkinter library.
Home Page: https://pypi.org/project/tkterminal
License: Apache License 2.0
This project is awesome! As far as I am aware there is only one error:
When I try to run echo "hi"
or any other [two word] command while not in shell mode, it returns
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/usr/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/home/therealpenguin/.local/lib/python3.9/site-packages/tkterminal/utils.py", line 43, in wrapper
kw['return'] = kw['function'](*args, **kwargs)
File "/home/therealpenguin/.local/lib/python3.9/site-packages/tkterminal/ternimal.py", line 157, in _run_on_return
with Popen(cmd, stdout=PIPE, stderr=PIPE, stdin=stdin,
File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'echo "hi"'
When you run tkterminal on a script that went through pyinstaller it stops working when asked to run files and starts saying that python3 doesn't work and when python is asked to be used it says that none of the imports are working
Is this a bug?
Steps to Reproduce:
printf Hello
in a tkterminal
instance (I'm using shell=True
)Hellotkterminal$
Expected Behavior:
The output should be empty because no command was typed.
Actual Behavior:
/bin/sh: Hellotkterminal$: command not found
Possible Solutions:
1- Distinguish the output of a command from subsequent commands
2- Avoid the problem altogether by adding a newline to the end of each output that doesn't contain it already, and preferably also a terminator character to indicate the lack of an original newline. Sample output from macOS Terminal.app:
When I use in script, it says "ModuleNotFoundError: No module named 'tkterminal'"
When I use "cd" to change directory it will change the directory but it gives this error message: "/bin/sh: line 0: cd: Documents: No such file or directory". Again, this happens after it has changed the directory to Documents
is there any feature to get the cwd of the terminal?
so that you can change the prompt text according to the cwd and make it better..
I'm gonna show you an example of what I mean.
First of all, i'm writing anything in the terminal:
When i'm writing the letter K it clear my line:
Is that normal ? or is my configuration wrong ?
I'm sending you my configuration :
root = tk.Tk() terminal = Terminal( pady=5, padx=5, background=DARK_BACKGROUND_COLOR, borderwidth=4, foreground=LIGHT_GREEN) terminal.basename = "MyPrivacy$" terminal.linebar = True terminal.tag_config("basename", foreground=PRIMARY_COLOR) terminal.pack(expand=True, fill='both') b1 = tk.Button( root, text="Raccourci 1", fg="Blue", command=lambda: terminal.run_command('C:\\', 'y')) b1.pack() root.mainloop()
Sometimes when a user uses the command "Python3" it asks for them to download xcode toolchain or it might crash because it wants to get input
Is there any method to make my code wait until the terminal process is completed like the wait()
function in the subprocess module?
Or is there anyway just to make the terminal widget get destroyed automatically after the terminal process is done?
Do cd / on the terminal and then ls and you get the internal directory of the app even though it should use the external one
When I tried to write /bin/bash or /bin/zsh or sudo su, this error happened
I was hoping to use this for a personal IDE made in tkinter but when I try to run a python script that has an input command it gives the error:
"Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/init.py", line 1892, in call
return self.func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/tkterminal/ternimal.py", line 203, in _on_keypress
or ((insert_idx.column <= self._limit_backspace or False)
TypeError: '<=' not supported between instances of 'int' and 'NoneType'"
Not only this, but when I use the command "python" it also gives that error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.