Re: Running a Python script from crontab

2008-12-02 Thread Philip Semanchuk
- SHELL=/usr/local/bin/bash PATH=/bin:/usr/bin:/usr/local/bin # minhhday mon dow */2 * * ** python /usr/local/foo/myscript.py >> / var/log/me/myscript.txt 2>&1 HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: setting path for python interpretor

2008-11-28 Thread Philip Semanchuk
On Nov 28, 2008, at 6:41 AM, Beema Shafreen wrote: Hi all, Can any body suggest me how to the set path for making python2.4 as the main interpretor instead of python 2.5. Hi Beema, This question is about your operating system, not about Python. On my system (OS X), having installed Pytho

Re: Python C/API simple debugging

2008-11-26 Thread Philip Semanchuk
without the DEBUG_ON flag. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: calling python scripts as a sub-process

2008-11-19 Thread Philip Semanchuk
On Nov 19, 2008, at 2:03 PM, Catherine Moroney wrote: The command (stored as an array of strings) that I'm executing is: ['python ../src_python/Match1.py ', '-- file_ref=MISR_AM1_GRP_ELLIPSOID_GM_P228_O003571_BF_F03_0024.hdf ', '--file_cmp=MISR_AM1_GRP_ELLIPSOID_GM_P228_O003571_DF_F03_0024.

Re: Programming exercises/challenges

2008-11-19 Thread Philip Semanchuk
You could even use wget to scrape the site instead of rolling your own bot if you're more interested in the data manipulation aspect of the project than the bot writing. Enjoy Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Python2.6 on Mac Os (Leopard)

2008-11-17 Thread Philip Semanchuk
On Nov 17, 2008, at 2:05 PM, Diez B. Roggisch wrote: Sorry if I misinformed; I have such symlinks in /usr/local/bin dated the same day as my custom Python install. I guess I could have created them myself, but I don't think I would have bothered creating a symlink for pythonw, for example si

Re: Installing Python2.6 on Mac Os (Leopard)

2008-11-17 Thread Philip Semanchuk
On Nov 17, 2008, at 1:17 PM, Diez B. Roggisch wrote: Philip Semanchuk wrote: On Nov 17, 2008, at 10:53 AM, Massi wrote: Hi everyone, I'm trying to install Python2.6 on my mac (Leopard 10.5.5), but I'm encountering some problems. To install the package I followed the inst

Re: Installing Python2.6 on Mac Os (Leopard)

2008-11-17 Thread Philip Semanchuk
al/bin to your Python 2.6 install. If, for instance, those symlinks live in /usr/local/bin, then put that directory first in your path and then typing `python` at the command line will launch Python 2.6. If the symlinks aren't there, you can create them by hand. HTH Philip -- http://ma

Re: web site feedback page using python for sending email

2008-11-14 Thread Philip Semanchuk
le to SMTP header injection. I'm not familiar with a script that will do what you want, but I haven't looked, either. Just make sure that whatever you end up using is fairly current. Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: running same script on same data on two different machines --> different result

2008-11-14 Thread Philip Semanchuk
Python. Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Where to locate existing standard encodings in python

2008-11-11 Thread Philip Semanchuk
On Nov 11, 2008, at 1:08 PM, News123 wrote: Hi Philip, Thanks for your answer: The fact, that a module 'encodings' exists was new to me. We both learned something new today. =) encodings.aliases.aliases has however one problem. It helps to locate all encoding aliases, but it

Re: Where to locate existing standard encodings in python

2008-11-11 Thread Philip Semanchuk
On Nov 11, 2008, at 9:10 AM, News123 wrote: Hi Philip, Your answer touches exaclty one point, which I was slightly afraid of: - The list is not exhaustive - python versions might have implemented different codecs. This is why I wondered whether there's any way of querying python

Re: Where to locate existing standard encodings in python

