Re: Keep getting this in PyDev TypeError: quiz() takes exactly 1 argument (0 given)

2012-08-10 Thread Pedro Kroger

On Aug 10, 2012, at 3:52 PM, Chuck galois...@gmail.com wrote:

if __name__ == '__main__':
 
quiz()
 
 

You need to instantiate your class:

foo = ElementsQuiz()
foo.quiz()


Pedro
-
http://pedrokroger.net
http://musicforgeeksandnerds.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: docx/lxml

2012-07-31 Thread Pedro Kroger

On Jul 31, 2012, at 10:36 AM, cyrille.ler...@gmail.com wrote:

 - Do you know any *easy to use*, *easy to deploy* package to generate .doc 
 like documents ?
 - Do you have any suggestion to do it differently (maybe with native packages 
 ?)
 
 - As a python newby, I don't understand why you have to go through the pain 
 of installing packages since they should be able to work with just the 
 __init__.py files ? 
 
 Regards,
 
 Cyrille

Hi,

May I suggest you use pip and, possibly, virtualenv?
pip makes it easy to install Python packages while virtualenv creates an 
isolated Python environment

For instance, I just installed docx and its dependencies with:

pip install docx lxml datutils PIL

And I did that inside a testing virtualenv, so I wouldn't mess up my Python 
setup.

pip and virtualenv make it really easy and painless to install Python packages.

Cheers,

Pedro
-
http://pedrokroger.net
http://musicforgeeksandnerds.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [ANN] pyknon: Simple Python library to generate music in a hacker friendly way.

2012-07-31 Thread Pedro Kroger
On Aug 1, 2012, at 12:19 AM, Peter Billam pe...@www.pjb.com.au wrote:

 I'll check it out.  It probably fits into a whole software
 ecosystem that you're putting together …

yes, I use it for my book, Music for Geeks and Nerds and for teaching.

 It's a crowded area, e.g. my midi stuff is at:
  http://www.pjb.com.au/midi/index.html

