On 11/14/2013 03:13 PM, Neil Cerutti wrote:
On 2013-11-14, Peter Chant p...@petezilla.co.uk wrote:
Or is it that - if I keep the code as simple as possible, PyPy
is about as fast as you can get?
PyPy profiles your code as it runs and creates, using a
just-in-time compiler, highly optimized
I'm looking to speed up some python code. Replacing the python
interpreter with pypy was impressive. I noted that use of ctypes (in
cython?), specifically declaring variables as below, was reported as
giving a useful result:
cdef float myvar
cdef int i
under cython can provide a useful
The following code generates a QStringList:
fileNames = QFileDialog.getOpenFileNames(None,Chose raw file,.,)
Printing it:
print Files selected +QStringList(fileNames)
Results in:
TypeError: cannot concatenate 'str' and 'QStringList' objects
Any idea how to convert a QStingList into a python
Peter Otten wrote:
Try it out yourself in the interactive interpreter. Here's a sample
session:
Peter,
thanks. I've got some way to go with python and have only just started
looking at Qt, your help has been very useful.
Pete
--
http://www.petezilla.co.uk
--
rlevesque wrote:
Is there a way to compare 2 pdf files generated at different time but
identical in every other respect and validate by program that the
files are identical (for all practical purposes)?
I wonder, do the PDFs have a timestamp within them from when they are
created? That
Does anyone know whether PIL can handle 16 bit per channel RGB images?
PyPNG site (http://packages.python.org/pypng/ca.html) states PIL uses 8 bits
per channel internally.
Thanks,
Pete
--
http://www.petezilla.co.uk
--
http://mail.python.org/mailman/listinfo/python-list
thinke365 wrote:
such as uniform distribution, Normal distribution or poisson distribution.
is there any package that can be used to generate such random numbers.
I remeber being told that adding up 12 random numbers in the range 0-1
(which is what most computer random number genertors at
Martin Schöön wrote:
Hence, are there any Perl to Python converters? So far I
have only found bridgekeeper which really is (was?) consultancy.
Apart from that I only find people recommending a manual re-write.
Any thoughts/recommendations?
Voice of almost no experience. I once ran a
Terry Reedy wrote:
I can imagine a day when code compiled from Python is routinely
time-competitive with hand-written C.
In my very limited experience it was very informative programming in C for
PIC microcontrollers and inspecting the assembly code produced. If I just
threw together loops
Simon Forman wrote:
Someone else will probably give you better advice, but have you looked
at pygame? IIRC they have a pretty simple audio playback api.
I'm using pygame for something else. Will it work without the graphics side
being used? I suppose trying it is the best plan!
Pete
--
What are recommendations for simple audio playback? I want to play back on
linux (Slackware), which uses alsa. There seem to be many ways - but some
are a couple of years old and won't compile, like pymedia, or seem not
widely used and need pulseaudio (swmixer) which I have not installed. I
Robert Kern wrote:
You need to put main.py into the pphoto package.
$ mkdir pphoto/
$ mv main.py pphoto/
$ touch pphoto/__init__.py
Thanks, it worked. Any ideas how to run the resulting scripts without
installing or running as root?
Pete
--
http://www.petezilla.co.uk
--
Chaps,
any ideas, I'm floundering - I don't quite get it. I have the following
files, setup.py and main.py in a directory pphoto:
# more setup.py
from setuptools import setup, find_packages
setup(
name = Pphoto,
version = 0.1,
packages = find_packages(),
# other arguments
What is a good way to do this? There are instructions on making modules at:
http://docs.python.org/distutils/setupscript.html
however, what do you do if you don't want a module? I'm thinking of where
I'd like to split the code into several files and have a build / setup
script put it together
Krishnakant wrote:
Have you considered creating a deb or rpm package for your application?
Most of the documentation for deb or rpm will talk about make files.
But even a distutil based python package (with a setup.py) can be made
into a deb package.
Then the your requirement will be
Diez B. Roggisch wrote:
You should consider using setuptools. Then you get an egg that people
can install, and you can define console_scripts-entry-points which
will be installed into /usr/local/bin or similar locations.
Interesting, I think I need to have a play with that. The cross
Chaps,
what's the most appropriate (maintained) graphics library to use? PIL seems
to have last been updated in 2006 http://www.pythonware.com/products/pil/
and GD seems to be even older. Don't want to go down a dead end.
Pete
--
http://www.petezilla.co.uk
--
Michiel Overtoom wrote:
Peter Chant wrote:
what's the most appropriate (maintained) graphics library to use? PIL
seems to have last been updated in 2006
http://www.pythonware.com/products/pil/
and GD seems to be even older. Don't want to go down a dead end.
Contrary to organic
Peter Chant wrote:
No, it does not. However, if PIL was updated last in 2006. Python in
2009
has gone to version 3.1. If PIL is compatible with 3.1 then I'm fine.
But I don't want to have to stick with Python 2.5 as the rest of the world
moves on.
BTW, this was not a critisism of PIL
Max Erickson wrote:
More recent months contain updates to the status of 1.1.7, it is
headed towards a release. Preliminary tarballs and binaries are
available on effbot.org:
http://effbot.org/downloads/#imaging
http://effbot.org/downloads/#pil
Excellent. From a very brief look it seems
Chaps,
I have the following code:
if pygame.font:
font = pygame.font.Font(None, 36)
#font = pygame.font.Font('liberationserif',36)
text = font.render(Esc to quit., 1, (10, 10, 10))
textpos = text.get_rect()
textpos.centerx = background.get_rect().centerx
Robert Kern wrote:
snd = swmixer.Sound(data=tone_data)
Well, sort of. You probably need to scale your data and convert it to
int16 format. It's currently in floating point format.
Done and working, thanks. As file was not needed for file=test.wav I
assumed the data prefix for data was
Hello,
I'm a bit of a python newby. I want to play and record sound
simultaneously. SWMixer seems able to do this but the examples use WAV
files. I'm trying to play a test tone. Can anyone give me a steer as to
why this fails?
import sys
import swmixer
import numpy
23 matches
Mail list logo