|
Not sure if this is worth putting in the OP but I'm brand new to coding and this is helping a lot
|
# ? Apr 25, 2010 22:46 |
|
|
# ? May 11, 2024 09:02 |
|
zelah posted:Not sure if this is worth putting in the OP but I'm brand new to coding and this is helping a lot Added.
|
# ? Apr 26, 2010 01:50 |
|
I went back about 30 pages and didn't see anything so I'll pose the question: I'm interested in playing developing a sprite-based game using either pygame or pyglet. I've searched around for comparisons of the two, and the general consensus seems to be that pyglet's not the best at sprite manipulation, though otherwise the two are comparable despite pygame's infrequent updates. But all of these comparisons seem to be a good year or two old. Is it still the case that pygame is the better way to go here?
|
# ? Apr 26, 2010 19:37 |
|
loving comtypes. If anyone has any ideas to how to deal with these things i would absolutely love to know. 1. There is a handful of interfaces/coclasses that are not being picked up by comtypes typelib parser. Now i thought this was simply because of me monkey patching / reworking chunks of their automatic code generation. However after spending a night debugging / struggling i pretty much found out they just are not getting extracted from the typelib. However visual studio / some other random tools reports they are there. Looking through the source of how comtypes makes me want to . 2. Comtypes appears in certain situations to be doing a double release. This occurs kinda at random and i cannot nail this down to a single problem, however i am pretty sure it has to do with me overloading __new__ for interfaces, and calling the baseclass new. However this seems to be somewhere screwing with all the bullshit contained in _cominterface_meta. 3. I still have not found a a good way to handle COMMethod, since in certain cases i would love for the user to be able to get the HRESULT in certain situations. Like an optional parameter that takes an HRESULT object, and fills in the values. Right now anything that is S_XXX, just gets tossed away. However when HRESULT tells you information you need that is not an error, your hosed. Looking through the code i noticed you can add a private method that instead will be called. E.g.: IRaster::GetPixelCoordX(__in row, __in col, __out output_value ) code:
Also why would you ever name a class like this...? code:
|
# ? Apr 29, 2010 15:56 |
|
Here's another reason NumPy owns. I had an array of vertices [A, B, C, ..., N] and wanted to make a perimeter of line segments out of them by passing them to a function that took them as [A,B, B,C, C,D, ... M,N, N,A]:code:
|
# ? Apr 29, 2010 21:16 |
|
Avenging Dentist posted:Here's another reason NumPy owns. I had an array of vertices [A, B, C, ..., N] and wanted to make a perimeter of line segments out of them by passing them to a function that took them as [A,B, B,C, C,D, ... M,N, N,A]: Yowza! Numpy is probably the single most amazing library for python. It actually makes doing number crunching fun, and I don't even know how to use 1/10th of the functionality in it.
|
# ? Apr 29, 2010 21:27 |
|
UberJumper posted:Also why would you ever name a class like this...? Knowing absolutely nothing about comtypes, I would guess it's intended to be used as a shorthand "operator" to prepare data for further use. Something like this: code:
e: this of course doesn't take into account that it appears to be inheriting a factory class, which is just bizarre, I can't begin to image why you would do that. MaberMK fucked around with this message at 22:34 on Apr 29, 2010 |
# ? Apr 29, 2010 22:27 |
|
MaberMK posted:Pylons uses a similar concept, assigning _ as a reference to ugettext. Making ugettext _ isn't just a pylon's thing, it's nearly universal, cross language.
|
# ? Apr 29, 2010 23:07 |
|
king_kilr posted:Making ugettext _ isn't just a pylon's thing, it's nearly universal, cross language. Noted. I pretty much stick to Python, I don't get out much.
|
# ? Apr 30, 2010 03:03 |
|
I'm writing a small(ish) program that requires a database. I'd like end-users to be able to use either SQLite or MySQL. This is a little out of my comfort zone, but I guess SQLAlchemy is what I need to look in to? Is there anything lighter weight that I may want to consider?
|
# ? May 1, 2010 22:23 |
|
Thermopyle posted:I'm writing a small(ish) program that requires a database. I'd like end-users to be able to use either SQLite or MySQL. Just use SQLAlchemy.
|
# ? May 1, 2010 22:48 |
|
king_kilr posted:Just use SQLAlchemy. I think what you mean to say was "the only thing you should ever even consider using to work with a database is SQLAlchemy."
|
# ? May 2, 2010 01:49 |
|
You might also consider using Elixir with SQLalchemy. Reportedly, it's better suited for simple projects than SQLalchemy's default declarative system.
|
# ? May 2, 2010 02:16 |
|
MaberMK posted:I think what you mean to say was "the only thing you should ever even consider using to work with a database is SQLAlchemy." Nope, I've never even used SQLAlchemy for a real project. I'm the guy who implemented multi-db for django
|
# ? May 2, 2010 02:50 |
|
Haystack posted:You might also consider using Elixir with SQLalchemy. Reportedly, it's better suited for simple projects than SQLalchemy's default declarative system. This looks cool, and I'm now leaning towards using this. Thanks. The cool thing I just figured out is that SQLAlchemy supports MySQL Connector/Python (native python Mysql) which means that all this should be Eventlet compatible!
|
# ? May 2, 2010 16:54 |
|
I am having some problems with modules. I am a terrible beginner and resort to COBOL for this problem. I will introduce the code first. Notice the directory placement. documents/urine/butthole.py code:
code:
What is wrong here?
|
# ? May 2, 2010 22:20 |
|
What version of Python? Edit: Do you have an __init__.py in that dir? It can be empty
|
# ? May 2, 2010 22:30 |
|
Notice the wording, "current directory". It is not the current directory of the module, it's the current directory where the starting script was run. I assume TextWrangler is running from documents or its parent directory. You either need to add urine to the pythonpath, (which you can do from butthole but is not recommended) or you need to import from the full path from the root of the package 'from urine.butthole import *' assuming that the packages have an empty __init__.py script. Someone correct me if I'm wrong.
|
# ? May 2, 2010 22:34 |
|
hlfrk414 posted:Notice the wording, "current directory". It is not the current directory of the module, it's the current directory where the starting script was run. I assume TextWrangler is running from documents or its parent directory. You either need to add urine to the pythonpath, (which you can do from butthole but is not recommended) or you need to import from the full path from the root of the package 'from urine.butthole import *' assuming that the packages have an empty __init__.py script. Someone correct me if I'm wrong. haha this is the first thing I thought of when I read your reply.
|
# ? May 3, 2010 00:26 |
|
I'm trying to create a dynamic 2D array. A comparable thing might be an arraylist of arraylists in Java. Is this possible in Python?
|
# ? May 3, 2010 21:27 |
|
armed2010 posted:I'm trying to create a dynamic 2D array. A comparable thing might be an arraylist of arraylists in Java. Is this possible in Python? Yes?
|
# ? May 3, 2010 21:46 |
|
shrughes posted:Yes? Thanks for your help. I've Googled this, otherwise I wouldn't be asking this question. Could you perhaps gift me with the syntax of declaring such an array?
|
# ? May 3, 2010 21:58 |
|
code:
|
# ? May 3, 2010 21:59 |
|
armed2010 posted:Thanks for your help. Hey, you're the one who asked a stupid question.
|
# ? May 3, 2010 22:11 |
|
Avenging Dentist posted:
Thanks!
|
# ? May 3, 2010 22:13 |
|
Avenging Dentist posted:
|
# ? May 3, 2010 22:18 |
|
shrughes posted:Hey, you're the one who asked a stupid question. Did I ruffle your feathers oh mighty goonsir? Durp durp.
|
# ? May 3, 2010 22:33 |
|
armed2010 posted:Did I ruffle your feathers oh mighty goonsir? Durp durp. Perhaps you shouldn't assume that "this is how you'd do something in one language" is enough context to provide a remotely useful answer. My "answer" probably isn't what you actually want.
|
# ? May 3, 2010 22:38 |
|
armed2010 posted:I'm trying to create a dynamic 2D array. A comparable thing might be an arraylist of arraylists in Java. Is this possible in Python? It is, and you could do it basically the same way: code:
|
# ? May 3, 2010 23:30 |
|
I'm having some stupid problem where I installed psycopg2, it said I need mx.datetime which I thought I had, so I re-installed that and now python can't see the module psycopg2 and won't import it. Other modules in my python2.6 folder import, what could cause this? edit: pythonpaths are correct, module is where all the others are LuckySevens fucked around with this message at 00:11 on May 4, 2010 |
# ? May 3, 2010 23:54 |
|
zelah posted:Not sure if this is worth putting in the OP but I'm brand new to coding and this is helping a lot Thanks so much for this, now I'm having fun looking at all the other courses too.
|
# ? May 4, 2010 00:09 |
|
LuckySevens posted:I'm having some stupid problem where I installed psycopg2, it said I need mx.datetime which I thought I had, so I re-installed that and now python can't see the module psycopg2 and won't import it. Other modules in my python2.6 folder import, what could cause this? a) AFAIK mx isn't required for psycopg2 b) Just pip install it, save yourself the pain.
|
# ? May 4, 2010 00:40 |
|
Yeah I did that and now it works. Why I don't know
|
# ? May 4, 2010 01:00 |
|
outlier posted:It is, and you could do it basically the same way: That's excellent and exactly what I'm looking for! None of the links I searched showed anything like that. Thanks!
|
# ? May 4, 2010 01:25 |
|
Kire posted:Thanks so much for this, now I'm having fun looking at all the other courses too. I agree, there is a course specifically for python introduction in there I found that is a 4 week class apparently. I'm about to start my summer projects of get my CCNA and learn Python so this will help.
|
# ? May 4, 2010 02:40 |
|
armed2010 posted:That's excellent and exactly what I'm looking for! None of the links I searched showed anything like that. Thanks! Why would you expect them to? Lists of lists aren't special.
|
# ? May 4, 2010 02:40 |
|
So, anyone played with repoze.bfg and has an opinion to share? I'd ignored the project for a long time because of its association with Zope ("Zope - for when you've got just too much free time") but a recent visit to it has reignited my interest: * Fully unit tested, fully documented * Actually breaks out some of the Zope architecture into genuinely standalone components * Runs on UNIX, Windows, Jython and Google App Engine * Persistence-agnostic: SQLAlchemy, ZODB, CouchDB, etc
|
# ? May 5, 2010 21:53 |
|
Is there anyway to make a python list iterator to go backwards? Basically i have this code:
a 1 2 3 Crap i skipped C I know why it gives me the output, however is there a way i can step backwards in the str() method, by one step?
|
# ? May 5, 2010 23:24 |
|
UberJumper posted:I know why it gives me the output, however is there a way i can step backwards in the str() method, by one step? No. Why not do this? code:
|
# ? May 5, 2010 23:41 |
|
|
# ? May 11, 2024 09:02 |
|
Scaevolus posted:No. Why not do this? Because that makes grouping subelements difficult. Essentially i am looking for bidirectional iteration support within python.
|
# ? May 6, 2010 00:10 |