2016-12-21 16:47:31

Hi all. Well i am trying, really trying to learn python for a long time, But each time i tryed use an example i lost the battle Lol. I really cannot understand it. For example, People here making requirements.txt files, to use with pip, But those files also does not work. I get most or even all of the required plugins, but I don't know why i cannot get the games work. Everytime i got an error about this function could not be found or this plugin doesn't exist, blah blah blah.
The second thing is I cannot find a complete tutorial or a none-complecated tutorial for learning plugins like pygame or libaudioverse. I really like to learn python but this complicated things preventing me to get around python.
the 3th thing is that i cannot understand some codes correctly. Specially when there are lots of :'s or _'s.
Please if you think that you can help me even a bit do it! I really like to learn python as bgt does not do what i like to do and some times it needs lots of codings to do something littel. I have downloaded the shooter game from a website that i cannot remember correctly, and mason's audio game engine. But i could not get none of them to work. Any helps really, really really a pritiated.
Thanks for reading and best regards.

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2016-12-22 02:17:22

How much experience do you have with Python overall? I wouldn't recommend using peoples engines or learning API's just yet if you don't have a good understanding of the fundamentals. Having said that I can try and answer your questions and offer what assistance and I can, although most of my experience is in Pyglet and PyAL.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-12-22 14:05:15 (edited by kianoosh 2016-12-22 14:07:26)

Well, I have enough experience to work with a simple library, But the thing is there are not any tutorials for most of the libraries. I just could find a very small one for pygame, In it's docks folder, and of course, I could get it to work a bit, But not further.
I'm currently learning more from tutorialspoint.com website, But i had experience before i start learning from that website though.
I really need some simple examples but there are not anything. Or probably i could not find any.
I learnt most of the bgt by tutorials, So i'm sure that i need some examples for python as well. For example, I want to learn how to play a sound. How to work with a timer. How do i work with key press and key down things(I do not know anything about this currently. Just a fiew things about pygame). I need to know how can i have my own title(Means that i want my program have a title and i want to work with it without CMD).
thanks

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2016-12-23 08:30:29

There are a number of tutorials online depending on where you look, such as [here] on pygames website or the [Invent with Python] book, although their relevance to audiogames and accessibile subjects may vary.

You may find reading the [API Documentation] useful, as it describes all of pygames functions, what they do, and how to use them. To start with you may be interested in [pygame.mixer] for sound, [pygame.key] for keyboard input, and [pygame.time] for timing. Keep in mind that a lot of the time learning to program can involve a lot of trial and error, its one of those occupational hazards, heh.

Here's an example demonstrating how to create a window, play a sound, capture key events, and setup timed events:

import pygame
import sys

#main class
class example(object):
    def __init__(self):
    #initialize pygame
        pygame.init()
    #set the title of the window
        pygame.display.set_caption('Example')
    #create the window and make it 640 by 480
        self.screen = pygame.display.set_mode([640,480])
    #fill the screen with the color white
        self.screen.fill([255,255,255])
    #start updating the screen so changes are applied
        pygame.display.update()

    #initialize audio
        pygame.mixer.init()
    #load the sound file
        self.sound = pygame.mixer.Sound('sound.wav')

    #get timer ticks for pacing events
        self.last = pygame.time.get_ticks()
    #set the amount of time that passes before the event is triggered
        self.trigger = 300


#main update loop
    def update(self):
        while True:
        #get time ticks
            now = pygame.time.get_ticks()
        #check if evough ticks have passed, if so update last ticks and trigger
            if now - self.last >= self.trigger:
                self.last = now
                print 'event triggered'

        #sort through key/mouse events
            for event in pygame.event.get():
            #if user tries to close window, shutdown program
                if event.type == pygame.QUIT:
                    pygame.quit()
                    sys.exit()
            #if user presses a key
                elif event.type == pygame.KEYDOWN:
                #if that key is the space bar
                    if event.key == pygame.K_SPACE:
                    #play sound
                        self.sound.play()


#load the main class program on startup
if __name__ == '__main__':
    run = example()
    run.update()
-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-12-23 11:01:25

Thanks a lot, That was really helpful. But the thing is i'm trying to use tolk with the example you gave me, But i get an error, when tolk wanna load the dll. It says %1 is not a valid win32 application. I got this error for another dll loading too. Should i reinstall my python? I think i'm using python v7.11. Which version do you recommend?

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2016-12-23 11:25:33

I'm not familiar with Tolk, it appears to be translation software? I'm not sure what it may be doing, which DLL's are it not loading?

Python has two major branches, version 2.7, and version 3.5.  Due to some changes when version 3 was made it broke compatibility with many useful API's python uses, such as Pygame. Thats no longer the case but there are still a few issues here and there, and documentation for version 3 isn't quite as plentiful as with version 2. I would guess your using 2.7.11, which is fine as is.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-12-23 21:39:12

Tolk is a thing which allows the screen reader to speak something. And that other dll was called shareit.
BTW? Which library can i use to program accessible gui applications?
tkinter is not accessible, I haven't try WX python yet, But i think i have it installed.

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2016-12-24 10:29:38

Ah, I don't have any experience using Tolk so can't help much there, although pyttsx and accessible_audio2 are also good for TTS output. Wxpython does seem to be good for gui applications and is screen reader accessible, although i'm still workinbg my way through it at the moment.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-12-24 18:28:03

Right, But i really cannot understand this problem. Most of the libraries that i install, Not most of them, But some of them like this, wxpython, steel or pyttsx, Seams they do not install well into my PC. You know what, For example when i use:
app=wx.app()
It says module does not have anything called app, Something like that, As well as frames.
I'm installing them all vai pip, And i use pip install library name. Really cannot understand this problem. I'm using win8.1, X64. And i have an x64 version of python installed as well.
This is why i said i cannot use mason's audio game engine. I have all this problems, And i cannot understand them. They seams to be installed well, But the fact is they are not installed completely, Or maybe i'm wrong.
Any tips, really really a pritiated.

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2016-12-25 01:34:19

Is that how you spell it exactly? The issue could be capitalization, along with spacing and spelling Python is also capitalization sensative. So you'd have to write wx.App() with a capital A, same with wx.Frame with a capital F. Some libraries have more capitalization than others.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-12-25 20:44:55

I did thesame. And wx is installed in my site-packages folder.

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2016-12-26 10:15:15

Hmm, i'm not sure. It could be a linking issue, or maybe a 32/64 bit issue. Here's a simple wxpython hello world script, if that doesn't work you could try reinstalling wxpython.

import wx

app = wx.App(redirect=True)
top = wx.Frame(None, title="Hello World", size=(300,200))
top.Show()
app.MainLoop()
-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer