0

(Python3) I have created a mini script to remember unknown words but I've a little problem, maybe it's easy to solve.

The script works perfectly when I execute it with the "Python Script.py" but when I try to execute it with the "install" script in / usr / local / bin changing the header with "#!/usr/bin/env python "I get the following error:

English word: Word Traceback (most recent call last):

File "/usr/local/bin/trans", line 95, in "module"

word = input("English word: ")

File "string", line 1, in "module"

NameError: name 'Word' is not defined

I use word = input ('English word:') to store the option.

So, when I set the input like:

Englis word: Example

I got the error, but when I enclosed in quotation marks like:

English word: 'Example'

It works perfect, but why? What's the explanation? And a solution to avoid to add " ' ' "?

Just in case I use Ubuntu.

Beforehand thanks for reading!

lpluispacheco
  • 103
  • 1
  • 7

0 Answers0