Re: efficient memoize decorator?

2006-08-19 Thread Ziga Seilnacht
[EMAIL PROTECTED] wrote: > im plugging away at the problems at > http://www.mathschallenge.net/index.php?section=project > im trying to use them as a motivator to get into advanced topics in > python. > one thing that Structure And Interpretation Of Computer Programs > teaches is that memoisation i

Re: couple more questions about sqlite

2006-08-19 Thread John Machin
Robert Kern wrote: > John Machin wrote: > > John Salerno wrote: > >> John Machin wrote: > >> > >>> Your confusion is quite understandable. I started looking at sqlite > >>> when the announcement that it would be included in Python 2.5 came out. > >>> Puzzlement reigned. I ended up with the followi

Re: sum and strings

2006-08-19 Thread Bill Pursell
Georg Brandl wrote: > Paul Rubin wrote: > > Sybren Stuvel <[EMAIL PROTECTED]> writes: > >> Because of "there should only be one way to do it, and that way should > >> be obvious". There are already the str.join and unicode.join methods, > > > > Those are obvious??? > > Why would you try to sum up

Re: couple more questions about sqlite

2006-08-19 Thread John Machin
Dennis Lee Bieber wrote: > > The only reason, then, to download the stand-alone SQLite package > (not the python package) would be to obtain the command line query/admin > tool. Pre-compiles binaries of the tool are available for Linux and Windows. http://www.sqlite.org/download.html

Re: Documenting a package with Pydoc

2006-08-19 Thread Rob Cowie
Anyone? -- http://mail.python.org/mailman/listinfo/python-list

sending values over classes

2006-08-19 Thread Rafał Janas
Hi, How to read/write value over different classes (in different files) Something like global values? Thanks Rafał -- http://mail.python.org/mailman/listinfo/python-list

Re: efficient memoize decorator?

