Jump to content

Python is weird

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Sionofdarkness

Sionofdarkness

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 384 posts
I'm playing around with Python and it's not like any other language. It's like you can only do one simple thing and then you press "Enter" and whatever you typed in comes out. For example, you type print "Hello" and press Enter and then Hello comes out, but how do you write more advanced programs, like If-Then stuff.

#2
Guest_priorityone_*

Guest_priorityone_*
  • Guests
Hi, I came across this article that may help you with learning program with Python: Please let me know if this helps any?

A Tutorial Introduction to the Python Programming Language > Running Python

#3
Matt

Matt

    Learning Programmer

  • Members
  • PipPipPip
  • 47 posts
It sounds to me like you are using IDLE (a Python IDE). I believe that if you click New Window (Ctrl+N) in the File menu, it will open up a new window in which you can type multi-line code that does not execute line by line after each return. You may want to check out IDLE - an Integrated DeveLopment Environment for Python, the site for IDLE on Python.org. Hope this helps.

#4
Guest_Ludwig_*

Guest_Ludwig_*
  • Guests
Let me assure you that Python is not weird. You just got caught in the Python Shell program, the one with the goofy >>> prompts. That utility is for testing short lines of code.

If you read through Python tutorials, you find a lot of this silly >>> shell code as examples. It really does a diservice to Python since it royally confuses any beginner and discourage them from using Python. I was one of those people.

Regular Python code is written in an editor, saved as a file with a .py extension. In Windows you can just double click on the file and python.exe will compile and interpret/run it. Actually it is best to use one of the many Python editors, where you run your code right from the editor. They also do other handholding chores like indentation, code completion, error detection and so on.

One of the better Python editors is PyScripter (written in Delphi), google for it, it is free.