|
UberJumper posted:Does anyone know how exactly comtypes rips out all the CLSID information out from COM automon files? I have no idea what/how comtypes works, but have you tried looking at the source? this seems to parse some sort of file and sets clsid on the ones that are of a certain type (CoClass).
|
# ? Jan 21, 2010 15:35 |
|
|
# ? May 27, 2024 06:09 |
|
How would I write something likecode:
|
# ? Jan 22, 2010 06:13 |
|
dis astranagant posted:How would I write something like code:
|
# ? Jan 22, 2010 06:20 |
|
dis astranagant posted:Plus there's the can of worms that is making a 2D list There's no such thing. (PS use NumPy)
|
# ? Jan 22, 2010 08:52 |
|
dis astranagant posted:Plus, there's the can of worms that is making a 2D list (I have a function for that already). Can of worms? code:
|
# ? Jan 22, 2010 18:07 |
|
A A 2 3 5 8 K posted:
Or alternately code:
|
# ? Jan 22, 2010 21:02 |
|
wins32767 posted:Or alternately Yeah, don't know how I was that blind last night. As for the 2d list thing, I'm still in that stage where every feature that's not what I'm used to sucks. Granted, lists are created and accessed just like the arrays in pretty much every other language, 2d lists (once created) are accessed exactly like them and yet I can't create a 2d list just by going foo[x][y]=blah.
|
# ? Jan 22, 2010 21:22 |
|
dis astranagant posted:Yeah, don't know how I was that blind last night. As for the 2d list thing, I'm still in that stage where every feature that's not what I'm used to sucks. Granted, lists are created and accessed just like the arrays in pretty much every other language, 2d lists (once created) are accessed exactly like them and yet I can't create a 2d list just by going foo[x][y]=blah. I don't really understand what you're saying. You can't create a normal list by going foo[x]=blah either. You could use a dictionary if you really want to do that sort of thing I suppose, but you'd be pretty crazy to do that for small matrices.
|
# ? Jan 22, 2010 21:30 |
|
err, more like foo = [1,2,3][4,5,6]. foo[x][y] is how you access it.
|
# ? Jan 22, 2010 22:06 |
|
Seriously, if you want 2D arrays that have features, you should use numpy as already suggested. http://www.scipy.org/Tentative_NumPy_Tutorial
|
# ? Jan 22, 2010 22:19 |
|
And if you can't justify using Numpy, or have no use for the features it gives you, then you probably don't need to be using matrices anyway.
|
# ? Jan 22, 2010 22:44 |
|
Sailor_Spoon posted:And if you can't justify using Numpy, or have no use for the features it gives you, then you probably don't need to be using matrices anyway. I wasn't actually using matrices. I was just trying to make a dull " you paid attention during the dynamic programming review" assignment in my bioinformatics class more interesting by taking the professor up on being able to turn in assignments in any programming language. Didn't feel like going too screwy, so I went with python.
|
# ? Jan 22, 2010 22:56 |
|
dis astranagant posted:I wasn't actually using matrices. I was just trying to make a dull " you paid attention during the dynamic programming review" assignment in my bioinformatics class more interesting by taking the professor up on being able to turn in assignments in any programming language. Didn't feel like going too screwy, so I went with python. Trust me, check out numpy. It will make your life incredibly easy if you are doing any sort of numerical work in python, and performance wise its a very easy way to make python competitive with more low-level languages while still retaining a very powerful high level interface.
|
# ? Jan 23, 2010 01:56 |
|
Just learned that ending files with .pyw lets you run them without the console on Windows. I'm really enjoying PyQt4. You use the Qt Designer to define the layout and write boilerplate, then you can just work with the guts. Do any of the other UI toolkits have WYSIWYG UI designers? Scaevolus fucked around with this message at 22:19 on Jan 23, 2010 |
# ? Jan 23, 2010 22:16 |
|
Scaevolus posted:Just learned that ending files with .pyw lets you run them without the console on Windows. I use Glade for PyGTK programming. There's also Gazpacho on Linux for GTK.
|
# ? Jan 23, 2010 22:35 |
|
Anyone know if there is a easy way to do gravity rotations for vertical text in pygtk-pango? I can do it using c, but I can not find the bindings for Matrix and gravity stuff in the python bindings.
|
# ? Jan 24, 2010 00:25 |
|
Edit: doublepost
maskenfreiheit fucked around with this message at 01:22 on Mar 13, 2017 |
# ? Jan 25, 2010 04:50 |
|
GregNorc posted:Is there a way to quickly make a GUI python program? PyQT and PyGTK are probably your best bet. The designer applications for each (Glade, QT Designer) will generate XML descriptions of the UI that you then load in Python. You'll write relatively little UI code in Python and work mostly with application logic.
|
# ? Jan 25, 2010 05:14 |
|
GregNorc posted:Is there a way to quickly make a GUI python program? PyQt is really easy. http://diotavelli.net/PyQtWiki/Creating_GUI_Applications_with_PyQt_and_Qt_Designer General procedure: 1) Use Qt Designer to design your UI. It's WYSIWYG and very easy to use. 2) Run pyuic4 on the .ui file created by Designer, generating a Python module that sets up the GUI. 3) Write a main python file that subclasses the generated UI module and add logic.
|
# ? Jan 25, 2010 06:55 |
|
GregNorc posted:Is there a way to quickly make a GUI python program? If you're running Ubuntu, this is the easiest method to get up and running: https://wiki.ubuntu.com/Quickly
|
# ? Jan 25, 2010 07:21 |
|
I'm trying to figure out how to add up all the integers in a list (or recursively all the lists it contains). I think the idea of the assignment is to base it on Ackermann's function (with the stipulation of no loops):code:
code:
|
# ? Feb 2, 2010 04:01 |
|
well, there's a couple of cheeky ways to sum lists in python: sum(int_list) reduce(lambda x, y: x+y, int_list) but if you're staying on assignment, seems like this is a good way to roll it: code:
print sum_ints([1,2,3]) code:
code:
alright, I have a question: what's the proper way to implement collections.Iterator in my object. I defined my next() (even though collections implies you definite __next__, only next() is called) method to something like this: code:
code:
but I change next to be something like "yield_init_file" and do: code:
I've never delved deep into iterators for my own classes, so there's some subtlety I'm missing. Lurchington fucked around with this message at 04:58 on Feb 2, 2010 |
# ? Feb 2, 2010 04:26 |
|
Choose one of the following: 1. Return some other iterable object: code:
code:
code:
|
# ? Feb 2, 2010 05:05 |
|
2 + 2 = 5 posted:I'm trying to figure out how to add up all the integers in a list (or recursively all the lists it contains). code:
|
# ? Feb 2, 2010 13:25 |
|
Lurchington posted:Bunch of helpful stuff This is great, but it fails when the list is further nested (i.e. sum_ints([[[[3]]]]) should return "3"). This would be a snap to do using loops but they've stipulated only to use recursive function calls.
|
# ? Feb 2, 2010 18:07 |
|
Based on what Lurchington wrote, I adjusted it to be as such:code:
|
# ? Feb 2, 2010 18:29 |
|
Awesome - thanks for the help.
|
# ? Feb 2, 2010 18:54 |
|
2 + 2 = 5 posted:This is great, but it fails when the list is further nested (i.e. sum_ints([[[[3]]]]) should return "3"). This would be a snap to do using loops but they've stipulated only to use recursive function calls. I wasn't sure based on the problem statement if it was a more lists ("it" being the arguments list) vs nested list ("it" being the 1 list argument with lists inside of it) thing. No prob. --- Thanks Milde, I went with #2. I wish the difference between iterator and iterable was more clear at the time Lurchington fucked around with this message at 02:57 on Feb 3, 2010 |
# ? Feb 3, 2010 02:25 |
|
code:
nbv4 fucked around with this message at 23:14 on Feb 4, 2010 |
# ? Feb 4, 2010 23:12 |
|
nbv4 posted:
Install svn / subversion on the production box.
|
# ? Feb 5, 2010 00:38 |
|
m0nk3yz posted:Install svn / subversion on the production box. oh snap that did it. thanks
|
# ? Feb 5, 2010 01:57 |
|
Kind of a question about specific modules, but maybe one of you guys will have more experience than I with either of these and point me in the right direction. I've written an app using the wck library (widget construction kit, see https://www.effbot.org), in addition to the wckGraph module. What I'd like to do, is take the output of one of my windows (happens to be a graph), and save it as a *.png or *.gif. I was planning on using the PIL for this. I'd like to use the code I have as is, without re-writing all the graphic calls to use PIL methods. WCK uses its own "pixmap" class for storing images in memory. I can't find any documentation or class reference for pixmap and what I find in the source is confusing. Does anyone have any direct experience with these libraries that can tell me that there's some super easy thing I'm missing? I'd love it if the wck pixmap is compatible with PIL. I don't have the time to mess with it unless I know its going to work. One thing that's frustrating is if I was writing this in c/c++, getting a bitmap from the screen would be trivial. It may be trivial in python as well, but I just don't know how to do it!
|
# ? Feb 5, 2010 04:48 |
|
I'm working with the gdata-python-client code, but have hit a wall. I'm trying to change permissions on a document, but for some reason GetAclLink() returns None even though the GDataEntry contains an accessControlList:code:
code:
code:
|
# ? Feb 5, 2010 12:54 |
|
Seems like a bug in their code maybe? If I print out link.rel for the entry, I only get: code:
I'm writing an issue on their page with more details. In the meantime, this works for me: code:
Carthag Tuek fucked around with this message at 13:30 on Feb 5, 2010 |
# ? Feb 5, 2010 13:24 |
|
I wouldn't be suprised if it's a bug in their code, some parts of the gdata lib are completely out of date (the contacts part for example uses version 1 of an API that's at version 3).
|
# ? Feb 5, 2010 14:18 |
|
Anyone have any experience with numpy? I have an array of numbers that I need the outliers removed from. I'm thinking this sort of thing is right up numpy's alley. I have a dynamically generated lists of floats, where 99% of the numbers will be between 50 and 100 (for instance), but there may also be a few numbers in the 800 range. Basically I'm sending those numbers off to be plotted onto a histogram, and in some of the graphs, a single huge value makes the real data squished on the histogram. I just need some way to snip those unwanted huge values away. I'm not really a stats person, so I don't know where to look for such a function.
|
# ? Feb 8, 2010 06:37 |
|
nbv4 posted:I'm not really a stats person, so I don't know where to look for such a function. Well, the main problem is that what you're looking for isn't exactly a function (but it owns): code:
code:
Avenging Dentist fucked around with this message at 14:43 on Feb 8, 2010 |
# ? Feb 8, 2010 14:36 |
|
Avenging Dentist posted:Well, the main problem is that what you're looking for isn't exactly a function (but it owns): I have no use for numpy, but I can see that that feature does own!
|
# ? Feb 8, 2010 18:01 |
|
Avenging Dentist posted:Well, the main problem is that what you're looking for isn't exactly a function (but it owns): I was thinking something more automatic. Like if I had [1,2,3,4,850] it would remove 850 as it is an outlier. Whereas [850,851,855] will be untouched since theres no outliers. I guess I could always just separately calculate the correct range, then manually filter out the values outside of that range, but thats for the small statistics questions megathread I guess lmao.
|
# ? Feb 8, 2010 18:43 |
|
|
# ? May 27, 2024 06:09 |
|
Ok so strip out all elements more than a standard deviation from the mean:code:
|
# ? Feb 8, 2010 19:13 |