2006-08-19 Thread [EMAIL PROTECTED]
thanks, i was not just being lazy. i wanted to play with decorators and tell people on the forums how cool python is :) cheers for getting back to me, i could have done that myself i think, bar the error checking. do you have any links on good practice in python (i do think i am very lazy re: error

Re: efficient memoize decorator?

2006-08-19 Thread [EMAIL PROTECTED]
does not seem to work for standalone functions, this is a method decorator only then? Traceback (most recent call last): File "prob14memoize.py", line 94, in ? length = col(i,1) File "prob14memoize.py", line 49, in __call__ object = self.cache[args] = self.fn(self.instance, *args) Attr

Re: efficient memoize decorator?

2006-08-19 Thread [EMAIL PROTECTED]
am i correct in thinking that psyco will just not accelerate, rather than break code it cannot deal with? that has been a pretty standard import on all my programs tom Ziga Seilnacht wrote: > [EMAIL PROTECTED] wrote: > > im plugging away at the problems at > > http://www.mathschallenge.net/index

Small Troll on notation of variables over time

2006-08-19 Thread Hendrik van Rooyen
Hi there, I can write: s = 'some string' then print s[1] will be the string 'o' and a while later I can write: s = 'other some string' then print s[1] will be the string 't' and then: s = [1,2,3,4] then print s[1] will be the number 2 and still later: s = {1:'boo',2:'foo',3:'shoo'} when pri

Re: text editor suggestion?

2006-08-19 Thread BartlebyScrivener
>> Oh well, I'll just keep trying different ones. If you demand power and cross-platform compatibility, I think you already know your choices are Xemacs or Vim 7.0. They are both modal and therefore difficult to learn, at first, but later you enjoy the pleasures of interface Zen: http://tinyurl.

Re: efficient memoize decorator?

2006-08-19 Thread [EMAIL PROTECTED]
I suppose that lesson should not suprise me, programming is a subtle art that i need spend some time mastering thanks to all that have replied tom Fredrik Lundh wrote: > Gabriel Genellina wrote: > > > This implementation uses cPickle to generate a key from the supplied > > function arguments,

How to get the ascii code of Chinese characters?

2006-08-19 Thread many_years_after
Hi,everyone: Have you any ideas? Say whatever you know about this. thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Text to MP3 using pyTTS - Non-programmer question

2006-08-19 Thread Ravi Teja
[EMAIL PROTECTED] wrote: > Thanks for the script. Are there any online python intrepreters? > > I'd like to play around with the script. I don't have access to my home > PC. You probably will have to wait till you get to yours. There were some AJAXian ones but I doubt that you will find a free (a

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread Philippe Martin
many_years_after wrote: > Hi,everyone: > > Have you any ideas? > > Say whatever you know about this. > > > thanks. Hi, You mean unicode I assume: http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml Regards, Philippe -- http://mail.python.org/mailman/listinfo/pytho

Re: text editor suggestion?

2006-08-19 Thread Philippe Martin
John Salerno wrote: > Ok, I know it's been asked a million times, but I have a more specific > question so hopefully this won't be just the same old post. I've tried a > few different editors, and I really like UltraEdit, but it's > Windows-only and I'm working more on Linux nowadays. > > Here ar

Re: Documenting a package with Pydoc

2006-08-19 Thread Gabriel Genellina
At Friday 18/8/2006 11:45, Rob Cowie wrote: Pydoc seems to be capable of writing documentation for all modules within a package by simply pointing it to the package on the command line... pydoc -w Certainly, the method writedocs() appears to descend into a directory and create docs for each i

Re: text editor suggestion?

2006-08-19 Thread mystilleef
http://scribes.sourceforge.net/ Flash Demo: http://scribes.sourceforge.net/snippets.htm GIF Demo: http://www.minds.may.ie/~dez/images/blog/scribes.html Scribes is simple, slim, sleek and fast. It has no learning curve and conveys a no nonsense approach to text editing. You won't need to edit con

Re: Small Troll on notation of variables over time

2006-08-19 Thread Chris Johnson
Hendrik van Rooyen wrote: > Hi there, > > I can write: > > s = 'some string' > then print s[1] will be the string 'o' > > and a while later I can write: > > s = 'other some string' > then print s[1] will be the string 't' > > and then: > > s = [1,2,3,4] > then print s[1] will be the number 2 > > a

Re: efficient memoize decorator?

2006-08-19 Thread Gabriel Genellina
At Saturday 19/8/2006 07:58, [EMAIL PROTECTED] wrote: am i correct in thinking that psyco will just not accelerate, rather than break code it cannot deal with? that has been a pretty standard import on all my programs Don't optimize what doesn't deserve optimization... That's a pretty standar

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread John Machin
many_years_after wrote: > Hi,everyone: > > Have you any ideas? > > Say whatever you know about this. > Perhaps you had better explain what you mean by "ascii code of Chinese characters". Chinese characters ("hanzi") can be represented in many ways on a computer, in Unicode as well as man

Re: efficient memoize decorator?

2006-08-19 Thread Gabriel Genellina
At Saturday 19/8/2006 07:56, [EMAIL PROTECTED] wrote: does not seem to work for standalone functions, this is a method decorator only then? Traceback (most recent call last): File "prob14memoize.py", line 94, in ? length = col(i,1) File "prob14memoize.py", line 49, in __call__ objec

Re: Small Troll on notation of variables over time

2006-08-19 Thread John Machin
Hendrik van Rooyen wrote: [snip] > What do you guys think? The subject said it all. You should find some other way of entertaining yourself on the weekends :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Small Troll on notation of variables over time

2006-08-19 Thread Gabriel Genellina
At Saturday 19/8/2006 07:49, Hendrik van Rooyen wrote: Now how about introducing an index that works over time, such that s{0} (the default so as to not break any existing code) implies the current object bound to the name s, with s{1} being the previous one, and so on... Doing that *always* f

Re: Subprocess quote problem

2006-08-19 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Adriano Monteiro wrote: > "Failed to open input file "/home/adriano/umit/test/targets" for reading > QUITTING!" Which is not the same as saying: "Failed to open input file /home/adriano/umit/test/targets for reading QUITTING!" Spot the difference? > command

Re: couple more questions about sqlite

2006-08-19 Thread Joel Rosdahl
John Salerno <[EMAIL PROTECTED]> writes: > What is really confusing is that I did a search for 'sqlite' in my > Ubuntu repositories and it came up with entries like this: > > python2.4-pysqlite1.1 python interface to SQLite 3 > python2.4-pysqlite2 python interface to SQLite 3 > python2.4-pys

write eof without closing

2006-08-19 Thread cage
hello can i write a eof to a file descriptor without closing it? like: fd.write(EOF) or something grts, ruben -- http://mail.python.org/mailman/listinfo/python-list

Zope hosting

2006-08-19 Thread Frank Krugmann
I'am searching a cheap ZPP Hoster. Some informations? Greetings Escorial2000 -- http://mail.python.org/mailman/listinfo/python-list

Re: timezones and time_t

2006-08-19 Thread Eyal Lotem
MrBlueSky wrote: > Hi, > I've got a Python application that (as well as lots of other stuff!) > has to translate time_t values into strings in the TZ of the users > choice. Looking at the Python Library Reference, I can see no platform > independent way of setting the TZ that time.localtime() ret

Re: write eof without closing

2006-08-19 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, cage wrote: > can i write a eof to a file descriptor without closing it? > like: > fd.write(EOF) > or something What do you expect this to to? Writing a byte to the file and you don't know which value this byte has? Ciao, Marc 'BlackJack' Rintsch -- http:/

Re: text editor suggestion?

2006-08-19 Thread milosz
Did you try gedit? It has an options, which you need, I think. Regards. -- http://mail.python.org/mailman/listinfo/python-list

tkinter btn visual state with tkMessageBox

2006-08-19 Thread jmdeschamps
why is the button sunken when called through a bind method, and not with the command attribute? Thank you! ## Cut'nPaste example from Tkinter import * import tkMessageBox class Vue(object): def __init__(self): self.root=Tk() self.root.title("test button visual state")

Re: Questions on unittest behaviour

2006-08-19 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Collin Winter" <[EMAIL PROTECTED]> wrote: > While working on a test suite for unittest these past few weeks, I've > run across some behaviours that, while not obviously wrong, don't > strike me as quite right, either. Submitted for your consideration: > > 1) Test

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread Philippe Martin
Philippe Martin wrote: > many_years_after wrote: > >> Hi,everyone: >> >> Have you any ideas? >> >> Say whatever you know about this. >> >> >> thanks. > Hi, > > You mean unicode I assume: > http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml > > Regards, > > Philipp

Re: Small Troll on notation of variables over time

2006-08-19 Thread Hendrik van Rooyen
"John Machin" <[EMAIL PROTECTED]> wrote: | | Hendrik van Rooyen wrote: | [snip] | > What do you guys think? | | The subject said it all. You should find some other way of entertaining | yourself on the weekends :-) This is the right answer... *grin* - well - at least you *were* warned... -

Re: PyThreadState_Swap(NULL)

2006-08-19 Thread Jack Diederich
On Fri, Aug 18, 2006 at 02:21:40PM -0700, Bryan wrote: > > i've written a program that uses python c api code that lives in a > shared library that is loaded by a custom apache module (mod_xxx). this > python c api code all works correctly under our test server and under > apache but only if mo

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread many_years_after
hi: what I want to do is just to make numbers as people input some Chinese character(hanzi,i mean).The same character will create the same number.So I think ascii code can do this very well. John Machin wrote: > many_years_after wrote: > > Hi,everyone: > > > > Have you any ideas? > > > >

Re: how do you get the name of a dictionary?

2006-08-19 Thread Duncan Booth
Tim Chase wrote: > >>> [name for name in dir() if id(eval(name)) == id(banana)] > ['banana', 'spatula'] > Please, if you are going to do something like this, then please at least use the 'is' operator. Using id(expr1)==id(expr2) is just plain stupid: it will actually work in this case, but as

Re: write eof without closing

2006-08-19 Thread Grant Edwards
On 2006-08-19, cage <[EMAIL PROTECTED]> wrote: > can i write a eof to a file descriptor without closing it? No. Not on Windows, OS-X, or Unix. There is no such thing as "an eof". On CP/M Ctrl-Z is used as EOF for text files. -- Grant Edwards [EMAIL PROTECTED] -- http://mail.python.org/mail

=?utf-8?Q?Re:_Packt_published_an_article_about_xtopdf_=2D_creating_PDF_from_Plain=0A=09Text, _DBF, _CSV, _TDV, _and_XLS_Data?=

2006-08-19 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Re: Zope 3.3.0 beta 2 released!

2006-08-19 Thread david_wahler
I'll be out of the office until approximately August 20th. If you have any questions, please email [EMAIL PROTECTED] -- David Wahler -- http://mail.python.org/mailman/listinfo/python-list

Packt published an article about xtopdf - creating PDF from Plain Text, DBF, CSV, TDV, and XLS Data

2006-08-19 Thread vasudevram
Hi group, This is an article I wrote for Packt Publishing - http://www.packtpub.com : Using xtopdf, a PDF creation toolkit - http://www.packtpub.com/article/Using_xtopdf It shows how to use xtopdf - http://sourceforge.net/projects/xtopdf - to create PDF from plain text, DBF, CSV, TDV and XLS dat

Re: write eof without closing

2006-08-19 Thread cage
Marc 'BlackJack' Rintsch schreef: > In <[EMAIL PROTECTED]>, cage wrote: > >> can i write a eof to a file descriptor without closing it? >> like: >> fd.write(EOF) >> or something > > What do you expect this to to? Writing a byte to the file and you don't > know which value this byte has? >

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, many_years_after wrote: > what I want to do is just to make numbers as people input some Chinese > character(hanzi,i mean).The same character will create the same > number.So I think ascii code can do this very well. No it can't. ASCII doesn't contain Chinese characters.

Re: write eof without closing

2006-08-19 Thread Tim Chase
>> can i write a eof to a file descriptor without closing it? > > No. Not on Windows, OS-X, or Unix. There is no such thing as > "an eof". > > On CP/M Ctrl-Z is used as EOF for text files. Common Dos/Window convention also uses ctrl+Z (0x1a) for EOF. c:\> copy con test.txt hel

Re: tkinter btn visual state with tkMessageBox

2006-08-19 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: To: | why is the button sunken when called through a bind method, and not | with the command attribute? | Thank you! | | | ## Cut'nPaste example | from Tkinter import * | import tkMessageBox | | class Vue(object): | def __init__(self): | self.root=Tk() |

Re: PyThreadState_Swap(NULL)

2006-08-19 Thread Bryan
Jack Diederich wrote: > On Fri, Aug 18, 2006 at 02:21:40PM -0700, Bryan wrote: >> i've written a program that uses python c api code that lives in a >> shared library that is loaded by a custom apache module (mod_xxx). this >> python c api code all works correctly under our test server and under

Re: write eof without closing

2006-08-19 Thread Lars
cage wrote: > I want to use a program that has a 'pipe' mode, in which you can use > stdin to send commands to the program. I found out that, when in pipe > mode and you are using the keyboard as input source you can do Ctrl-D to > 'signal' the program that you have finished typing your command.

Re: write eof without closing

2006-08-19 Thread Diez B. Roggisch
cage schrieb: > Marc 'BlackJack' Rintsch schreef: >> In <[EMAIL PROTECTED]>, cage wrote: >> >>> can i write a eof to a file descriptor without closing it? >>> like: >>> fd.write(EOF) >>> or something >> >> What do you expect this to to? Writing a byte to the file and you don't >> know which va

Re: write eof without closing

2006-08-19 Thread cwarren89
Writing the binary value for ^D into the stream will not do anything. That value signals the shell to close the stream, as such it only has significance when you're typing something into the shell. To the OP: writing an EOF to a stream without closing it makes no sense. EOF means just that--end of

[ANN] clnum-1.3 Class Library For Numbers Python Binding

2006-08-19 Thread Raymond L. Buvel
The clnum package adds rational numbers and arbitrary precision floating point numbers in real and complex form to Python. Also provides arbitrary precision floating point replacements for the functions in the math and cmath standard library modules. Home page: http://calcrpnpy.sourceforge.net/cln

Re: write eof without closing

2006-08-19 Thread cwarren89
Actually, nevermind. It appears that receiving an EOF from a stream tells it when to stop 'reading', not necessarily that the stream is closed. What a weird behavior. -- http://mail.python.org/mailman/listinfo/python-list

how to use python com server in c++?

2006-08-19 Thread Leo Jay
dear all, i have a python com server like this: import win32com.server.register class HelloWorld: _reg_clsid_ = "{B0EB5AAB-0465-4D54-9CF9-04ADF7F73E4E}" _reg_desc_ = 'Python test com server' _reg_progid_= "Leojay.ComServer" _public_methods_= ['Add', 'M

[ANN] ratfun-2.3 Polynomials and Rational Functions

2006-08-19 Thread Raymond L. Buvel
The ratfun module provides classes for defining polynomial and rational function (ratio of two polynomials) objects. These objects can be used in arithmetic expressions and evaluated at a particular point. Home page: http://calcrpnpy.sourceforge.net/ratfun.html Note: If you are using rpncalc-1.2

[ANN] rpncalc-2.4 RPN Calculator for Python

2006-08-19 Thread Raymond L. Buvel
The rpncalc package adds an interactive Reverse Polish Notation (RPN) interpreter to Python. This interpreter allows the use of Python as an RPN calculator. You can easily switch between the RPN interpreter and the standard Python interpreter. Home page: http://calcrpnpy.sourceforge.net/ Chang

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread Thorsten Kampe
* many_years_after (2006-08-19 12:18 +0100) > Hi,everyone: > > Have you any ideas? > > Say whatever you know about this. contradictio in adiecto -- http://mail.python.org/mailman/listinfo/python-list

Re: text editor suggestion?

2006-08-19 Thread Thorsten Kampe
* John Salerno (2006-08-19 02:20 +0100) > Ok, I know it's been asked a million times, but I have a more specific > question so hopefully this won't be just the same old post. I've tried a > few different editors, and I really like UltraEdit, but it's > Windows-only and I'm working more on Linux

Re: PyThreadState_Swap(NULL)

2006-08-19 Thread Jack Diederich
On Sat, Aug 19, 2006 at 09:08:21AM -0700, Bryan wrote: > Jack Diederich wrote: > > On Fri, Aug 18, 2006 at 02:21:40PM -0700, Bryan wrote: > >> i've written a program that uses python c api code that lives in a > >> shared library that is loaded by a custom apache module (mod_xxx). this > >> pyth

Re: write eof without closing

2006-08-19 Thread Philippe Martin
cage wrote: > hello > > can i write a eof to a file descriptor without closing it? > like: > fd.write(EOF) > or something > > grts, > ruben No but there is an EOF to the file anyway, even if it is open. I recall under MS-DOS, you could create a file of size N without writing to it (some INT21

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread Gerhard Fiedler
On 2006-08-19 12:42:31, Marc 'BlackJack' Rintsch wrote: > many_years_after wrote: > >> what I want to do is just to make numbers as people input some Chinese >> character(hanzi,i mean).The same character will create the same >> number.So I think ascii code can do this very well. > > No it can't.

Re: sending values over classes

2006-08-19 Thread Rob Wolfe
"Rafał Janas" <[EMAIL PROTECTED]> writes: > Hi, > > How to read/write value over different classes (in different files) > Something like global values? You need to be more specific about what exactly you're trying to accomplish. Some code whould be great. Maybe import statement is what you're lo

Re: Optimizing Inner Loop Copy

2006-08-19 Thread danielx
Mark E. Fenner wrote: > Paul McGuire wrote: > > > "Mark E. Fenner" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > >> Hello all, > >> > > > >> > >> Here's my class of the objects being copied: > >> > >> class Rule(list): > >> def __init__(self, lhs=None, rhs=None, nClasses=0,

How to catch these kind of bugs in Python?

2006-08-19 Thread asincero
Is there anyway to catch the following type of bug in Python code: message = 'This is a message' # some code # some more code if some_obscure_condition: nessage = 'Some obscure condition occured.' # yet more code # still more code print message In the above example, message should be set to '

Re: sending values over classes

2006-08-19 Thread Rafał Janas
Hi, Exactly I want to set global value (like session - who is log in) I writing simple program with more than one class - every window has different class in different file. Example: 2 files (main and wind). Main is main window and wind is child window. I want to send value from main to child from

Re: How to catch these kind of bugs in Python?

2006-08-19 Thread Jorge Godoy
"asincero" <[EMAIL PROTECTED]> writes: > In the above example, message should be set to 'Some obscure condition > occured.' if some_obscure_condition is True. But due to a lack of > sleep, and possibly even being drunk, the programmer has mistyped > message. These types of bugs would easily be c

Re: How to catch these kind of bugs in Python?

2006-08-19 Thread dave . brueck
asincero wrote: > Is there anyway to catch the following type of bug in Python code: > > message = 'This is a message' > if some_obscure_condition: >nessage = 'Some obscure condition occured.' > print message > > > In the above example, message should be set to 'Some obscure condition > occured

Embedding python: GCC gives errors of "undefined reference" to Py_* functions.

2006-08-19 Thread Shuaib
Hey! I am trying to embedd python into a C programe of mine. But when I try to compile the C code, gcc gives errors like "undefined reference to `Py_Finalize'" and the same kind for all the other functions. I have incuded "Python.h". Any idea what might be wrong? Thanks. -- http://mail.python.

install patch on windows

2006-08-19 Thread djoefish
Does anyone know how to install a patch on Winodws? For example, I want to install the patch 'ocmalloc-free-arenas.diff' in Python 2.3. thanks... -- http://mail.python.org/mailman/listinfo/python-list

Google groups api

2006-08-19 Thread fooshm
Hello, Is there any module for searching google groups, something like PyGoogle ? Thank you in advance, Efi -- http://mail.python.org/mailman/listinfo/python-list

Stopping all threads from other thread

2006-08-19 Thread amadeusz . jasak
Hello, it is possible to stop all threads (application) from thread of application: App |-MainThread |-WebServer |-CmdListener # From this I want to stop App The sys.exit isn't working... Amadeusz Jasak (Poland) -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding python: GCC gives errors of "undefined reference" to Py_* functions.

2006-08-19 Thread Shuaib
OK, I am not ashamed to admit that I am ashamed as I didn't search the group for my problem before posting it yet again. The solution was right there. I have link in my libpython2.4.so while compiling. $gcc -I/usr/include/python2.4/ -lpython2.4 -o foo foo.c Shuaib wrote: > Hey! > > I am trying

Re: install patch on windows

2006-08-19 Thread Tim Golden
djoefish wrote: > Does anyone know how to install a patch on Winodws? For example, I want > to install the patch 'ocmalloc-free-arenas.diff' in Python 2.3. You can get patch (and quite a lot besides) for win32 from the UnxUtils project: http://sourceforge.net/projects/unxutils TJG -- http://ma

Re: ratfun-2.3 Polynomials and Rational Functions

2006-08-19 Thread Bas
Are there any differences between this module and the one already present in numpy? http://www.scipy.org/doc/numpy_api_docs/numpy.lib.polynomial.html Cheers, Bas -- http://mail.python.org/mailman/listinfo/python-list

Re: install patch on windows

2006-08-19 Thread djoefish
Tim Golden wrote: > djoefish wrote: > > Does anyone know how to install a patch on Winodws? For example, I want > > to install the patch 'ocmalloc-free-arenas.diff' in Python 2.3. > > You can get patch (and quite a lot besides) for win32 from > the UnxUtils project: > > http://sourceforge.net/proj

Re: install patch on windows

2006-08-19 Thread Jorge Godoy
"djoefish" <[EMAIL PROTECTED]> writes: > Tim Golden wrote: >> djoefish wrote: >> > Does anyone know how to install a patch on Winodws? For example, I want >> > to install the patch 'ocmalloc-free-arenas.diff' in Python 2.3. >> >> You can get patch (and quite a lot besides) for win32 from >> the Un

Python complaining about CherryPY?

2006-08-19 Thread Thomas McLean
Hi all, First post to the list, so first off, I'm new to Python and everything surrounding it so if you can please ignore my ignorance. I setup a cherryPY server so that I could use sabnzbd but once, I have installed/configured what I was told by the tutorials and everything else. I run ubuntu x8

Embedding python: Segmentation Fault

2006-08-19 Thread Shuaib
Hi! I am trying to embed python into a C programe of mine. When the execution reaches the following line pModule = PyImport_Import(pName); It causes a Segmentation Fault Error. pModule is of type PyObject *, so is pName. What could be the possible reasons for the error? Thanks for your time.

Re: install patch on windows

2006-08-19 Thread djoefish
Jorge Godoy wrote: > "djoefish" <[EMAIL PROTECTED]> writes: > > > Tim Golden wrote: > >> djoefish wrote: > >> > Does anyone know how to install a patch on Winodws? For example, I want > >> > to install the patch 'ocmalloc-free-arenas.diff' in Python 2.3. > >> > >> You can get patch (and quite a lo

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread Peter Maas
Gerhard Fiedler wrote: > Well, ASCII can represent the Unicode numerically -- if that is what the OP > wants. No. ASCII characters range is 0..127 while Unicode characters range is at least 0..65535. > For example, "U+81EC" (all ASCII) is one possible -- not very > readable though -- representat

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread John Machin
many_years_after wrote: > John Machin wrote: > > many_years_after wrote: > > > Hi,everyone: > > > > > > Have you any ideas? > > > > > > Say whatever you know about this. > > > > > > > Perhaps you had better explain what you mean by "ascii code of Chinese > > characters". Chinese charact

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread Gerhard Fiedler
On 2006-08-19 16:54:36, Peter Maas wrote: > Gerhard Fiedler wrote: >> Well, ASCII can represent the Unicode numerically -- if that is what the OP >> wants. > > No. ASCII characters range is 0..127 while Unicode characters range is > at least 0..65535. Actually, Unicode goes beyond 65535. But rig

Re: Documenting a package with Pydoc

2006-08-19 Thread Rob Cowie
Gabriel Genellina wrote: > At Friday 18/8/2006 11:45, Rob Cowie wrote: > > >Pydoc seems to be capable of writing documentation for all modules > >within a package by simply pointing it to the package on the command > >line... > > > >pydoc -w > > > >Certainly, the method writedocs() appears to des

Re: How to get the ascii code of Chinese characters?

2006-08-19 Thread John Machin
many_years_after wrote: > hi: > > what I want to do is just to make numbers as people input some Chinese > character(hanzi,i mean).The same character will create the same > number.So I think ascii code can do this very well. > Possibly you have "create" upside-down. Could you possibly be talking

streaming audio with standard modules?

2006-08-19 Thread Marc Shapiro
I am running Python 2.3 on Linux. I am trying to write a program to simulate a hardware mixer to play theatrical sound cues. I need to be able to play multiple sound channels at once, controlling volume by channel as well as globally. I also need to be able to pan a channel through left and r

Re: timezones and time_t

2006-08-19 Thread MrBlueSky
Thanks for the reply. Unfortunately, a simple "+offset" type solution isn't really accurate enough for the kind of scenario I'm looking at. I'm often dealing with different timezones with DST changeovers on different dates or even different times of day! So I need industrial-strength timezone han

Re: ratfun-2.3 Polynomials and Rational Functions

2006-08-19 Thread Raymond L. Buvel
Bas wrote: > Are there any differences between this module and the one already > present in numpy? > > http://www.scipy.org/doc/numpy_api_docs/numpy.lib.polynomial.html > > Cheers, > Bas > Yes, there are quite a few. This module uses a multi-precision library (clnum) to make the calculations m

trouble using "\" as a string

2006-08-19 Thread OriginalBrownster
Hi there... I'm still pretty new to turbogears. but i have gotten pretty familiar with it i'm just trying to clear something up, i'm having a difficult time using \ when declaring a string expression such as tempname="\"..it says that the line is single qouted. i want this because using python

Re: couple more questions about sqlite

2006-08-19 Thread John Salerno
Joel Rosdahl wrote: > John Salerno <[EMAIL PROTECTED]> writes: > >> What is really confusing is that I did a search for 'sqlite' in my >> Ubuntu repositories and it came up with entries like this: >> >> python2.4-pysqlite1.1 python interface to SQLite 3 >> python2.4-pysqlite2 python interfac

Re: text editor suggestion?

2006-08-19 Thread John Salerno
Sybren Stuvel wrote: > John Salerno enlightened us with: >> I'd really like to learn vim, but I spent days just trying to figure >> out how to get the syntax highlighting and indentation working, >> where these settings are and how to edit them > > Stop being a man and just ask for directions :)

Re: text editor suggestion?

2006-08-19 Thread John Salerno
milosz wrote: > Did you try gedit? > It has an options, which you need, I think. > Regards. > Yes, I tried it and it's alright, but it doesn't support smart indentation or much customizing of syntax highlighting (i.e. you can change the color of functions, but you can't define what a 'function'

Re: trouble using "\" as a string

2006-08-19 Thread Jim
Try using: tempname = "\\" Jim OriginalBrownster wrote: > Hi there... > > I'm still pretty new to turbogears. but i have gotten pretty familiar > with it > > i'm just trying to clear something up, i'm having a difficult time > using \ when declaring a string expression > > such as tempname="\"..i

Re: How to catch these kind of bugs in Python?

2006-08-19 Thread Ravi Teja
asincero wrote: > Is there anyway to catch the following type of bug in Python code: > > message = 'This is a message' > # some code > # some more code > if some_obscure_condition: >nessage = 'Some obscure condition occured.' > # yet more code > # still more code > print message > > > In the ab

Re: sum and strings

2006-08-19 Thread Georg Brandl
Bill Pursell wrote: > Georg Brandl wrote: >> Paul Rubin wrote: >> > Sybren Stuvel <[EMAIL PROTECTED]> writes: >> >> Because of "there should only be one way to do it, and that way should >> >> be obvious". There are already the str.join and unicode.join methods, >> > >> > Those are obvious??? >> >>

Re: how to use python com server in c++?

2006-08-19 Thread Butternut Squash
Leo Jay wrote: > dear all, > i have a python com server like this: > > import win32com.server.register > > class HelloWorld: > _reg_clsid_ = "{B0EB5AAB-0465-4D54-9CF9-04ADF7F73E4E}" > _reg_desc_ = 'Python test com server' > _reg_progid_= "Leojay.ComServer" >

Re: Questions on unittest behaviour

2006-08-19 Thread John Roth
Collin Winter wrote: > While working on a test suite for unittest these past few weeks, I've > run across some behaviours that, while not obviously wrong, don't > strike me as quite right, either. Submitted for your consideration: > > 1) TestCase.tearDown() is only run if TestCase.setUp() succeede

Re: Python complaining about CherryPY?

2006-08-19 Thread dimitri pater
Hi Thomas,try the CP mailinglist: http://www.cherrypy.org/wiki/CherryPyMailingLists , they can probably answer your question.cheers,Dimitri On 8/19/06, Thomas McLean <[EMAIL PROTECTED]> wrote: Hi all,First post to the list, so first off, I'm new to Python and everythingsurrounding it so if you can

Re: install patch on windows

2006-08-19 Thread djoefish
djoefish wrote: > Jorge Godoy wrote: > > "djoefish" <[EMAIL PROTECTED]> writes: > > > > > Tim Golden wrote: > > >> djoefish wrote: > > >> > Does anyone know how to install a patch on Winodws? For example, I want > > >> > to install the patch 'ocmalloc-free-arenas.diff' in Python 2.3. > > >> > > >>

Re: trouble using "\" as a string

2006-08-19 Thread OriginalBrownster
that stores tempname as "\\" .. Jim wrote: > Try using: tempname = "\\" > Jim > > > OriginalBrownster wrote: > > Hi there... > > > > I'm still pretty new to turbogears. but i have gotten pretty familiar > > with it > > > > i'm just trying to clear something up, i'm having a difficult time > > us

istep() addition to itertool? (Was: Re: Printing n elements per line in a list)

2006-08-19 Thread Rhamphoryncus
unexpected wrote: > If have a list from 1 to 100, what's the easiest, most elegant way to > print them out, so that there are only n elements per line. I've run into this problem a few times, and although many solutions have been presented specifically for printing I would like to present a more g

cloning generator iterators

2006-08-19 Thread Bernhard Mulder
I have something like the following (using Python 2.5 syntax): class adapt(object): def __init__(self): self.iterator = self.generator() self.n = 0 def generator(self): while True: while True: if (yield 1): if (yield 1

  1   2   >