PyQT, QProcess.readyReadStdout() problem
part of code: >>> try: self.isdnlog = QProcess(self) self.isdnlog.addArgument("/usr/bin/tail") self.isdnlog.addArgument("-f") self.isdnlog.addArgument("/home/aljosa/qt/isdn.log") [...] QObject.connect(self.isdnlog, SIGNAL("readyReadStdout()"), self.onPhoneCall) self.isdnlog.start() <<< problem is that isdnlog logs 2 or more lines per call, and QProcess moves one line per call. is there something like QProcess.readLastLine()? Aljosa -- http://mail.python.org/mailman/listinfo/python-list
PIL - transparent ImageDraw.text()
is it possible to create transparent text (~50% transparency) on image? i'm using the following code to draw text on image: >>> font = ImageFont.truetype(str(self.font_family)+".ttf", self.font_size) draw = ImageDraw.Draw(img) draw.text((10, 10), self.text, font=font,fill=(255,255,255)) <<< url with example would be nice 8-) Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
py2exe & qt4/qimage
i'm trying to convert python (image resizer script using PyQt4) script to exe but support for jpeg and tiff image formats is located in Qt4.1\plugins\imageformats (dll files) and when script is converted exe file doesn't support jpeg and tiff. i tryed using all file formats in script: tmp1 = QImage('images/type.bmp') tmp2 = QImage('images/type.gif') tmp3 = QImage('images/type.jpg') tmp4 = QImage('images/type.png') tmp5 = QImage('images/type.tif') but it doesn't work when i convert script to exe. any tips on howto include jpeg and tiff image formats support in exe? -- http://mail.python.org/mailman/listinfo/python-list
image lib & Qt4
i'm looking for image lib which supports common image types (maybe freeimagepy?) and is relatively easy to display image loaded through that lib in PyQt4. any ideas? Aljosa -- http://mail.python.org/mailman/listinfo/python-list
Re: image lib & Qt4
does anybody know how to load (in-memory representation of PNG image) from Qt (v.4.1.3) as QImage? Diez B. Roggisch wrote: > aljosa wrote: > > > i'm looking for image lib which supports common image types (maybe > > freeimagepy?) and is relatively easy to display image loaded through > > that lib in PyQt4. > > any ideas? > > Use PIL & StringIO to create a in-memory representation of the image as e.g. > PNG. Load that using Qt. > > Diez -- http://mail.python.org/mailman/listinfo/python-list
capture video from camera
i'm trying to capture video from camera/webcam using python. so far i haven't found any library that would allow me to do that. cross-platform solution related to SDL/pygame would be nice but a simple solution to capture video under windows is ok. Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
Re: capture video from camera
i searched on google and found http://videocapture.sourceforge.net/ before i posted here. videocapture has no docs and doesn't provide additional options like motion detection nor any info on possibility of motion detection or howto implement (use of minimal system resources). i posted here to find out if anybody knows a better way to capture video. Fredrik Lundh wrote: > aljosa wrote: > > > i'm trying to capture video from camera/webcam using python. > > so far i haven't found any library that would allow me to do that. > > > > cross-platform solution related to SDL/pygame would be nice but a > > simple solution to capture video under windows is ok. > > first google hit for "python video capture": > > http://videocapture.sourceforge.net/ > > for linux, see: > > http://www.antonym.org/libfg > > -- http://mail.python.org/mailman/listinfo/python-list
Re: capture video from camera
i had no intention to say that videocapture is bad but it's not what i'm looking for. concerning docs, everybody has their own view on how docs should look like. that said, i should have written more clearly what i'm looking for. -- http://mail.python.org/mailman/listinfo/python-list
file parsing/watching + qt
this is a Qt app. app should watch for changes in /var/log/isdn.log and on file change (like new line was added to isdn.log) it should activate event in my app. i'm trying to fetch last line in file whenever isdnlog logs something so that i can parse that line for a number and store it somewhere else, is there a standard solution for this? i'm using python2.3 on linux with PyQt3. Aljosa -- http://mail.python.org/mailman/listinfo/python-list
dynamic func. call
can i do something like this: s = "myFunction" a = s() # equals to: a = myFunction() -- http://mail.python.org/mailman/listinfo/python-list
oauth2 server implementation
i'm looking for oauth2 server implementation but other than https://github.com/simplegeo/python-oauth2 (oauth v1 implementation) it doesn't seem that people are using v2 implementations. anybody using some oauth2 implementation and can share some info? Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
Re: oauth2 server implementation
On Sep 28, 2:17 am, Roy Smith wrote: > We rolled our own oauth2 client on top of basic urllib calls. It's not > terribly difficult. i'm asking about oauth2 server implementation, not client. it's easy to consume oauth2 stuff but what to do when you need to implement server side stuff? Aljosa -- http://mail.python.org/mailman/listinfo/python-list
memory leaks - tools and docs
i've been trying to find memory leaks in a wsgi application using gunicorn to run it and after a lot of time invested in research and testing tools i did find a lot of useful information (most really old) but i'm left with a feeling that this should be easier, better documented and with tools that generate better data. if anybody can share some tips, links, docs or better tools with better reports i would really appreciate it. i'm not against paying for a good tool so any recommendation is appreciated. i mostly used http://guppy-pe.sourceforge.net/#Heapy but found http://pysizer.8325.org/ and http://code.google.com/p/pympler/ also interesting. Aljosa -- http://mail.python.org/mailman/listinfo/python-list
looking for library to read ppt files
i'm looking for a way to read ppt (powerpoint) files using python and to convert slides into jpeg files. any links or tips how to do this? -- http://mail.python.org/mailman/listinfo/python-list
Re: looking for library to read ppt files
> > Not really a Python question but Google turned up: it is a python question. i'm not looking for a program, i'm looking for a library. my goal is to convert ppt to jpegs but later i wish to convert to swf and maybe implement animations > I suppose you could also use the win32 module and the COM object to > grab the info from the slide and then use the PIL module to create a > jpeg. Sounds like a lot of head banging to me, but it might be an > interesting project. i can't use win32 because it should work on linux since it will be used as server-side application. -- http://mail.python.org/mailman/listinfo/python-list
Re: looking for library to read ppt files
On Apr 18, 4:02 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > How about running a headless OpenOffice instance and remote-controlling > it with pyuno: > > http://udk.openoffice.org/python/python-bridge.html > > -Carsten i'll try oo, thanks for link. -- http://mail.python.org/mailman/listinfo/python-list
http://orbited.org/ - anybody using it?
can anybody comment on http://orbited.org/ ? is it an active project? does it work? Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
private pypi repository
i'm looking for a effective way to setup private pypi repository, i've found: - PloneSoftwareCenter - http://code.google.com/p/pypione/ - http://pypi.python.org/pypi/haufe.eggserver what are you using? what would you recommend? Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
current week / weeks in year - best practice
i use this to find out current week and total number of weeks for current year: now = datetime.now() weeks_in_year = int(date(now.year, 12, 31).strftime("%W")) current_week = int(date(now.year, now.month, now.day).strftime("%W")) is this the best way or is there a better way? Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
Re: current week / weeks in year - best practice
On Jul 31, 3:58 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Instead of datetime.now() use date.today(), which removes a lot of > boilerplate. > > int(date.today().strftime("%W")) > > Apart from that, I think it's the way to go. what if i know current context week = 20 (example), what would be the best way to get datetime objects for first and last day of current context week? by "current context week" i don't mean current week for current year but current week when program is iterating all weeks in year. Aljosa -- http://mail.python.org/mailman/listinfo/python-list
Re: current week / weeks in year - best practice
On Jul 31, 5:42 pm, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote: > what if i know current context week = 20 (example), what would be the > best way to get datetime objects for first and last day of current > context week? > by "current context week" i don't mean current week for current year > but current week when program is iterating all weeks in year. if w = current context week and now is current datetime object this is how i calculate days: first_day = datetime.strptime("%s %s" % (now.year, str((w-1)*7)), "%Y %j") last_day = first_day + timedelta(days=6) any comments on this? Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
PYTHONPATH breaks MySQLdb
i have a working MySQLdb module (/usr/lib/python2.4/site-packages/ MySQL_python-1.2.2-py2.4-linux-i686.egg), using it without problems. "clean shell" after login: python -c "import MySQLdb" reports no errors if i export PYTHONPATH: export PYTHONPATH=/var/www/projects/uv_portal/portal python -c "import MySQLdb" reports no errors as in previous case if i export PYTHONPATH: export PYTHONPATH=/var/www/projects/uv_portal/portal/apps i get this: python -c "import MySQLdb" Traceback (most recent call last): File "", line 1, in ? ImportError: No module named MySQLdb is there any reason why this happens? Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
setup.py and MANIFEST.in - duplicating inclusion of files?
the only way i can get to distribute template files when using "python setup.py sdist" is to declare it both in setup.py and MANIFEST.in. setup.py: > package_data={'myapp':['templates/*.html', 'templates/admin/*.html'],} MANIFEST.in: > recursive-include myapp/templates *.html am i doing something wrong or is this correct? if it's correct, why? Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
pypi compatible software
i've been searching for a recommended way to setup private pypi repository and i've found several options: - PloneSoftwareCenter - http://code.google.com/p/pypione/ - http://pypi.python.org/pypi/haufe.eggserver - http://www.chrisarndt.de/projects/eggbasket/ - http://pypi.python.org/pypi/ClueReleaseManager so now i have a few questions: - is code behind pypi.python.org available and why i can't find some up-to-date official document or howto for private pypi repository (maybe it exists but i just can't find it)? - since python is used in commercial environments i guess they actually have private pypi repositories, where can i find docs that defines what pypi is and how to implement it? - can you recommend 1 option (software providing pypi like service) that can be easily installed and configured as a service running on apache2/mod_wsgi, has an active community and docs howto setup? - i did found http://www.python.org/dev/peps/pep-0381/ - is this the spec that above mentioned software is based upon? any additional info or comments appreciated. Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
naming packages for pypi
is it possible to have 2 packages with same name registered at pypi? are packages unique per name or also per category or something else? if package is unique per name how do you name you packages? do you name them something like -myapp, -myapp, -myapp, ... if this is current situation is this something that you learned to live with and there are no indications that this will eventually change? Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list
Re: naming packages for pypi
On Jun 26, 11:15 am, Carl Banks wrote: > Your post seems to suggest some conflating of these concepts so you > need to make it clear what you really mean. my example: when creating website example.com (django project) it contains multiple django apps which i package separately. most of websites have news, about, contact so i would create 3 packages news, about and contact and add them to pypi.example.com (private pypi for my company). same thing happens for site example2.com, example3.com so finally i have something like: example.com-news # news package for project/site example.com example2.com-news # news package for project/site example2.com example3.com-news # news package for project/site example3.com i'm trying to find a better way, currently it looks to me like packaging system is missing namespaces/categories or something similar but i'm guessing it's only that i don't know how to do it properly. that's why i'm asking so please suggest a proper way for me to do it. Aljosa Mohorovic -- http://mail.python.org/mailman/listinfo/python-list