2017-10-02 07:40:03 (edited by Guitarman 2017-10-21 06:03:42)

Hello.
I changed the name of this topic because I wanted to use it for my questions about python, and other programming topics.
Well I'm working very hard to learn python. I couldn't get pip to work at first but now I've got it working. I'm not a beginner programmer or advanced, I'm somewhere in the middle if that means anything. I understand syntax and how I would code basic things.
So I wanted to create this topic to learn about what fellow programmers find are good or useful python packages. Like I said I have pip working so I can install packages easily, I just don't know what kinds of things i will need from the python package index. I want to make audiogames but I'm definitely willing to try designing other pieces of software. Please tell me about any modules that you find helpful, or easy to use, or just packages that do fun stuff with python.
Thanks I'm eager to see where this topic goes.
I did have a question though, I tried to install pyaudiogame with pip and it says can't find or satisfy requirements. Is this because pyaudiogame was taken off the package index? Is pyaudiogame still being developed at all?

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2017-10-02 10:52:43 (edited by pauliyobo 2017-10-02 10:53:35)

wich version of py are you using?
if you're interested in developing audiogames there are 3 packages created for this purpose
pyaudiogame, i don't know if is longer continued though, and there are few issues with libraries
AGK both of those are for py2.7

for py3, there is
AGK3

or if you want to start them by your own you can learn pygame, pyglet, and sound libraries like soundlib or libaudioverse
i hope this reply could help you  smile

Paul

2017-10-02 13:22:40

Hello,

Try Django. This is an advanced and fast Web framework for Python.

It is a MVC framework primarily designed to make CMS applications, but you can do almost anything.

Cheers,

2017-10-02 23:17:20

Hi. Woops sorry, I did forget to mention that, I'm using python 2.7 latest. Thanks for the suggestions so far!

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2017-10-03 06:22:09

just remembered now, you can try to use even flask, wich is a micro web framework.

Paul

2017-10-03 23:56:56

Hi.
I'm going through learn python the hard way and i'm on exercise five. I typed the code exactly and compared mine with the book's code and they match up. Python tells me invalid syntax or that I need parens after print. What is wrong? I remember I had this problem last time when I did this exercise but I don't remember how I fixed it.
Here is my code-
# This is a variable that tells my name, the next variable tells my age.
my_name = 'Cfb'
my_age = 26
my_height = 74 # inches
my_weight = 240 # lbs
my_eyes = 'Blue'
my_hair = 'Brown'

