I have a web page (existing page, can't modify it) and I would like
to browse it in a QtWebview. (This is already working)
Now I Wonder how I could achieve following behaviour:
When I click on a certain element e.g. span id=clickme/a
I would like to notify my python script.
What is
Given the context, PyQt is available under the GPL and a commercial
license, the commercial license Phil is talking about is not the
GPL.
Which is a wrong interpretation of “commercial”.
But he is not interpreting either “commercial” or GPL.
What he says is: here's the code for free
PyQt is available under the GPL and a commercial license.
Surely you mean “proprietary” rather than “commercial”. There is
nothing about the GPL that prevents “commercial” use.
I think he means a license that *he* sells comercially :)
--
дамјан ((( http://damjan.softver.org.mk/ )))
I am loathe to duplicate programming in files that should just load a
copy from a module. I tried all kinds of tricks to import a module
from one level up. What's the secret?
It works if I say:
from Data import DumpHT
but ONLY if the search path in sys.path. I want a relative path
I've found the module pkipplib which seems to work well for things
like
interrogating an IPP (CUPS) server. But is there a way to send a
print job to an IPP print queue? [and no, the local system knows
nothing about
the print architecture so popenlp is not an option]. I just want
to
Pydev 1.6.0 has been released
Details on Pydev: http://pydev.org
Details on its development: http://pydev.blogspot.com
The supposed feature to start a console in which the contents of the
current editor window are automatically execed /available still
doesn't work for me.
I'm talking
It seems, that wsgiref.simple_server.make_server can only create an
http server.
What I wondered would be how to easiest create an https server, that
supports wsgi modules
PythonPaste has a WSGI server that supports https
On the positive side, Lua supports tail call optimization and coroutines
are built in by default.
--
дамјан ((( http://damjan.softver.org.mk/ )))
Education is one of the prices of freedom that some are unwilling to
pay.
--
http://mail.python.org/mailman/listinfo/python-list
I'm writing this as a complete newbie (on the issue), so don't be
surprised if it's the stupidest idea ever.
I was wondering if there was ever a discusision in the python
community on a 'raise-yield' kind-of combined expression. I'd like
to know if it was
I'm writing this as a complete newbie (on the issue), so don't be
surprised if it's the stupidest idea ever.
I was wondering if there was ever a discusision in the python
community on a 'raise-yield' kind-of combined expression. I'd like to
know if it was
http://lab.arc90.com/experiments/readability/
Readability is a javascript bookmarklet that makes reading on the
Web more enjoyable by removing the clutter around what you're
reading.
Does anyone know of something similar in Python?
Well, that sounds like a browser tool.
yes, it's a
http://lab.arc90.com/experiments/readability/
Readability is a javascript bookmarklet that makes reading on the Web
more enjoyable by removing the clutter around what you're reading.
Does anyone know of something similar in Python?
--
дамјан ((( http://damjan.softver.org.mk/ )))
Hello i have to do this :
glibc crypt() function, using salt $1$abcdefgh$
cryptPw = crypt(plainPw, $1$abcdefgh$)
I can do it in python, with package i need?
Thanks
import ctypes
lib = ctypes.CDLL(libcrypt.so.1)
crypt = lib.crypt
crypt.restype = ctypes.c_char_p
crypt(password,
Rather than writing a windowing toolkit from the low-level, I would
rather like to see some wrapper for existing windowing toolkit which
uses more pythonic idioms.
Isn't PyGUI exactly that?
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
--
дамјан ((( http://damjan.softver.org.mk/
I'm writing this as a complete newbie (on the issue), so don't be
surprised if it's the stupidest idea ever.
I was wondering if there was ever a discusision in the python community
on a 'raise-yield' kind-of combined expression. I'd like to know if it
was
Hi All,
Pydev 1.5.6 has been released
Details on Pydev: http://pydev.org
Details on its development: http://pydev.blogspot.com
Question,
Does it have a feature to evaluate the current edit buffer and continue
with an interactive prompt?
--
дамјан ((( http://damjan.softver.org.mk/ )))
Having an odd problem that I solved, but wondering if its the best
solution (seems like a bit of a hack).
First off, I'm using an external DLL that requires static callbacks,
but because of this, I'm losing instance info. It could be import
related? It will make more sense after I diagram
If you are all English-speakers then perhaps you could consider
showing a PyCon video - see
http://pycon.blip.tv
That's certainly something I'm considering for the more advanced users
Good luck with the group. I hope to see PyCon Macedonia emerging
before too long!
Thanks :)
I guess
we are starting with bi-monthly Python User Group meetings in Skopje,
Macedonia. The meetings are targeted for both beginners and more
experienced users.
...
http://us.pycon.org/2010/conference/schedule/event/108/
Great resource, exactly what I needed.
So, they use this book
Hi all,
we are starting with bi-monthly Python User Group meetings in Skopje,
Macedonia. The meetings are targeted for both beginners and more
experienced users.
The basic idea is to have an 1 hour presentation at the start for the
beginners and an 1 hour ad-hoc discussion about projects,
everything works just fine, but one thing bothers me. All prints after
try-except block are executed twice after the Ctrl+C is pressed!
test.py:
#-
from scgi.scgi_server import SCGIServer
n = 0
print Starting server.
try:
SCGIServer().serve()
except
a = [1, 2, 3, 4, 5, 6]
for i, x in enumerate(a):
If you change a list while iterating over, start at the tail.
...reversed(enumerate(a))
Python 2.6.2 (r262:71600, Jul 20 2009, 02:19:59)
a = [1, 2, 3, 4, 5, 6]
reversed(enumerate(a))
Traceback (most recent call last):
File stdin,
Hi folks. I just modified the WHIFF concepts index page
http://aaron.oirt.rutgers.edu/myapp/docs/W1000.concepts
To include the following paragraph with a startling and arrogant
claim in the final sentence :)
mod_wsgi (the apache module) can be configured to automatically run any
Boot loaders are another type of software which would be impractical
to write in existing Python implementations.
I wonder if TinyPy (http://www.tinypy.org/) could be used to write a
boot loader. It would probably need some more code to replace the
services it uses from an OS, and perhaps it
Is there any easy function in the stdlib to convert any random string
in a valid Python identifier .. possibly by replacing non-valid
characters with _ ?
I think this is fairly underspecified as a problem statement. A
solution that would meet your specification would be
True, I was
Is there any easy function in the stdlib to convert any random string in
a valid Python identifier .. possibly by replacing non-valid characters
with _ ?
Python 2.x only, so no need to do Unicode.
--
дамјан ( http://softver.org.mk/damjan/ )
Religion ends and philosophy begins,
just as
By the way, you don't have to be super user to install PyGreSQL.
You just need SU if you want to install it system wide. PyGreSQL
doesn't require any special privileges to run.
Right, but the packages install system-wide. That's why he could
compile it himself but not use the package.
I have released pyKook 0.0.2.
http://pypi.python.org/pypi/Kook/0.0.2
http://www.kuwata-lab.com/kook/
http://www.kuwata-lab.com/kook/pykook-users-guide.html
How does it compare to http://code.google.com/p/fabricate/
and why is this problem (solution) reoccurring all the time
--
дамјан (
So do all these OSes have some kind of __mega_unifying_poll system
call that works for anything that might possibly block, that you can
exploit from a user process?
On Linux at least, the select/poll/epoll is that system, the trick is to
use eventfd, timerfd and signalfd which are Linux
I want to format values to the german form eg. 1.034,56 but
locale.format() doesn't work for me.
seems to work here
import decimal, locale
locale.setlocale(locale.LC_ALL, 'mk_MK.UTF-8')
'mk_MK.UTF-8'
locale.localeconv()['grouping']
[3, 3, 0]
locale.localeconv()['thousands_sep']
' '
I want to format values to the german form eg. 1.034,56 but
locale.format() doesn't work for me.
seems to work here
In 2.6 this is good too:
import decimal, locale
locale.setlocale(locale.LC_ALL, 'mk_MK.UTF-8')
'{0:n}'.format(1234.56)
'1 234,56'
--
дамјан (
I need to programmaticaly enumerate all the classes in a given module.
Currently I'm using dir(module) but the Notice on the documentation page
[1] says dir() is supplied primarily as a convenience for use at an
interactive prompt so that kind of scares me.
Is there a better approach?
If
I just to check it in the python shell and it's correct.
Then the problem is by iPython that I was testing it from there.
yes, iPython has a bug like that
https://bugs.launchpad.net/ipython/+bug/339642
--
дамјан ( http://softver.org.mk/damjan/ )
A: Because it reverses the logical flow of
I have written a socket server and some arbitrary clients. When I
shutdown the server, and do socket.close(), I cannot immediately start
it again cause it has some open sockets in TIME_WAIT state. It throws
address already in use exception at me. I have searched for that in
google but
I have read for many times that the modern appliaction (not a web one,
but desktop on) uses html + js for its UI, and python code is for the
background work
but I have never found event a simple (yet completed) article on how
to develop such a thing from scrach in these advocacy thing.
OpenOfficeXML document format AKA ODF? ;)
No...Office Open XML, which is used in Microsoft Office 2007 and which
Microsoft rammed through the ISO:
http://en.wikipedia.org/wiki/Office_Open_XML
Even worse, Microsoft Office 2007 doesn't even implement the ISO
standard for Open XML.
--
On 11 Mag, 23:06, Shawn Milochik sh...@milochik.com wrote:
How is the form written in JavaScript? Is it dynamically generated?
In any case, can you just send a POST request if you know the values
required?
The problem is indeed that the form is dynamically generated.
That's the .js
Ah, ok. Is there also an easy_install invocation that unpacks the zip
file into some location of sys.path (which then wouldn't require
editing sys.path)?
You have pip that does that :)
--
дамјан ( http://softver.org.mk/damjan/ )
... knowledge is exactly like power - something
to be
How can I dynamically insert a base class in a given class? Yeah, I'm
writing a class decorator that needs to manipulate the class by
inserting another base class in it.
Something like:
class ReallyBase(object):
def someimportantmethod(self):
return 'really really'
@expose(args)
You seem to have finally discovered that when using Apache/mod_wsgi,
Apache does a level of URL matching to filesystem based resources.
didn't Paste include something like that ...
This isn't automatic in normal WSGI servers unless you use a WSGI
middleware that does the mapping for you. :-)
I have a simple descriptor to create a cached property as shown below.
...
The problem is that when I use the help() function on them, I don't
get the doc string from the function that is being wrapped.
...
What do I need to do to get the doc string of the wrapped function to
apper when
How do I do this in python3?
What's wrong with importing it?
The problem is that my wsgi files have a wsgi extention for mod_wsgi
use
..
mod_wsgi has a .wsgi handler because it is recommended to rename the
wsgi file with wsgi extensions to avoid double imports
cherrypy server has a
Which will produce the same output as the original, confounding
your user. You could just write the new values out, since .read
picks the last entry (as I believe it should). Alternatively, if
you want to replace it in place, you'll need a bit more smarts
when there is more than one copy of
I'm writing a script that should modify ODF files. ODF files are just
.zip archives with some .xml files, images etc.
So far I open the zip file and play with the xml with lxml.etree, but I
can't replace the files in it.
Is there some recipe that does this ?
--
дамјан (
I'm writing a script that should modify ODF files. ODF files are just
.zip archives with some .xml files, images etc.
So far I open the zip file and play with the xml with lxml.etree, but
I can't replace the files in it.
Is there some recipe that does this ?
I ended writing this, pretty
Are you aware of any python module that automatically gives you a
screenshot of a web page?
PyQt then use it's WebKit based component, load the web page, then
render it into an image.
--
дамјан ( http://softver.org.mk/damjan/ )
Give me the knowledge to change the code I do not accept,
the
I've needed an attribute accessible dict, so I created this.
Are there any obviously stupid shortcomings?
class AttrDict(dict):
def __getattr__(self, name):
try:
return self[name]
except KeyError, e:
raise AttributeError(e)
--
дамјан (
This module asks the socket module for AF_BLUETOOTH... in the socket
module there is no such thing as AF_BLUETOOTH. Could it be that the
person that made PyOBEX modified his socket module and forgot to give
his socket module? Or am I missing something? Maybe AF_BLUETOOTH
stands for something
I've needed an attribute accessible dict, so I created this.
Are there any obviously stupid shortcomings?
If you know the attribute names ahead of time, you might consider
using a namedtuple instead.
See
http://docs.python.org/library/collections.html#collections.namedtuple
I do use it,
Unless I'm badly mistaken, the Firefox sessionstore.js file is
supposed to be JSON.
...
If it matters, I'm using Firefox 2.0.0.5 under Linux.
maybe it can be parsed with PyYAML?
--
дамјан ( http://softver.org.mk/damjan/ )
Well when _I_ was in school, I had to run Netscape on HP/UX,
However, mostly people agree that Qt is the most powerful, but often
was debunked because of it's licensing. This has changed to the much
more liberal LGPL for Qt4.5.
Now it might be though that you'd still need to buy a license from
Phil Thompson for his excellent PyQt-wrapping - but I'd
In Linux, you can only have one IPv4 address per interface (and you
have to use alias interfaces, such as eth0:0, to assign multiple
addresses to a physical link).
that's actually not correct, use the ip tool (iproute2 package) to see
how easily you can have several addresses to a single
I don't see ~/.local in sys.path. Is this some feature which needs to
be enabled? I was kind of unclear after reading the section on it in
the 2.6 What's New document.
Here it is,
/home/damjan/.local/lib/python2.6/site-packages
by default no special settings (on ArchLinux if it matters).
I have made the same analysis to some commercial source code, the
dup60 rate is quite often significantly larger than 15%.
commercial code sucks often .. that's why they hide it :)
--
дамјан ( http://softver.org.mk/damjan/ )
Scarlett Johansson: You always see the glass half-empty.
Woody
Why? - Python is object oriented, but I can write whole systems
without defining a single class.
By analogy, if data hiding is added to language, I could write a
whole system without hiding a single item.
I guess the problem is that you would not be able to use some libraries
because their
So, I'm using lxml to screen scrap a site that uses the cyrillic
alphabet (windows-1251 encoding). The sites HTML doesn't have the META
..content-type.. charset=.. header, but does have a HTTP header that
specifies the charset... so they are standards compliant enough.
Now when I run this
I've been long using this recipe [1] „Completer with history viewer
support and more features“ with the interactive prompt of python 2.x
But it's not compatible with Python 3.0
Anyone know of a similar functionality for Python 3.0 or I should try to
port this script?
[1]
I've been long using this recipe [1] „Completer with history viewer
support and more features“ with the interactive prompt of python 2.x
But it's not compatible with Python 3.0
Anyone know of a similar functionality for Python 3.0 or I should try
to port this script?
[1]
Today, I used the adodbapi module against an SQL Server Express
database. I was surprised to get an exception, when I attempted to
submit a second query with my cursor object. The full session is
below.
curs.execute('select * from localview_roles')
curs.execute('select * from
I'm looking to set up a small private wiki, and am looking for
recommendations.
Some sort of CGI based package that I could just untar somewhere web
accessable via Apache would be great.
http://hatta.sheep.art.pl/About
· single file
· stores stuff in mercurial.
· it's WSGI, so yes you can
Sorry, by USB device, I meant a device that is powered/activated by a
bunch of wires that I want to control using a computer and since I
had a spare USB jack lying around, I used that instead. But so far I
haven't tried it, nor will try it if it wont work properly. Yes, it
is not a proper USB
raise ValueError(errmsg(Expecting property name, s, end))
http://docs.python.org/library/json.html
What am I doing wrong ?
try this
v = json.loads('{test:test}')
JSON doesn't support single quotes, only double quotes.
--
дамјан ( http://softver.org.mk/damjan/ )
A: Because it reverses the
I don't know what an IBQ is.
+IBQ- seems to be the way your newsreader displays the dashes that
where in Ben's posting. I see em dash characters there:
I see IBQ too ... also weird is that he has
Content-Type: text/plain; charset=utf-7
--
дамјан ( http://softver.org.mk/damjan/ )
Give me
Consider the following wsgi app:
def application(env, start_response):
start_response('200 OK',[('Content-type','text/plain')])
yield hello
x=1/0
yield world
The result of this is that the web browser displays hello and an
error
message ends up in the web log. But there is
Something *like* this could work:
myip = urllib2.urlopen('http://whatismyip.org/').read()
of course then you are depending on an external service, not a very
reliable one even. But then again, you might create an internal service
like that yourself.
This cgi-bin shell code like this
Perhaps you also like to hear from a developer who has worked on
Python 3.0 itself and who has done lots of work with internationalized
applications. If you want to get it right you must
* decode incoming text data to unicode as early as possible
* use unicode for all internal text data
*
Hi All,
Can someone tell me how to redirect stderr back to the console once
you've moved it?
import os,sys
se = os.open(/tmp/mod.log, os.O_WRONLY|os.O_APPEND|os.O_CREAT)
sys.stderr.write(Foobar\n)
Foobar
os.dup2(se, 2)
why not os.dup2(2, 10) and then later os.dup2(10, 2)
--
дамјан
The themed Tk widgets (ttk) that come with Tk 8.5 add a lot of the
same things that Tix does, but they do so in a more modern way,
hooking into platform-specific themes and API's wherever possible (XP,
Vista, Mac) and updating the generic X11 look as well. As such, they
are more appropriate
And there are
some things (such as Flash-style web applets) that you still can't do
at all in Python, even after all these years.
You're looking for Silverlight:
http://www.voidspace.org.uk/ironpython/silverlight/index.shtml
or clutter which has Python bindings
By per-class-instance variables, you are talking
about instance attributes? I.e. self.use_gmt_times?
I don't see much difference between global variables
and instance attributes.
using global variable in modules makes the module not Thread-safe
Using a instance attribute allows more
I'm trying again because I'm stubborn. Maybe the fourth time will be
the charm...
Are there any good tutorials out there for setting up Apache with
mod_python?
mod_python is depreceated, nobody uses it. use mod_wsgi http://www.modwsgi.org/
--
дамјан ( http://softver.org.mk/damjan/ )
In most languages, I'll do something like this
xmlWriter.BeginElement(parent);
xmlWriter.BeginElement(child);
--xml.Writer.Characters(subtext);
xmlWriter.EndElement();
xmlWriter.EndElement();
Where the dashes are indentation (since some newsgroup handlers don't
do tabs
In a nutshell, this is likely to cause pain until all file systems are
standardized on a particular encoding of Unicode. Probably only about
another fifteen years to go ...
well, most Linux distros are defaulting to a UTF-8 locale now, the
exception beeing Gentoosimilar that expect the user
I don't think it matters. Here's a quick comparison between 2.5 and
3.0 on a relatively small 17 meg file:
C:\c:\Python30\python -m timeit -n 1
open('C:\\work\\temp\\bppd_vsub.csv', 'rb').read()
1 loops, best of 3: 36.8 sec per loop
C:\c:\Python25\python -m timeit -n 1
I am new to PyQT and GUI programming in general. What tutorials I have
found are relatively clear on standard operations within a single
window (QtGui.QWidget or QtGui.QMainWindow). Exiting this window exits
the overall application.
How would I switch between windows, that is close one and
Fight with me for Glory not riches. Fight with me and
you shall be free. FREDOM!
SketchUp is not free
--
дамјан ( http://softver.org.mk/damjan/ )
war is peace
freedom is slavery
restrictions are enablement
--
http://mail.python.org/mailman/listinfo/python-list
Python 2.6 implemented PEP 370: Per-user site-packages Directory
Ok, you can completelly replace virtualenv with
a) setting PYTHONUSERBASE=something
b) Editing ~/.pydistutils.cfg to be like:
[install]
user=True
After this, installing new packages go to
Python 2.6 implemented PEP 370: Per-user site-packages Directory[1]
Now, are there any tools I could use to create and activate virtual
environments like workingenv, virtualenv etc. but that will use
PYTHONUSERBASE instead of hard-linking the python program.
[1]
Python 2.6 implemented PEP 370: Per-user site-packages Directory[1]
Now, are there any tools I could use to create and activate virtual
environments like workingenv, virtualenv etc. but that will use
PYTHONUSERBASE instead of hard-linking the python program.
[1]
I'm starting a Unix tool with subprocess.Popen() from a python script
and I want the child to be killed when the parent (my script) ends
for whatever reason *including* if it gets killed by SIGKILL.
A Linux-specific solution is prctl(2).
I've tried this in a test C program... exactly what I
Hi all,
I'm starting a Unix tool with subprocess.Popen() from a python script
and I want the child to be killed when the parent (my script) ends for
whatever reason *including* if it gets killed by SIGKILL.
For normal situations I can send a signal to the pid of the Popen object.
But not if the
As per Stevens/Rago, file and record locking provides a convenient
mutual-exclusion mechanism.
On linux (at least) there's one nice trick to get a single-instance
program. Create a unix domain socket, and bind it to an address that
begins with the null character '\0'. You can bind the same
82 matches
Mail list logo