2008-11-09 Thread Philip Semanchuk
On Nov 9, 2008, at 7:00 PM, News123 wrote: Hi, I was googling quite some time before finding the answer to my question: 'what are the names for the encodings supported by python?' I found the answer at http://python.active-venture.com/lib/ node127.html Now my question: Can I find the

Re: Finding Default Page Name using urllib2

2008-10-27 Thread Philip Semanchuk
barrett, Look into the urllib2 module and specifically HTTPRedirectHandler objects. Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Philip Semanchuk
mory) and one which I wrote (for POSIX semaphores & shared memory). http://NikitaTheSpider.com/python/shm/ http://semanchuk.com/philip/posix_ipc/ If anyone wants to wrap POSH cleverness around them, go for it! If not, maybe I'll make the time someday. Cheers Philip -- http://mail.

Re: python extensions: including project local headers

2008-10-23 Thread Philip Semanchuk
On Oct 23, 2008, at 3:18 PM, J Kenneth King wrote: Philip Semanchuk <[EMAIL PROTECTED]> writes: On Oct 23, 2008, at 11:36 AM, J Kenneth King wrote: Hey everyone, I'm working on a python extension wrapper around Rob Hess' implementation of a SIFT feature detector.

Re: python extensions: including project local headers

2008-10-23 Thread Philip Semanchuk
it can't find the library that contains _sift_features. Make sure that it's somewhere where your OS can find it. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing a memory address (pointer) to an extension?

2008-10-23 Thread Philip Semanchuk
On Oct 23, 2008, at 2:13 AM, Thomas Heller wrote: Philip Semanchuk schrieb: I'm writing a Python extension in C that wraps a function which takes a void * as a parameter. (The function is shmat() which attaches a chunk of shared memory to the process at the address supplied by the calle

Re: Passing a memory address (pointer) to an extension?

2008-10-23 Thread Philip Semanchuk
On Oct 22, 2008, at 8:33 PM, Robert Kern wrote: Philip Semanchuk wrote: I'm writing a Python extension in C that wraps a function which takes a void * as a parameter. (The function is shmat() which attaches a chunk of shared memory to the process at the address supplied by the calle

Re: How to import from a file which is not in the current directory?

2008-10-22 Thread Philip Semanchuk
On Oct 22, 2008, at 5:38 PM, Kurda Yon wrote: Hi, I would like to import a function from a file which is located not in the same directory as the main program (from which the function needed to be imported). Could anybody pleas tell me how to do that? Python will search for module files in

Passing a memory address (pointer) to an extension?

2008-10-22 Thread Philip Semanchuk
is a shaky assumption. I could use a long long (technically still risky, but practically probably OK) but I'm not sure how widespread long longs are. Any advice appreciated. Thanks Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6, multiprocessing module and BSD

2008-10-22 Thread Philip Semanchuk
On Oct 22, 2008, at 11:37 AM, Jesse Noller wrote: On Wed, Oct 22, 2008 at 11:06 AM, Philip Semanchuk <[EMAIL PROTECTED] > wrote: One oversight I noticed the multiprocessing module docs is that a semaphore's acquire() method shouldn't have a timeout on OS X as sem_timedwait()

Re: Python 2.6, multiprocessing module and BSD

2008-10-22 Thread Philip Semanchuk
ants to my main .c module so that it can detect those errors exactly and wrap them into a specific, custom error for the Python caller. Any thoughts on this? Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.6, multiprocessing module and BSD

2008-10-21 Thread Philip Semanchuk
said semaphores are listed as "very experimental". I experienced a problem that looked like a bug to me, and a rather big one at that. There's more detail here (scroll down to the part about FreeBSD 6/7) including a link to the bug report I filed against the FreeBSD kernel: h

Re: Error