You have very interesting stuff, I'll check them out.

 and I'd probably do the above example by:
  ~ muscript -midi EOT demo.mid
  | 3/4 2.0
  =1 treble 4 D 8 [F# A] 4 Bb
  EOT

Nice. This reminded me to include a less simple example. After all,
the whole point of pyknon is to be able to generate music programmatically
using Python:

http://kroger.github.com/pyknon/

 You could consider posting Pyknon to comp.music.midi ;
 it's very low traffic, but some real gurus lurk there.

Good idea, thanks for the suggestion.

Cheers,

Pedro
-
http://pedrokroger.net
http://musicforgeeksandnerds.com

-- 
http://mail.python.org/mailman/listinfo/python-list


[ANN] pyknon: Simple Python library to generate music in a hacker friendly way.

2012-07-30 Thread Pedro Kroger
Pyknon is a simple music library for Python hackers. With Pyknon you
can generate Midi files quickly and reason about musical proprieties.
It works with Python 2.7 and 3.2.

Pyknon is very simple to use, here's a basic example to create 4 notes
and save into a MIDI file::

from pyknon.genmidi import Midi
from pyknon.music import NoteSeq

notes1 = NoteSeq(D4 F#8 A Bb4)
midi = Midi(1, tempo=90)
midi.seq_notes(notes1, track=0)
midi.write(demo.mid)


It's available on PyPI and its homepage is
http://kroger.github.com/pyknon/

Best regards,

Pedro
-
http://pedrokroger.net
http://musicforgeeksandnerds.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [ANN] pyknon: Simple Python library to generate music in a hacker friendly way.

2012-07-30 Thread Pedro Kroger

On Jul 30, 2012, at 3:33 PM, Ethan Furman et...@stoneleaf.us wrote:

 Pedro Kroger wrote:
 Pyknon is a simple music library for Python hackers.
 
 Sounds cool.  How is 'Pyknon' pronounced?

I pronounce it similarly as google translate does:

http://translate.google.com/#English|English|Pyknon

It's a musical Greek term, but since it's a Python package, I think it's 
acceptable
to pronounce the Py part as pie ;-)

 It's available on PyPI and its homepage is
 http://kroger.github.com/pyknon/
 
 I would suggest you change the theme -- using Firefox 3.6 the page is very 
 difficult to read.

Thanks for the report. Do you mind if I ask why you are using such an old 
version?
(It looks fine with Firefox 14.0.1)

Cheers,

Pedro
-
http://pedrokroger.net
http://musicforgeeksandnerds.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Real time event accuracy

2012-05-09 Thread Pedro Kroger
I don't know the details of how Kontakt works, but you can try pygame.midi:

pygame.midi - is a portmidi wrapper orginally based on the pyportmidi wrapper. 
Also pygame.music can play midi files. Can get input from midi devices and can 
output to midi devices. For osx, linux and windows. New with pygame 1.9.0. 
python -m pygame.examples.midi --output
(http://wiki.python.org/moin/PythonInMusic)


Pedro

--
http://pedrokroger.net
http://musicforgeeksandnerds.com/


On May 9, 2012, at 1:33 PM, Toby wrote:

 On 05/09/2012 09:13 AM, Dave Angel wrote:
 On 05/09/2012 11:52 AM, Tobiah wrote:
 I'd like to send MIDI events from python to another
 program.  I'd like advice as to how to accurately
 time the events.  I'll have a list of floating point
 start times in seconds for the events, and I'd like to send them
 off as close to the correct time as possible.
 
 I'd also appreciate suggestions and pointers to a 
 suitable python MIDI library, and maybe an outline
 of what must be done to get the MIDI events to 
 the other program's MIDI in.
 
 Thanks,
 
 Tobiah
 
 You really need to specify the OS environment you're targeting, as well
 as telling what program you're intending to feed MIDI into, if you've
 already picked one.
 
 I'm using Kontakt on Windows 7.  The MIDI file think would be good, but
 (not having that computer in front of me) I don't think that Kontakt
 had the ability to open a MIDI file.
 
 Now, I know that I could load the file into Reaper, and use Kontakt
 as a plugin.  My problem is that I can't afford to mess with GUI menus
 during my composition process.  I need to edit a python program in
 Vi, then slap it out to python, hearing the music, then edit again.
 The cycle has to be very quick in order to get anything done.
 
 Loading Kontakt with a bunch of samples is very time consuming, so
 it needs to keep running.  Now, if I could find a program that would
 interpret the MIDI file and send events off to Kontakt either as a plugin
 or standalone, then the MIDI file generation idea would be perfect.
 
 
 
 Also, the midi file format has timing information, and that timing
 should be much better than trying to do it in python before sending
 commands to some external program.  In other words, instead of sleeping
 in your code and then issuing one midi event, use the midi file format
 to send a stream of commands that will be played according to the timing
 information included.
 
 
 
 
 
 -- 
 http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Real time event accuracy

2012-05-09 Thread Pedro Kroger
 I'd also appreciate suggestions and pointers to a 
 suitable python MIDI library, and maybe an outline
 of what must be done to get the MIDI events to the other program's MIDI in.

Mark Wirt's MidiUtil is a nice library for MIDI. It doesn't do exactly what you 
want (it generates MIDI files) but it's a nice library and it may be a good 
starting point:

http://code.google.com/p/midiutil/

Pedro

--
http://pedrokroger.net
http://musicforgeeksandnerds.com/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Converting a string to list for submission to easygui multenterb​ox

2012-05-01 Thread Pedro Kroger
Have you tried to use the function list?:

foo = (1,2,3)
list(foo)

Cheers,

Pedro

--
http://pedrokroger.net



On May 1, 2012, at 5:18 PM, ksals wrote:

 Please help a newbe.  I have a string returned from an esygui
 multchoicebox that looks like
  this:  ('ksals', '', 'alsdkfj', '3', '') I need to convert this to
  this:  ['ksals', '', 'alsdkfj', '3', '']
 
 This is so I can submit this to a multenterbox with 5 fields
 
 -- 
 http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list


[issue14256] test_logging fails if zlib is not present

2012-03-11 Thread Pedro Kroger

Pedro Kroger kro...@pedrokroger.net added the comment:

Attached patch to fix this issue.

--
keywords: +patch
nosy: +kroger
Added file: http://bugs.python.org/file24791/issue14256.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14256
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com