Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] how do I enter code into python
you're trying to run the interpreter from the interpreter
from command line:
python test.py
>>> - that is the python interpreter, not command prompt
c:\Users\bob> - that is command prompt
so 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
I have opened a cmd and entered the info as below.
how did you install python? the error means that python is not added to your PATH
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 pyserial
But 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
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

Any help would be appreciated.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Disable Enter Key PyQt5 Wizard maffaz 1 92 Jul-02-2018, 09:45 AM
Last Post: maffaz
  [PyQt] enter from py exported by pyqt5 designer to another py file royer14 0 68 Jun-29-2018, 01:45 AM
Last Post: royer14
  [Tkinter] enter data with keypad gray 4 1,135 Feb-11-2017, 10:20 PM
Last Post: Larz60+

Forum Jump:

Users browsing this thread: 1 Guest(s)