Python Forum
Just starting out, allready stuck..
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Just starting out, allready stuck..
#11
The "prompt" is the invite sign that is shown at the beginning of each line. If you open a terminal window (menu start, run cmd), you see a prompt like C:\User\myname. If the prompt you see is something like >>>, it means that you are already inside the python program. Type print("hello") and then you should see Hello on the next line, then the prompt again.
Reply
#12
(Jan-06-2018, 07:36 PM)Gribouillis Wrote: It won't work in the python shell. The cd command works in a terminal/console. But Geany has probably a keyboard shortcut to run the program.
i've been trying it in a terminal, no succes...

yeah i know it does, but the exercise is to run the program from a terminal :)

But it's OK, guys... i'll just skip this one. Maybe i'll learn how to fix it when i progress through the book
Reply
#13
Windows? If you hit CTRL+R and type cmd then hit Return it will open a terminal window. This is called terminal.
If you type python into that terminal and hit Return the Python interactive interpreter will be opened. You will recognize it by >>> prompt.

So, writing a script and save it in a .py file? In order to run it, you have to do it in the cmd. The first one.

Actually Win+R

Pff
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#14
Look at this Python 3.6 and pip installation under Windows, part-2
It's important to install correct so python and pip is in environment variable Path of Windows.
Here a run with cmd from start,i have this hello.py in folder C:\foo
print('hello world')
Start cmd nothing is hided all from start.
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. Med enerett.

C:\Windows\System32>cd\

C:\>cd foo

C:\foo>python hello.py
hello world

C:\foo>python
Python 3.6.2 (v3.6.2:5fd33b5, Jul  8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 2 + 4
6
>>> print('Now in interactive interpreter')
Now in interactive interpreter
>>> exit()

C:\foo>pip -V
pip 9.0.1 from c:\python36\lib\site-packages (python 3.6)

C:\foo>
This most work,if not follow install in link first.
Reply
#15
(Jan-06-2018, 11:43 PM)wavic Wrote: If you hit CTRL+R

I believe that should be "Windows button + R"

I would also suggest deleting your current file, and rewrite and save it using Notepad. Geany is a good IDE, but there are settings and things to remember when using it. While things are still simple, it's ok to use a plain text editor. This will give you time to learn how to properly setup and use Geany.
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#16
(Jan-07-2018, 12:34 AM)sparkz_alot Wrote:
(Jan-06-2018, 11:43 PM)wavic Wrote: If you hit CTRL+R

I believe that should be "Windows button + R"

I would also suggest deleting your current file, and rewrite and save it using Notepad. Geany is a good IDE, but there are settings and things to remember when using it. While things are still simple, it's ok to use a plain text editor. This will give you time to learn how to properly setup and use Geany.
Right! My mistake Cool
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#17
(Jan-06-2018, 11:43 PM)wavic Wrote: Windows? If you hit CTRL+R and type cmd then hit Return it will open a terminal window. This is called terminal.
If you type python into that terminal and hit Return the Python interactive interpreter will be opened. You will recognize it by >>> prompt.

for some reason, using this method to open a terminal, it worked :D thanks.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020