2008-10-21 Thread Philip Semanchuk
On Oct 21, 2008, at 9:05 AM, Amie wrote: Hi, what does is the meaning of this error: int object is unsubscriptable. This is the code that I have written that seems to give me that: def render_sideMenu(self, ctx, data): def render_dataAge(unit): results = [(i[0], i[1] ) for i

Re: urllib2.HTTPError: HTTP Error 204: NoContent

2008-10-19 Thread Philip Semanchuk
On Oct 19, 2008, at 6:13 AM, silk.odyssey wrote: I am getting the following error trying to download an html page using urllib2. urllib2.HTTPError: HTTP Error 204: NoContent The url is of this type: http://www.amazon.com/gp/offer-listing/B000KJX3A0%3FSubscriptionId%3D183VXJS74KNQ89D0NRR2%26t

Re: Script can't find input file despite being in the same directory

2008-10-17 Thread Philip Semanchuk
On Oct 17, 2008, at 1:07 PM, Robocop wrote: I have a simple little script that reads in postscript code, appends it, then writes it to a new postscript file. Everything worked fine a month ago, but after rearranging my directory tree a bit my script fails to find the base postscript file. The

Re: crossplatform standalone python apps

2008-10-17 Thread Philip Semanchuk
On Oct 17, 2008, at 2:59 AM, Gabriel Rossetti wrote: Hello everyone, I like to create a cross-platform standalone python application, like Mac OS *.app dirs. The idea is to distribute a zip file containing everything (the python interpreter and all) so that a user just unzips it and runs

Re: regular expression question (re module)

2008-10-16 Thread Philip Semanchuk
On Oct 16, 2008, at 11:25 PM, Steve Holden wrote: Pat wrote: Faheem Mitha wrote: Hi, I need to match a string of the form capital_letter underscore capital_letter number against a string of the form anything capital_letter underscore capital_letter number some_stuff_not_starting with a nu

Re: urllib accept-language doesn't have any effect

2008-10-16 Thread Philip Semanchuk
ent ---- Do you get different results with this same code in Germany? Cheers Philip On Oct 15, 2008, at 9:50 AM, Martin Bachwerk wrote: Hello, I'm trying to load a couple of pages using the urllib2 module. The problem is that I live in Germany

Re: urllib accept-language doesn't have any effect

2008-10-15 Thread Philip Semanchuk
t lets you set headers. - Sniff the conversation you're having with google using Wireshark. Maybe you're getting redirected by the remote server. Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Reg: Installation problems in psycopg2

2008-10-13 Thread Philip Semanchuk
e fact that it's not in the path when you run setup.py), then the installer makes some best guesses at where things are. If those guesses are wrong, compile and link steps can fail. HTH Philip After a little bit of googling, I found that this can be solved by -L while linki

Re: parsing javascript

2008-10-12 Thread Philip Semanchuk
is: "http://ZZZ_DOMAIN_ZZZ/index.html".replace(/ZZZ_DOMAIN_ZZZ/, the_domain_variable) This is a long-standing problem for any program that parses Web pages. You either have to embed a JS interpreter in your application or just ignore the JavaScript. Most Web parsing robots t

ANNOUNCE: new package posix_ipc 0.1 available

2008-10-09 Thread Philip Semanchuk
/philip/posix_ipc/ Enjoy Philip -- http://mail.python.org/mailman/listinfo/python-list

Threading problem when many sockets open

2007-08-11 Thread Philip Zigoris
ster thread). OK. I hope all of this is clear. Currently, I've solved the problem by putting a cap on the queue size and i haven't seen the problem reoccur. But it would be nice to understand exactly what went wrong. Thanks in advance. -- -- Philip Zigoris I SPOCK I 650.366.

Re: Is there a way to push data into Ical from Python ?

2006-12-18 Thread Philip Austin
"The Night Blogger" <[EMAIL PROTECTED]> writes: > Is there a way to pull & push data into (Apple Mac OS X Calendar) Ical from > Python ? > see: http://vobject.skyhouseconsulting.com/ -- regards, Phil -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread philip . armitage
Paul Rubin wrote: > André Thieme <[EMAIL PROTECTED]> writes: > which isn't purely a matter of token count. And if (+ 2 3) were > really as easy to read as 2+3, mathematics would have been written > that way all along. Maybe I am a "mutant" as Ken suggests but while mathematicians may think in te

