Hi everyone,
I'm trying to inherit QSqlTableModel to make data im my table display in way i need.
class TableViewModel(QSqlTableModel):
def __init__(self):
super(TableViewModel, self).__init__()
def flags(self, modelIndex):
if not modelIndex.isValid():
return
if modelIndex.column() != 1 and modelIndex.column() !=...
I'm wondering if anyone have a good resource for working with Corba in Python? I've googled around and saw that fnorb was recommended by some, but that it doesn't support some new features in Corba. Omniorb seemed like a good alternative, but I have no idea how to use it with Python (not fnorb either).
Any advice is appreciated, I've on...
I'd like to use the somelist.sort() method to do this if possible.
I have a list containing objects, all objects have a member variable resultType that is an integer. I'd like to sort the list using this number.
How do I do this?
Thanks!
...
xml.etree.ElementTree.parse is choking on my xhtml file. I saw somewhere that lxml can handle html. Can someone tell me the documented way to parse, and then alter, xhtml? I want to add some javascript to xhtml on the fly.
...
Could someone explain to me how can I run my py2exe program, a console program, without the terminal on Windows?
I'm trying to make a program that re-sizes windows and it supposed to start with windows, so I want it hide out but still running...
...
How can I do it, even if my application.exe isn't the focused window ?
For example, like the Windows + D shortcut... Works everywhere...
I want that ALT + 1 do a function, ALT + 2 do another one, and so on...
...
So I have a list of models,
don't think the structure of these models is important.
In this case Articles.
So these Articles are ordered by popularity between a rank of 1 to 100, all the other articles have no ranks.
Whenever I update the rank of a model the model with equivalent rank must loose its rank.
Any ideas?
...
Hi! I'm trying to use orngMDS package from http://www.ailab.si/orange/doc/modules/orngMDS.htm
Here is my code:
distance=orange.SymMatrix(len(codes))
for key,value in normalized.iteritems():
parts=key.split('\t')
distance[codes[parts[0]],codes[parts[1]]]=1-value
mds=orngMDS.MDS(distance)
And I get the error:
...
I'm stuck on python2.4, so I can't use a finally clause with generators or yield. Is there any way to work around this?
I can't find any mentions of how to work around this limitation in python 2.4, and I'm not a big fan of the workarounds I've thought of (mainly involving __del__ and trying to make sure it runs within a reasonable tim...
Much of my programming background is in Java, and I'm still doing most of my programming in Java. However, I'm starting to learn Python for some side projects at work, and I'd like to learn it as independent of my Java background as possible - i.e. I don't want to just program Java in Python. What are some things I should look out for?
...
Hi..:) I tried using w = Word(printables), but it isn't working. How should I give the spec for this. 'w' is meant to process Hindi characters (UTF-8)
The code specifies the grammar and parses accordingly.
671.assess :: अहसास ::2
x=number + "." + src + "::" + w + "::" + number + "." + number
If there is only english characters it ...
I'm creating a video site. I want my direct urls to a video to look like example.com/watch/this-is-a-slug-1 where 1 is the video id. I don't want the slug to matter though. example.com/watch/this-is-another-slug-1 should point to the same page. On SO, /questions/id is the only part of the url that matters. How can I do that?
...
I'm not to sure if my title is right.
What I'm doing is writing a python script to automate some of my code writing.
So I'm parsing through a .h file.
but I want to expand all macros before I start.
so I want to do a call to the shell to:
gcc -E myHeader.h
Which should out put the post preprocessed version of myHeader.h to stdout.
Now...
hi I am trying to visualize a music file in gstreamer using the following command:
gst-launch filesrc location=file.mp3 ! decodebin ! audioconvert !
tee name=myT myT. ! queue ! autoaudiosink myT. ! queue ! goom !
colorspace ! autovideosink
But I get this error : "There may be a timestamping problem, or this computer is too slow."
P...
Hi all,
After downloading an image and getting the rgb color code is there any algorithm to find in which range of VIBGYOR that particular rgb color code match?
regards
Arun
...
When I try to transform my script in an executable, I get this error after it's done:
Traceback (most recent call last):
File "shd-WinResize.py", line 4, in <module>
File "zipextimporter.pyo", line 98, in load_module
ImportError: MemoryLoadLibrary failed loading win32api.pyd
I'm using this script to convert:
from distutils.core i...
Hi I have a Django script that I need to run,
I think the commands could be called through bash.
Thing is the script causes memory leaks after a long a period of time, so I would like to create an external cron job which calls the Python script. So the script would terminate and restart while retaking the lost memory.
Can someone po...
Every time fabric runs, it asks for root password, can it be sent along same for automated proposes.
fab staging test
...
I found the quoted text in Programming Python 3rd edition by Mark Lutz from Chapter 16: Server-Side Scripting (page 987):
Forms also include a method option to specify the encoding style to be used to send data over a socket to the target server machine. Here, we use the post style, which contacts the server and then ships it a strea...
Django code samples involving post data often shows code similar to this:
if request.method == "POST":
post = request.POST.copy()
#do stuff with post data
Is there a reason for copying the post data instead of working with it directly?
...