Even if I set the geometry for the QWebView it occupies the whole left over screen.
Even worse if I maxmize the window, there is a gap between the two widgets
Below is my code I wrote:
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtWebKit import *
class twsearchbox(QWidget):
def __init__(self):
QWidge...
I'm trying to parse dates with regex, using groups, but python is returning empty lists. I'm not doing anything fancy, just 12/25/10 sort of stuff. I want it to reject 12/25-10 though.
date = re.compile("\d{1,2}([/.-])\d{1,2}\1\d{2}")
I've tried online regex libraries, but their solutions don't seem to run either. Any ideas?
Sampl...
I have three input data files. Each uses a different delimiter for the data contained therein. Data file one looks like this:
apples | bananas | oranges | grapes
data file two looks like this:
quarter, dime, nickel, penny
data file three looks like this:
horse cow pig chicken goat
(the change in the number of columns is also intent...
I'm writing a Python module for finding nearby WiFi client devices. All my current scanner does is listen for Probe Requests and logs the clients MAC address.
The problem I'm having is that I'm completely reliant on the device broadcasting a probe request for me to discover it.
I'm wondering if there is any other way to discover devic...
so...i've been banging my head on this for a bit. I'm getting the most bizarre error when attempting to validate a form. I pass input to the form wanting to test behavior when the form fails validation, i.e. i expect it to fail validation.
i've got this code for a form:
class CTAForm(forms.Form):
first_name = forms.CharField(...
I have the following:
My webserver running on twisted
My comet server, aka orbited
Note that 1 and 2 are different processes.
Basically, I want 1 and 2 to share the same port. Request that are http://mysite.com/a/b/c should go to the webserver and anything starting with http://mysite.com/orbited/ should go to the orbited server, i.e...
Hi there,
With PHP you have the phpinfo() which lists installed modules and then from there look up what they do.
As a python newbie, is there a way to see what items are installed to import?
...
Hi there,
Using python with a sqlite DB - whats the method used for escaping the data going out and pulling the data coming out?
Using pysqlite2
Google has conflicting suggestions.
...
I have a QLineEdit, and I want to set a placeholder text. When I call setPlaceholderText(string) I get an AttributeError, but:
>>> from PyQt4 import QtCore
>>> QtCore.PYQT_VERSION_STR
'4.7.4'
>>> QtCore.QT_VERSION_STR
'4.7.0'
and from the QAssistant:
This property holds the line edit's
placeholder text.
...
This property was...
please can anyone help me with the port scanner program to scan ports on the IP address provided,for ACK. i want to know the technique used to scan for ACK & use multi-threading so please help me in that perspective.
Thank you
...
I'm trying to write a software plug-in that embeds Python. On Windows the plug-in is technically a DLL (this may be relevant). The Python Windows FAQ says:
1.Do not build Python into your .exe file directly. On Windows, Python must be a DLL to handle importing modules that are themselves DLL’s. (This is the first key undocumented fac...
normally,we use regular expression match from left to right direction,i want to know is there some switch can match from the right to left in python?
or in any other language has this feature embedded
e.g.
abcd1_abcd2
if give a abcd regular expression,it will match two abcd,what i want is put the last match at first in a reverse direc...
I use Python 3.1 inside Windows XP and when I try to use more than one module at the same time, the Python shell restarts. What can I do?
This is my module benutzer.py:
class Benutzer(object):
def __init__(self,benutzer):
self.name = benutzer
self.email = None
def setzeEmail(self, adresse):
self.email ...
Hi,
I'm trying to get a local variable from a decorator. An example:
def needs_privilege(privilege, project=None):
"""Check whether the logged-in user is authorised based on the
given privilege
@type privilege: Privilege object, id, or str
@param privilege: The requested privilege"""
def validate(func, self, *args...
Hi,
It's my day 1 of learning python. so it's a noob question for many of you. See the following code:
#!/usr/bin/env python
import sys
def hello(name):
name = name + '!!!!'
print 'hello', name
def main():
print hello(sys.argv[1])
if __name__ == '__main__':
main()
when I run it
$ ./Python-1.py alice
hello alice!!...
All,
As you know, by python iter we can use iter.next() to get the next item of data.
take a list for example:
l = [x for x in range(100)]
itl = iter(l)
itl.next() # 0
itl.next() # 1
Now I want a buffer can store *general iter pointed data * slice in fixed size, use above list iter to demo my question.
class I...
I have a dictionary:
{'key1':1, 'key2':2, 'key3':3}
I need to pass a sub-set of that dictionary to third-party code. It only wants a dictionary containing keys ['key1', 'key2', 'key99'] and if it gets another key (eg 'key3'), it explodes in a nasty mess. The code in question is out of my control so I'm left in a position where I have ...
Are there protocols/solutions/messaging system that allows me to communicate between languages AND servers?
Eg. I want to be able to communicate between one server running Java (or Ruby, Python etc) on the backend and one server running Javascript also on the backend.
The solution I use now is HTTP REST.
Are there other solutions that...
So I have 16 GB worth of XML files to process (about 700 files total), and I already have a functional PHP script to do that (With XMLReader) but it's taking forever. I was wondering if parsing in Python would be faster (Python being the only other language I'm proficient in, I'm sure something in C would be faster).
...
I understand the concept of PyObjC, but can nowhere find any information on what exactly it is or how to get started with it.
Is it like a converter, where youinput python files and get an objective c one?
Or is it a library you can import to your objective c files which let's you write python in them?
Or is it something else entirely?...