The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
Learning Python/PyGame/WXPython/ect.
Discuss Learning Python/PyGame/WXPython/ect. in the Python Programming forum on Dev Shed. Learning Python/PyGame/WXPython/ect. Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 11th, 2012, 10:30 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 3
Time spent in forums: 51 m 57 sec
Reputation Power: 0
|
|
Learning Python/PyGame/WXPython/ect.
Hey everyone, I was wondering if someone could point me in the right direction here. I want to learn Python, Pygame, WXPython and any other Python based languages out there, I know a bit of Python (Just enough to make a calculator program(but not one with buttons)) and I know some Pygame(I can make a window and make a sprite that moves around and changes sprite for each direction(only top down, not platform)).
Can someone help me find a place where I can learn all this, I tried looking at the tutorials on the websites, but they don't seem like tutorials, they seem to be more like refrences. Also I can't get books because I spent all my money on a PyGame book that just repeats how to make a puzzle game. Anyone who can help me gets a cookie(not really) 
|

October 11th, 2012, 10:56 AM
|
 |
Contributing User
|
|
|
|
|
python is already a calculator. Show your calculator program!
In my opinion, you ought to learn python well, and learn to use some of the modules. These others you've mentioned, Pygame, WXPython, are python modules.
__________________
[code] Code tags[/code] are essential for python code!
|

October 11th, 2012, 11:04 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 3
Time spent in forums: 51 m 57 sec
Reputation Power: 0
|
|
|
I'm aware that it is already basically a calculator, all I did was ask what the person would like to do and with shich numbers. Also, yes, I know they are modules, but knowing that doesnt not help me program in it. I've been trying to learn for a while but its hard to find a good resource.
|

October 11th, 2012, 03:58 PM
|
|
Contributing User
|
|
Join Date: Mar 2012
Posts: 33
Time spent in forums: 8 h 25 m 17 sec
Reputation Power: 2
|
|
Quote: | Originally Posted by FrogBox I'm aware that it is already basically a calculator, all I did was ask what the person would like to do and with shich numbers. Also, yes, I know they are modules, but knowing that doesnt not help me program in it. I've been trying to learn for a while but its hard to find a good resource. |
ok so basically you want to learn all these modules, they all require a high level of knowledge of python, i'm not saying you are crap at python but make sure you know alot about the already builtin functions of python the modules python comes loaded with as it is the very building blocks of learning to use wxPython and Pygame, stick with just plain old python for the moment, also just to let you know there is a preloaded GUI module called Tkinter try it out and see if you like it
as in regards to resources, the source of where you got the module is generally the best place to look for documentation and tutorials or showcases of functions. there is usually dedicated forums for the likes of wxPython and Pygame so when you move on to those, ask the community they can be very helpful
|

October 11th, 2012, 08:16 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 3
Time spent in forums: 51 m 57 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by Purity_Lake ok so basically you want to learn all these modules, they all require a high level of knowledge of python, i'm not saying you are crap at python but make sure you know alot about the already builtin functions of python the modules python comes loaded with as it is the very building blocks of learning to use wxPython and Pygame, stick with just plain old python for the moment, also just to let you know there is a preloaded GUI module called Tkinter try it out and see if you like it
as in regards to resources, the source of where you got the module is generally the best place to look for documentation and tutorials or showcases of functions. there is usually dedicated forums for the likes of wxPython and Pygame so when you move on to those, ask the community they can be very helpful |
Hey, Cool, didn't know about TkInter, Ima go take a look at it.
|

October 13th, 2012, 08:22 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 6
Time spent in forums: 52 m 16 sec
Reputation Power: 0
|
|
|
Newbie of Python, whut a lovely game !
 i mean, i wanna learn python's language as well as you !
so, let's have a cup of tea; it's a word_count_dict function that read a file, txt one, and that count any words in. (thinking about a classical huh? i wanna learn ! lol)
my code is not working, it have been some weeks i grab on the net, seeking a solution, but no answers !
please help me if you want to, ill check my email everyday !
thanks to you, here is my code !
def word_count_dict(filename):
word_count = {}
compte = 0
input_file = open(filename, 'r')
data = input_file
data = data.replace(' ', '')
data = data.replace('\n', '')
for word in data :
if word in data.keys():
word_count[word]=compte +1
else :
word_count[word]= 1
return word_count
if __name__ == '__main__':
numbers_of_teas(countxt)
main()
not very cool as my code, please answer me huge lessons of code, so i shut up and get the lesson
|

October 13th, 2012, 09:25 PM
|
 |
Contributing User
|
|
|
|
Study python rather than patching together snippets of code you find into an incomprehensible glob.
Code:
'Do we agree this sentence contains eight words?'
# what language are you trying to count?
def word_count_dict(filename):
word_count = {}
compte = 0
input_file = open(filename, 'r')
################ here you'll likely want to read the file ################
data = input_file
################ rather than clumping words ################
#1) replace new line with space character
data = data.replace('\n', ' ')
#2) replace all regular expression of punctuation and white space repeated with a single space.
#3) break the data into words with string.split method.
data = data.replace(' ', '')
for word in data:
if word in data.keys():
################ you'll need to increment word_count[word] The compte variable is of no use that I can comprehend ################
word_count[word]=compte +1
else:
word_count[word]= 1
return word_count
if __name__ == '__main__':
################ there isn't a function named numbers_of_teas ################
numbers_of_teas(countxt)
################ there isn't a function named main ################
main()
|

October 14th, 2012, 10:45 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 12
Time spent in forums: 3 h 47 m 52 sec
Reputation Power: 0
|
|
|
You can download free ebooks for the python language all over the internet. You can also check your local library, I'm sure they have more than a few.
|

October 15th, 2012, 10:30 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 6
Time spent in forums: 52 m 16 sec
Reputation Power: 0
|
|
|
Newbie of Python, whut a lovely game ! Again
cup_of_teas were a relevant code change.
excuse me for my poor english, huh, im francophile.
and i have bought a python's book already !
Practical Programming An introduction to Computer Science using Python.
excuse me for the ad, i didnt notice this site forbid ads.
and about the code, i tell you, it's from the google class python, i can get some ebooks, but i have two or more, and i wanna go to the google class, the videos on youtube i have seen are very good, and i'm at dict and file.
you can see it as i show it :uh im a new user i cant ad the google class as URL !
can you help me on my code? i wanna dict one txt file given by google class teacher, and the text is in english, about alice in .. i dunno where in english, in french lol : alice aux pays des merveilles !
thanks and see ya
Signed a Python 's newbie
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|