SRL Archive - General

"Batteries Included!"


R0b0t1

2007-10-28 14:03:05

http://www.python.org

Lookie: I found a language more powerful and more simple than Visual Basic.


Its called Python, and you may have heard of it. I've been using it for a while as a 'scripting' language.


Here are the main reasons I like it:

  • It has a very good standard library, with tonnes of other add ons to it made by other people
  • You don't have to compile it into an executable. This makes it good for testing.
  • You can't forget something like "end;", because it doesn't have any! It uses some thing where it looks at the tabs, etc.
  • It is harder to be mixed up with types: there is no type declarations, and casting is simple.
  • Any platform! Just send over the *.py files, and your done!

Heres a simple sample that returns the amount of players playing.


import urllib2

for line in urllib2.urlopen('http://www.runescape.com/title.ws'):
if 'There are currently' in line and 'playing!' in line:
print line

Output:
There are currently ***** people playing!
P.S.: Be careful when typing http://www.python.org in, as the .com site is porn.

Eicca

2007-10-28 14:09:33

I like python too, cool compiler = <3

crossback7

2008-07-09 01:09:39

Meh, I'm trying to get going with this, but I can't get it to re-open my scripts after I save them. I have the path set correctly, and I'm using the latest non-dev version of Python.

I love the language, but I just want to be able to save all my scripts in a file so that I can just call on them, rather than making them into functions that I have to copy and paste into my main one.

Any help would be much appreciated. I'm just getting started with it, not too great with the syntax yet.

Dusk412

2008-07-09 01:19:50

Python can get really complicated unfortunately when you want to do more complex tasks, kinda obvious I know, but it gets extreme in length. I have been using python pretty much since its development. I use it to create and edit Counter Strike mods mwaha.

crossback7

2008-07-09 01:23:22

Well, any help then? Even when I import the module I saved, I can't just run it again by typing the name.

Am I missing the command before I type the name of my module or what?

R0b0t1

2008-07-17 17:09:50

You might need to have them in the same directory, but to run them you do 'python SCRIPTDIR'

boberman

2008-08-21 23:21:48

python is good for simple scripts, and even more complex ones. But please don't write a game in it, it is way too slow for that (see fretsonfire).

Dan Cardin

2008-08-22 10:07:49

having it based upon tabs seems kinda…not cool.

but other than that and a lack of clear tutorials, as far as i can find (minus the one on the python website) it looks pretty O.K.

WhoCares357

2008-08-22 21:48:31

I like a more formal syntax :). I saw some other language similar to this and didn't like it.

Shady?

2008-08-26 23:31:47

P.S.: Be careful when typing http://www.python.org in, as the .com site is porn.


Ohh, i think i know how you found out about python then xD