I love Python. I am working on a pet that you can care for and so far I have 440+ lines of script done.
What things in Python have you made? Post your scripts. I'd love to play some games or apps you made.
Offline
Basics:
It's alot like Scratch. Think of it as one large Scratch script but the blocks are written as lines of script.
Making a variable:
variablename = value
If the value is a word, put the value in apostraphes. If it's a list, place brackets like this:
listname = ['item1','item2']
Forever block:
The forever block doesn't exist, but you can do this.
Create a variable called anything you want. Set it to any number.
Use a while (repeat until) to do this:
while variablename == value:
Note:
When setting a value, use =. If checking equality between variables or just one, use an ==. An != means does not equal.
At the end of an if or while, use a : at the end.
Anything inside a "block" has a tab in front of it.
Ifs are used like this:
if (whatever):
You can use an else like this:
if (whatever):
(whatever)
else:Print just displays a message. This is how it's used:
print("insert message here")That's all for now. I'll post more later!
I hope that helped.
Offline
I do have it, but I do very little with it. I'm still working on making sure pygame works.
Offline
For Python, check out the Pyython Library in Advanced Topics!
Offline
I made PY-DOS. I recently remembered about it, and it doesn't work on the command line in Python 3.2. Only IDLE.
It would be nice if somebody could help me out with my problem.
Last edited by ThePCKid (2011-04-18 17:34:12)
Offline
poopo wrote:
I don't know how to do graphics.
![]()
Can you please try to fix my problem (above)?
Oh yeah, try pygame for graphics. You need 2.x for pygame.
Last edited by ThePCKid (2011-04-18 17:44:21)
Offline
ThePCKid wrote:
poopo wrote:
I don't know how to do graphics.
![]()
Can you please try to fix my problem (above)?
I think it was because you used 'input('')' rather than 'raw_input('')'
Offline
ssss wrote:
ThePCKid wrote:
poopo wrote:
I don't know how to do graphics.
![]()
Can you please try to fix my problem (above)?
I think it was because you used 'input('')' rather than 'raw_input('')'
Nope.
Traceback (most recent call last):
File "C:\Users\Owner\Desktop\Hunter\0Pythonstuff\fakeos.py", line 81, in <module>
username = str(raw_input("Enter your desired username: "))
NameError: name 'raw_input' is not definedOffline
ssss wrote:
ThePCKid wrote:
poopo wrote:
I don't know how to do graphics.
![]()
Can you please try to fix my problem (above)?
I think it was because you used 'input('')' rather than 'raw_input('')'
No 'input()' should work fine, although it's not really necessary to tell it to convert to a string, since 'input()' converts the input to the appropriate type of data anyway.
Offline