#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0

    Question 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)
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480
    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 and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep 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.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    33
    Rep Power
    3
    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
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0
    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.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    6
    Rep 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
  12. #7
  13. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,841
    Rep Power
    480
    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()
    [code]Code tags[/code] are essential for python code and Makefiles!
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    12
    Rep 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.
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    6
    Rep 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

IMN logo majestic logo threadwatch logo seochat tools logo