Forums

ForumsProgramming Forum

Everything Python

Posted Sep 28, '12 at 7:29pm

thepunisher93

thepunisher93

1,863 posts

So, I sometimes like to make itty bitty stuff in python.
I am not a master of it but know its syntax and stuff.
I made this so we can talk about python.

 

Posted Sep 28, '12 at 7:48pm

Salvidian

Salvidian

4,299 posts

I've played around with it here and there but I don't know much about it. It isn't really a necessary language, is it? I mean, it's probably going to be outdated sometime in the near future. Hell, HTML5 was released a few months ago and it's already been upgraded so much its nowhere near what it was when it came out.

What's it even used for? We used it in class for some weird program to make servers run faster, although I doubt it's used for server maintenance.

 

Posted Sep 28, '12 at 8:48pm

BRAAINZz

BRAAINZz

797 posts

I've seen it while looting my school's programs once or twice but never had the motive for it. I'm sure I could get into it, but I need to know two things.

On a scale of 1 to 10, how hard is it to learn?

And Also on a Scale of 1 to 10, how powerful is it?

 

Posted Sep 28, '12 at 8:53pm

SwordmasterQ

SwordmasterQ

29 posts

Python? Are you talking about Monty Python?

 

Posted Sep 28, '12 at 9:00pm

Salvidian

Salvidian

4,299 posts

On a scale of 1 to 10, how hard is it to learn?


I'd give it a rating of 3 in difficulty. I remember it was pretty easy, but there were a few things that could trip you up. I remember writing a page or two of code and have it completely fail because I forgot a character here and there. If I remember correctly, it was as easy to memorize as HTML5.

And Also on a Scale of 1 to 10, how powerful is it?


Python works just like any other server side language. It runs as a CGI process on the server and can access database and output results just like CF, PHP, JSP, and ASP. I would suggest you go to http://python.org and read up on some of its capabilities.
From devshed.com

Looks pretty powerful to me. PHP and ASP aren't too bad, so I'd give it a 7 rating or so.

Python? Are you talking about Monty Python?


No, the server language.
 

Posted Sep 29, '12 at 9:19am

thepunisher93

thepunisher93

1,863 posts

Google uses it in its pages.
its very easy to learn, its not like other weird languages, its syntax is very simple.

 

Posted Sep 30, '12 at 6:14pm

KingLemon

KingLemon

617 posts

Learning python right now actually! We learn C next semester, hopefully by spring if anyone needs help with Python I'll be a natural ;D
For those of you who are used to other languages and are too lazy to look up Python here's an example for you for a scrolling starfield with random color variables!

# Starfield
import pygame
import random
import time

win_width = 800
win_height = 600

# Pygame initialization
pygame.display.init()
screen = pygame.display.set_mode((win_width,win_height))
starfieldSurf = pygame.Surface((win_width * 4, win_height))

# Create the starfield
numStars = 1000
starCount = 0
while starCount < numStars:

x = random.randint(0, win_width*4)
y = random.randint(0, win_height)
size = random.randint(2, 7)
color = (random.randint(50,255), random.randint(50,255), random.randint(50,255))
pygame.draw.circle(starfieldSurf, (color), (x,y), size, 0)
starCount += 2

# Scroll the starfield
x = 0
while x > -2400:

screen.blit(starfieldSurf, (x,0))
x -= 8 #Speed (higher=faster)


pygame.display.flip()
time.sleep(.02)

# Shutdown pygame
pygame.display.quit()
 

Posted Oct 9, '12 at 5:22pm

Kilop1992

Kilop1992

2 posts

I've been using Python for multiple years now, I love the language, but it does have some issues. Like that it is about 100-times-slower than C in lower-level benchmarks. Python also has no way of commenting out multiple lines of code, other than by using the hack of designating such code an extended string with the triple single quote operator, of course. "self" (the Python equivalent of C++ and Java's "this&quot is never implicit in Python: You always have to name it. There's more issues with Python, though I'm not going to have you read through all of it's little issues. Python has those issues in it, but weighing out the disadvantages with its advantages, Python is a great language to use and is very recommended.

 

Posted Oct 24, '12 at 7:04pm

Darkroot

Darkroot

2,879 posts

On a scale of 1 to 10, how hard is it to learn?


Like 2 to 2.5 in languages. There are easier ones but they aren't as flexible as python. 10 is like Haskell which is for seasoned programmers.

And Also on a Scale of 1 to 10, how powerful is it?


Not as many libraries some things are not as fast as C++ so maybe like 6.5 to 7

No, the server language.


No the programming language. There is no server language, I guess you mean database language like PHP.
 

Posted Nov 2, '12 at 11:40am

PhsycoDragon

PhsycoDragon

43 posts

Google AppEngine uses it, so it must be good for something. But how would it compare to Java?

 
Reply to Everything Python

You must be logged in to post a reply!