print ("Let's talk about %s.") % my_name
print ("He's %d inches tall.") % my_height
print ("He's %d inches heavy.") % my_height
print ("He's %d pounds heavy." % my_weight
print ("Actually, that's not too heavy.")
print ("He's got %s eyes and %s hair.") % (my_eyes, my_hair)
print ("His teeth are usually %s depending on the coffee.") % my_teeth
    print ("If I add %d, %d, and %d I get %d.") % (
    my_age, my_height, my_weight my_age + my_height + my_weight)

I know it must be something simple that I'm missing but I can't figure what it is.
Thanks.

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2017-10-04 06:37:18

if you're using python 2.7 you might want to remove parenteses from print
here's your code, try now

my_name = 'Cfb'
my_age = 26
my_height = 74 # inches
my_weight = 240 # lbs
my_eyes = 'Blue'
my_hair = 'Brown'
print "Let's talk about %s." % my_name
print "He's %d inches tall." % my_height
print "He's %d inches heavy." % my_height
print "He's %d pounds heavy." % my_weight
print "Actually, that's not too heavy."
print "He's got %s eyes and %s hair." % (my_eyes, my_hair)
print "His teeth are usually %s depending on the coffee." % my_teeth
    print "If I add %d, %d, and %d I get %d." % (
    my_age, my_height, my_weight my_age + my_height + my_weight)
or if this is not the error can you paste the traceback?

Paul

2017-10-05 01:51:54

@6
The problem is with this line:

print ("He's %d pounds heavy." % my_weight

I'm pretty sure you can figure it out from there.
@7
This shouldn't matter. In fact, I'd leave it this way for cross compatibility

2017-10-06 05:13:13

A few useful packages:

requests - the quintessential library for making http requests of all kinds. The standard library has urllib but requests is much nicer.

boltons - various decorators and utilities that are useful. Some of them are advanced, so they may not be immediately useful to you.

pyglet - a library for game development, includes a publish / subscribe pattern, keyboard hooks, basic sound playback, advanced visual stuff through open GL, etc. If your making audio games and actually want to learn how libraries like AGK and AGK3 do things behind the scenes, you'll probably want this.

pygame - It's similar to pyglet, but I haven't personally used it much so I can't really recommend it; I'm just including it here for completeness of packages you might be interested in.

libaudioverse - an advanced audio library. Coded in c++, but with python bindings, so it's on pypi. Again, if you want to really understand and have full control over audio in games you might make, use this.

twisted - a full-featured networking library. If you need to write a server, a client, a proxy, etc, this is something worth considering. You can use 'socket', which is low-level and from the standard library, but twisted is nicer.

sqlalchemy - an awesome database toolkit. If you need an app to use a database, this is my personal favorite for the job. It has an orm, an object relational mapper, which maps python classes to database tables. A specific class you code represents a table in a database, and an instance of that class represents one row in that db table. In this way you can really easily define a database schema just by defining what a class looks like. I use it all the time in web applications, my game, mud bots, etc. It also supports a bunch of different databases so you can use sqlite when testing locally, and mysql or postgresql when testing on the server and running your app in production.

flask and django - As has been mentioned before, flask is a micro web framework. Normal websites are just a collection of assets that a server reads from disk and streams to clients, which then do things like run javascript, retrieve and apply css, etc. A site can also run a program, (passing in things like the URL, the headers, the client's IP address, etc) and return the response that program came up with to the client. All of this is known as the wsgi, or web server gateway interface (the protocol a server uses to talk to a web app, and vice versa). Packages like django and flask support this out of the box, so all you need to do is tell the framework about a URL you want to have and make a function that returns what you want that URL to return. Both packages have template engines, which let you define html pages that support variables, for loops, macros, etc. If you need to write a web application, either of these would work just fine, though flask is smaller and gives you more freedom as to the pieces you want to use (database, login system, etc).

geocoder - a package to get coordinates from an address or city, or a general location from an IP address.

mbf - Just gonna throw this in. It's a library I wrote for making mud bots. It isn't on pypi yet (one of these days I'll put it up), but it is on my git hub. It still needs some polishing up, but you can define triggers (with regular expressions of course, or not if your lame), timers (using an interval or at a specific time), and it handles connecting and logging into a mud, as long as you provide a few pieces of information. In the future I'll update it so you can register multiple bots on one framework object, as well as giving it the ability to proxy your mud connections (so you can connect to a server running mbf and play as normal, while bots are controlled from your server).

click - If you need to make a command-line program or script that takes more than 1 or 2 options, click lets you easily define what options and arguments you want. If your program is more complex and needs subcommands (think git commit - where commit is a subcommand of git), that's pretty easy to do as well.

wx - If you need to make accesible UIs, wx is pretty much the standard.

cryptography - If you find yourself needing to do light or serious crypto stuff, the cryptography library most likely has what you want.

These were just the ones I could think of off the top of my head. There are a lot more out there, and if one doesn't do quite what you want, you can always make your own.

Regards,
Blademan
Twitter: @bladehunter2213

2017-10-09 00:58:16

You can add Numpy to that list. Its a scientific computing library that provides a number functions written in C for crunching numbers and manipulating arrays of data. Its great if you need to do any heavy lifting or greater flexibility with large amounts of data. Its part of a larger collection of scientific libraries like Matplotlib, scipy, etc. among others for machine learning or genetic sequencing.

There's also PyAL which is a thin OpenAL wrapper, and with a little tweaking Pyglet's OpenAL bindings can also provide advanced audio functions.

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

2017-10-21 06:12:15

Hello.
I've been away from this topic for a while but thanks magurp, and the rest for the recommendations, and helpfully answering my questions.
I have a question about the programming language rust. I know it's a general purpose language, and the syntax looks interesting, I'm wondering does anyone on here use rust or have used it in the past? I'd be interested to hear your thoughts about it. I kno the forum member camlorn did something to the rust compiler, which is where I first heard about rust. I'm curious how fast it is, and if it can be used to make audiogames along with other software. Also I'd like to hear about your experiences with rust, if you found it easy or hard or frustrating or whatever.
Thanks.

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2017-10-21 08:08:23

Rust is similar to c++ without having the pitfalls of c++. I do not recommend it for audiogames atm because it doesn't really have any good 3d sound libraries (though it may have bindings to OpenAl, i'm not sure)

Cam optimized struct fields, documented here:

http://camlorn.net/posts/April%202017/r … ering.html

2017-10-21 22:02:21

Hi.
I see, so it's meant for more serious software development? Would you explain what the pitfalls of C are? I'm familiar with it but have never actually used it. I think it would be handy to know that in the future.
And thanks for showing me that post, it was very interesting. I haven't looked at that blog in a long time.

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2017-10-22 23:13:19

There are a hell of a lot of them, but most of the "pitfalls" of C are because programmers are idiots and forget to do things they really shouldn't forget to do (i.e. release memory after it's used, don't allow a pointer to dangle, etc). As for Python... I don't get why people are so damn obsessed with Python 2. Someone, please explain the logic of that, especially since Python 3.x is clearly superior. In so many ways, too. You can go read the change logs for Python 3.x for really good examples. Also, the reason Rust doesn't have good 3D libraries is because it hasn't really been out there for very long, 3 years at most. In the technological community it's a baby still. You can develop bindings for game development for it though.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github