Feb-13-2018, 12:41 PM
you're trying to run the interpreter from the interpreter
from command line:
from command line:
python test.py
[Tkinter] how do I enter code into python
|
Feb-13-2018, 12:41 PM
you're trying to run the interpreter from the interpreter
from command line: python test.py
Feb-13-2018, 01:09 PM
>>> - that is the python interpreter, not command promptc:\Users\bob> - that is command promptso open cmd. cd your working directory to be c:\Users\bob and write python test.py if done right it will look like this c:\Users\bob>python test.py
Feb-13-2018, 02:03 PM
I have opened a cmd and entered the info as below.
Feb-13-2018, 02:16 PM
how did you install python? the error means that python is not added to your PATH
https://python-forum.io/Thread-Basic-Par...er-Windows
I used the installer that came with it.
I can't find any way of adding the path now, is it possible without unloading and reloading the python software? I moved the file to the same directory that python is in and made a call in CMD to there this is what I got. I removed the lines 4,5,6&7 as Gribouillis said earlier and I think it has worked, I now have a box called hello world. (Feb-13-2018, 03:01 PM)matelot Wrote: I can't find any way of adding the path now, is it possible without unloading and reloading the python software?Yes but its more complicated and if you mess it up you can mess up windows calls. I would suggest to reinstall python and tick everything pertaining to PATH. https://www.pythoncentral.io/add-python-...l-command/ I would also change to a custom python install path that is shorter than the default appdata one Python will always work in its directory as you are directly calling python from that directory. As for your traceback pip install pyserialBut thats not going to work if you dont have python its path var. Pip would be in the scripts folder....but i would first fix your python to be in the PATH instead
Recommended Tutorials:
Feb-13-2018, 09:04 PM
You don't need pyserial to run a simple tkinter window. The only useful import here is tkinter.
I am hoping to run a program that links an arduino to a mechanical device and the information I have is to use python to do it and provides the program that includes pyserial so I need pyserial.
I am just about to delete the python software and try to reinstall it. I have now reloaded python In fact I found a 64 bit version that I loaded and did a custom load. Ticked the PATH box and saved the files in c;\users\bob\python36. If I put my test file in python36 and remove the references to pyserial it works fine. I assumed that ticking the path box would mean that python would run from anywhere, it seems not, if I put my test file (without the pyserial part) in c;\users\bob and try to run it from there I get a box saying the application was unable to start correctly(0xc000007b) I was hoping this would help with the fact that the pyserial files are elsewhere. I am slowly moving forward but still need to be able to run the file that contains ## Rubik (Hello, World) @ kas 2017 from tkinter import * import serial, time from serial import SerialException import atexit import subprocess root =Tk() root.title('Hello, World') root.geometry('300x300+200+200') ## window size + position root.mainloop()Any help would be appreciated. |
|