Re: merits of Lisp vs Python

2006-12-11 Thread philip . armitage
Juan R. wrote: > [EMAIL PROTECTED] ha escrito: > > - Lisp is hard to learn (because of all those parenthesis) > > I cannot understand why. It is like if you claim that packaging things > in boxes is difficult to learn. > > HTML and XML have more brackets than LISP (usually double) for > structuring

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-16 Thread Philip Austin
[EMAIL PROTECTED] writes: >> This is the .NET 11 SDK, I belive it includes the 2003 compiler (*): > > Last time I checked the .NET SDK they had the C# compiler in there, but > not the C++ optimizing 2003 compiler. Might be wrong though I just downloaded and installed this, and see a directory

Pyrex newbie question

2006-06-04 Thread Philip Smith
Just starting to use pyrex on windows. Using pyrex version 0.9.3.1.win32 Using Activestate Python 2.4.3.12 Using Mingw compiler When I try to run the pyrex demo it fails with a message: "undefined reference to '_imp__Py_NoneStruct' " Anyone know why? -- http://mail.python.org/mailman/list

Re: Multiple Polynomial Quadratic Sieve

2006-05-30 Thread Philip Smith
Whoops Should have been http://www.python.pwp.blueyonder.co.uk/ Thanks Phil "Philip Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Just to announce that I have posted an experimental version of MPQS which > I am hoping those of a mathematical turn

Multiple Polynomial Quadratic Sieve

2006-05-30 Thread Philip Smith
Just to announce that I have posted an experimental version of MPQS which I am hoping those of a mathematical turn of mind would care to test, comment on and maybe contribute to. There is work to do but it performs very well. The package is available via FTP at http://www.pythonstuff.pwp.bluey

ctypes/libffi for Intel based Macintosh

2006-03-29 Thread philip . kania
Can someone tell me where I can download a version of ctypes/libffi that will work on a Intel based Macintosh? I'm running Mac OS X 10.4.5 and the ActiveState Python 2.4.2 distribution. I've tried building libffi 1.20 which came with ctypes 0.9.9.3 and got a message from the libffi configure scr

Re: Python advocacy in scientific computation

2006-03-09 Thread Philip Austin
Michael McNeil Forbes <[EMAIL PROTECTED]> writes: > > I find that version control (VC) has many advantages for > scientific research (I am a physicist). > Greg Wilson also makes that point in this note: http://www.nature.com/naturejobs/2005/050728/full/nj7050-600b.html Where he describes his exc

Re: httplib raises ValueError reading chunked content

2006-03-08 Thread Philip Semanchuk
On Mar 8, 2006, at 8:32 PM, Etienne Desautels wrote: > > Hi Philip, > >> Hi all, >> Has anyone ever seen Python 2.4.1's httplib choke when reading chunked >> content? > > Yes, it's a know bug. See for yourself: > https://sourceforge.net/tracker/?

Re: void * C array to a Numpy array using Swig

2006-01-12 Thread Philip Austin
"Travis E. Oliphant" <[EMAIL PROTECTED]> writes: > Krish wrote: > Yes, you are right that you need to use typemaps. It's been awhile > since I did this kind of thing, but here are some pointers. Also, there's http://geosci.uchicago.edu/csc/numptr -- http://mail.python.org/mailman/listinfo/p

Re: c/c++ extensions and help()

2005-07-31 Thread Philip Austin
Robert Kern <[EMAIL PROTECTED]> writes: > Lenny G. wrote: >> Is there a way to make a c/c++ extension have a useful method >> signature? Right now, help(myCFunc) shows up like: >> myCFunc(...) >> description of myCFunc >> I'd like to be able to see: >> myCFunc(myArg1, myArg2) >> description o

