PDA

View Full Version : "Batteries Included!"



R0b0t1
10-28-2007, 06:03 PM
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
10-28-2007, 06:09 PM
I like python too, cool compiler = <3

crossback7
07-09-2008, 05:09 AM
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
07-09-2008, 05:19 AM
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
07-09-2008, 05:23 AM
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
07-17-2008, 09:09 PM
You might need to have them in the same directory, but to run them you do 'python SCRIPTDIR'

boberman
08-22-2008, 03:21 AM
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
08-22-2008, 02:07 PM
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
08-23-2008, 01:48 AM
I like a more formal syntax :). I saw some other language similar to this and didn't like it.

Shady?
08-27-2008, 03:31 AM
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