python win32gui finding child windows
for example at first you have to find hwnd of skype hwnd = win32gui.FindWindow(None, 'skype') and than all his child windows and their titles child = ??? any idea? ...
for example at first you have to find hwnd of skype hwnd = win32gui.FindWindow(None, 'skype') and than all his child windows and their titles child = ??? any idea? ...
Hi everyone, I am having little problem with importing classes in python. My work flow goes like this index.py class Template: def header(): def body(): def form(): def footer(): display.py I want to call function header(), body() and footer () in my display.py page. Will anyone make me clear ab...
I am getting an error whenever i try to run following unzip command from a python script which is running as a daemon Command : unzip abcd.zip > /dev/null Error End-of-central-directory signature not found$ a zip file, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comm...
Hello, I am running some tests and need to write to a file. When I run the test's the open = (file, 'r+') does not write to the file. The test script is below: class GetDetailsIP(TestGet): def runTest(self): self.category = ['PTZ'] try: # This run's and return's a value result = self.clien...
Hi, I'm working on a Django project where I need to provide a lot of different visualizations on the same data (for example average of a value for each month, for each year / for a location, etc...). I have been using an OLAP database once in college, and I thought that it would fit my needs, but it appears that it is much too heavy fo...
Hello I am writing a small app and I need to quit the program multiple number of times. Should I use: sys.stderr.write('Ok quitting')sys.exit(1) Or should I just do a: print 'Error!'sys.exit(1) Which is better and why? Note that I need to do this a lot. The program should completely quit. ...
from lxml.html.clean import clean_html, Cleaner def clean(text): try: cleaner = Cleaner(scripts=True, embedded=True, meta=True, page_structure=True, links=True, style=True, remove_tags = ['a', 'li', 'td']) print (len(cleaner.clean_html(text))- len(text)) return...
I've come across the following code in a Python script from pprint import pprint why not simply import pprint? Unless the module pprint contains a function called pprint which is being aliased as pprint (surely, this must be the definition of madness?) ...
I have an issue with creating a transaction. I get an error back that the objects are not in the same entity group. I have a type called Relationship and I need to create a two way relationship between two parties. def _transaction(): relationship1 = Relationship(firstParty = party1, secondParty = party2) relationship2 = Relati...
I have an ORM class called Person, which wraps around a person table: After setting up the connection to the db etc, I run the ff statement. people = session.query(Person).all() The person table does not contain any data (as yet), so when I print the variable people, I get an empty list. I renamed the table referred to in my ORM cla...
ok I know that this should be simple... anyways say: line = "$W5M5A,100527,142500,730301c44892fd1c,2,686.5 4,333.96,0,0,28.6,123,75,-0.4,1.4*49" I want to strip out the spaces. I thought you would just do this line = line.strip() but now line is still '$W5M5A,100527,142500,730301c44892fd1c,2,686.5 4,333.96,0,0,28.6,123,75,-0.4,1....
How can I go about adding users/number, changing things from PHP(or python) on an asterisk server? ps. also are there any better ways to get the current asterisk settings, users, numbers other than scraping the config files? ...
I am writing a python package. I am using the concept of plugins - where each plugin is a specialization of a Worker class. Each plugin is written as a module (script?) and spawned in a separate process. Because of the base commonality between the plugins (e.g. all extend a base class 'Worker'), The plugin module generally looks like th...
Hi, I want to implement a lightweight Message Queue proxy. It's job is to receive messages from a web application (PHP) and send them to the Message Queue server asynchronously. The reason for this proxy is that the MQ isn't always avaliable and is sometimes lagging, or even down, but I want to make sure the messages are delivered, and ...
I have a Python script that I'd like to compile into a Windows executable. Now, py2exe works fine from Windows, but I'd like to be able to run this from Linux. I do have Windows on my development machine, but Linux is my primary dev platform and I'm getting kind of sick of rebooting into Windows just to create the .exe. Any ideas? PS: I...
If I have a string "this is a string" How can I shorten it so that I only have one space between the words rather than multiple? (The number of white spaces is random) "this is a string" ...
Hi, I am trying to use Python to read in an XML file containing some parameter names and values, e.g. ... <parameter name='par1'> <value>24</value> </parameter> <parameter name='par2'> <value>Blue/Red/Green</value> </parameter> ... and then pass it a dictionary with the parameter names {'par1':'53','p...
Hello, given: foo = "foo" def bar(foo): foo = "bar" bar(foo) print foo # foo is still "foo"... foo = {'foo':"foo"} def bar(foo): foo['foo'] = "bar" bar(foo) print foo['foo'] # foo['foo'] is now "bar"? I have a function that has been inadvertently over-writing my function parameters when I pass a dictionary. Is there a cl...
I am using a wmd-editor in django, much like this one in which I am typing. I would like to allow the users to embed videos in it. For that I am using the Markdown video extension here. The problem is that I am also sanitizing user input using html5lib sanitization and it doesn't allow object tags which are required to embed the videos. ...
Hello, I'm trying to start an application using Python. I've seen that some people use startfile but I also read that it only works with Windows. I'm using Mac systems and hoping for it to work with them. Thanks, Aaron ...