Jump to content

I keep getting this error: "'.!entry' is not recognized as an internal or external command, operable program or batch file. The system cannot find the path specified." I don't know how to get rid of this. I've tried the "adding python to environments" thing and it does nothing for it. Can someone send me in the right direction. If you need anymore information just ask.

-

Link to comment
https://linustechtips.com/topic/1243042-entry-is-not-recognized/
Share on other sites

Link to post
Share on other sites

11 hours ago, Sauron said:

what are you trying to do?

I'm trying to use the os.system command to instert a command in to the command console to output a text file that is a list of the directory. I'm trying to take inputs from these entry boxes and put them into that os.system command. I also seem to be getting this problem where it bypasses the entry boxes and uses the folder that the file is currentally in.

-

Link to post
Share on other sites

9 hours ago, TheSnowman37 said:

I'm trying to use the os.system command to instert a command in to the command console to output a text file that is a list of the directory. I'm trying to take inputs from these entry boxes and put them into that os.system command. I also seem to be getting this problem where it bypasses the entry boxes and uses the folder that the file is currentally in.

Would definitely recommend posting example code.

Link to post
Share on other sites

14 hours ago, TheSnowman37 said:

I'm trying to use the os.system command to instert a command in to the command console to output a text file that is a list of the directory. I'm trying to take inputs from these entry boxes and put them into that os.system command. I also seem to be getting this problem where it bypasses the entry boxes and uses the folder that the file is currentally in.

if you don't post your code I can't just guess what the problem is

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to post
Share on other sites

7 hours ago, Sauron said:

if you don't post your code I can't just guess what the problem is

 

13 hours ago, JacobFW said:

Would definitely recommend posting example code.

import os
import tkinter as tk

root= tk.Tk()

canvas1 = tk.Canvas(root, width = 300, height = 300, bg = 'gray90', relief = 'raised')
canvas1.pack()

label1 = tk.Label(root, text='Drive:')
label1.config(font=('helvetica', 9))

label2 = tk.Label(root, text='Filepath:')
label2.config(font=('helvetica', 9))

entry1 = tk.Entry (root)
entry2 = tk.Entry (root)

def close_window():
    root.destroy()
    
def command_1(x):
    x = x
    os.system(str(x))

def command_2(y):
    os.system("cd " + str(y))
    os.system("dir > DirOutput.txt")

button1 = tk.Button(text='      Run Command      ', command=command_1(entry1), bg='black', fg='green', font=('helvetica', 12, 'bold'))
button2 = tk.Button(text='      Run Command      ', command=command_2(entry2), bg='black', fg='green', font=('helvetica', 12, 'bold'))
button3 = tk.Button(text='      Kill Program      ', command=close_window, bg='black', fg='Red', font=('helvetica', 12, 'bold'))


canvas1.create_window(150, 60, window=button1) #Button One
canvas1.create_window(50, 20, window=label1) #Top Label
canvas1.create_window(150, 20, window=entry1) #Top Entry

canvas1.create_window(150, 140, window=button2) #Button Two
canvas1.create_window(50, 100, window=label2) #Bottom Label
canvas1.create_window(150, 100, window=entry2) #Bottom Entry

canvas1.create_window(150, 250, window=button3) #Kill

root.mainloop()

-

Link to post
Share on other sites

2 hours ago, TheSnowman37 said:

-

You're using "entry1" and "entry2" as though they were strings when in reality they're just references to a tk.Entry object. You need to get the current string using the get() method as per the documentation.

 

button1 = tk.Button(text='      Run Command      ', command=command_1(entry1.get()), bg='black', fg='green', font=('helvetica', 12, 'bold'))
button2 = tk.Button(text='      Run Command      ', command=command_2(entry2.get()), bg='black', fg='green', font=('helvetica', 12, 'bold'))

 

also next time use code tags.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×