[linked lists] Newbie - chapter 19 in "How to think like a CS in python"

2005-07-14 Thread Philip
Hi, I'm reading "How to think like a computer scientist in python". So far, it's been smooth sailing, but the final exercise in chapter 19 really has me stumped. Is it just me, or did this book get very difficult, very quickly? It says: "As an exercise, write an implementation of the Priority Queu

Re: Exe file

2005-06-10 Thread Philip Seeger
For easier distribution. Otherwise the client computer had to have Python installed. Philip "Peter Hansen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Philip Seeger wrote: >> I'm sorry for that newbie question but how can I compile a

Exe file

2005-06-09 Thread Philip Seeger
Hi @ll I'm sorry for that newbie question but how can I compile a program (a .py file) to an executable file? -- Philip Seeger -- http://mail.python.org/mailman/listinfo/python-list

Beware complexity

2005-03-12 Thread Philip Smith
I wonder if anyone has any thoughts not on where Python should go but where it should stop? One of the faults with langauges like C++ was that so many new features/constructs were added that it became a nightmare right from the design stage of a piece of software deciding which of the almost in

Beware complexity

2005-03-12 Thread Philip Smith
-- http://mail.python.org/mailman/listinfo/python-list

Derived class and deepcopy

2005-02-16 Thread Philip Smith
Hi If I derive a class (eg Matrix) from list I presume this implies the classic OOP 'is a' relation between the derived and super class. I therefore presume I can use a derived class in any context that I can use the superclass. In the given example I want to apply deepcopy() to the Matrix ins

lambda and for that matter goto not forgetting sugar

2005-02-10 Thread Philip Smith
I've read with interest the continuing debate about 'lambda' and its place in Python. Just to say that personally I think its an elegant and useful construct for many types of programming task (particularly number theory/artificial intelligence/genetic algorithms) I can't think why anyone woul

Re: Multiple constructors

2005-02-06 Thread Philip Smith
Thanks to all of you Some useful ideas in there, even if some of them stretch my current knowledge of the language. C++ to Python is a steep 'unlearning' curve... Phil "Philip Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Call this a C++ pr

Multiple constructors

2005-02-05 Thread Philip Smith
Call this a C++ programmers hang-up if you like. I don't seem to be able to define multiple versions of __init__ in my matrix class (ie to initialise either from a list of values or from 2 dimensions (rows/columns)). Even if Python couldn't resolve the __init__ to use on the basis of argument

Re: Elliptic Code

2005-01-28 Thread Philip Smith
Quite so - but thanks for your help in any case "Paul Rubin" wrote in message news:[EMAIL PROTECTED] > Nick Craig-Wood <[EMAIL PROTECTED]> writes: >> > I understand the algorithm quite well but how to code the >> > multiplication >> > stage most efficiently in python

Re: Elliptic Code

2005-01-28 Thread Philip Smith
it yet. Phil <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Philip Smith" <[EMAIL PROTECTED]> writes: >> Does anyone have/know of a python implementation of the elliptic curve >> factoring algorithm (lenstra) which is both: >> >> simply

Elliptic Code

2005-01-28 Thread Philip Smith
Hi Does anyone have/know of a python implementation of the elliptic curve factoring algorithm (lenstra) which is both: simply and cleanly coded functional I'm aware of William Stein's code (from elementary number theory book) but I don't understand his coding style and the algorithm doesn't se

Re: Help with Threading

2005-01-25 Thread Philip Smith
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I use threading.Thread as outlined in this recipe: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65448 >Thanks -- http://mail.python.org/mailman/listinfo/python-list

Help with Threading

2005-01-23 Thread Philip Smith
Hi I am fairly new to Python threading and my needs are simple(!) I want to establish a number of threads each of which work on the same computationally intensive problem in different ways. I am using the thread module rather than the threading module. My problem is I can't see how (when one t

<    1   2   3   4   5