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

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: 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: 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

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

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

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: if-else statement

2009-01-10 Thread Philip Semanchuk
Gandalf, I'd add to the above that this expression was only added to Python in v2.5, so if you want your code to be compatible with versions of Python <= 2.4, you should not use the ternary if. bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 - 403 that _should_ not occur.

2009-01-11 Thread Philip Semanchuk
oesn't like your user agent? It'd be easier to help if you post a working sample. Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 - 403 that _should_ not occur.

2009-01-11 Thread Philip Semanchuk
On Jan 11, 2009, at 10:05 PM, James Mills wrote: On Mon, Jan 12, 2009 at 12:58 PM, Philip Semanchuk > wrote: On Jan 11, 2009, at 8:59 PM, James Mills wrote: Hey all, The following fails for me: from urllib2 import urlopen f = urlopen("http://groups.google.com/group/chromium-annou

Re: urllib2 - 403 that _should_ not occur.

2009-01-12 Thread Philip Semanchuk
On Jan 12, 2009, at 6:48 PM, ajaksu wrote: On Jan 11, 11:59 pm, "James Mills" wrote: Hey all, The following fails for me: from urllib2 import urlopen f = urlopen("http://groups.google.com/group/chromium-announce/feed/rss_v2_0_msgs.xml ") Traceback (most recent call last): [...] Any he

Re: urllib2 - 403 that _should_ not occur.

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 1:22 AM, Steve Holden wrote: Philip Semanchuk wrote: On Jan 12, 2009, at 6:48 PM, ajaksu wrote: On Jan 11, 11:59 pm, "James Mills" wrote: Hey all, The following fails for me: from urllib2 import urlopen f = urlopen("http://groups.google.com/group/ch

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
gives you semaphores, shared memory and messages queues: http://semanchuk.com/philip/posix_ipc/ sysv_ipc gives you semaphores and shared memory: http://semanchuk.com/philip/sysv_ipc/ shm also gives access to SysV semaphores and shared memory: http://nikitathespider.com/python/shm/ The only reason

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
myself writting a new IPC module that works under Windows as well. Feel free to reinvent the wheel. Or, you could pitch in and help with what's already out there. bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
s are just educational for me and paying work will take priority. bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 2:01 PM, Laszlo Nagy wrote: I realize that lack of Windows support is a big minus for both of these modules. As I said, any help getting either posix_ipc or sysv_ipc working under Windows would be much appreciated. It sounds like you have access to the platform and

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
eues. That will create an expectation of certain semantics, and you might find it difficult to fulfill that promise in certain cases (e.g. implementing the POSIX function mq_notify() ). If you call them Nagy message queues then no one will be disappointed or surprised as long as your code impl

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 4:31 PM, drobi...@gmail.com wrote: On Jan 13, 2:37 pm, Philip Semanchuk wrote: I was suggesting getting posix_ipc or sysv_ipc to compile against a compatibility library (Cygwin?) under Windows. It sounds like you're proposing something totally different, no? It&

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 6:41 PM, Mel wrote: Philip Semanchuk wrote: I'm working on message queue support, but the Sys V IPC API is a headache and takes longer to code against than the POSIX API. I hadn't found it that bad. I have a C extension I should perhaps clean up and m

Re: urllib2 - 403 that _should_ not occur.

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 9:42 PM, ajaksu wrote: On Jan 13, 1:33 am, Philip Semanchuk wrote: I don't think I understand you clearly. Whether or not Google et al whitelist the Python UA isn't a Python issue, is it? Hi, sorry for taking so long to reply :) I imagine it's so

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 11:26 PM, drobi...@gmail.com wrote: On Jan 13, 5:08 pm, Philip Semanchuk wrote: On Jan 13, 2009, at 4:31 PM, drobi...@gmail.com wrote: On Jan 13, 2:37 pm, Philip Semanchuk wrote: I was suggesting getting posix_ipc or sysv_ipc to compile against a compatibility library

Re: Python Crashes

2009-01-14 Thread Philip Semanchuk
On Jan 14, 2009, at 3:57 PM, koranthala wrote: Hi, I have a twisted based application based on Python 2.4.3. I also have one thread in this application. I found that my program crashes repeatedly after a random interval (ranging from 10 min to 3 hr). When I say crash, it is not just that

Re: Problem using python C API

2009-01-16 Thread Philip Semanchuk
init function (initexamplemodule)". Since your module is called "examplemodule", Python is looking for a function called "initexamplemodule". Change your build step to build a module called "example" and not "examplemodule" and I think you'll be OK. bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: psycopg2 weirdness

2009-01-17 Thread Philip Semanchuk
fy even further. What happens if you simplify the query? FOr instance: SELECT 1, 2 as crs_dep_hour, origin from flightdata where date = '01-05-2007' If a simple query like that doesn't work, I suspect you have something fundamental wrong with your setup. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: python resource management

2009-01-19 Thread Philip Semanchuk
nues to be a problem. Then add elements back in, making your minimalist script more and more like the real one. If the extreme memory usage problem is isolated to one component or section, you'll find it this way. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Doubts related to subprocess.Popen()

2009-01-20 Thread Philip Semanchuk
On Jan 20, 2009, at 9:19 AM, srinivasan srinivas wrote: Do parent process will have different file descriptor in it for each subprocesses or paprent uses a single file descriptor for all? I really want to know creation of each subprocess will occupy an entry in parents'file descriptor table.

Re: quick beginners List comprehension question

2009-01-21 Thread Philip Semanchuk
been good; to them I'll add the comment that list comprehensions are for *constructing* lists, not manipulating the elements thereof. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: quick beginners List comprehension question

2009-01-21 Thread Philip Semanchuk
On Jan 21, 2009, at 11:52 AM, Lou Pecora wrote: In article , Philip Semanchuk wrote: Other answers have been good; to them I'll add the comment that list comprehensions are for *constructing* lists, not manipulating the elements thereof. HTH Philip Well this seems to work just

Re: The First Law Of comp.lang.python Dynamics

2009-01-22 Thread Philip Semanchuk
On Jan 23, 2009, at 12:39 AM, Kay Schluehr wrote: Whatever sufficiently sophisticated topic was the initially discussed it ends all up in a request for removing reference counting and the GIL. Is this a variant of Godwin's Law for Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: *.python.org broken?

2009-01-24 Thread Philip Semanchuk
On Jan 24, 2009, at 8:06 PM, tgvaug...@gmail.com wrote: Hi all, Is anybody else having trouble accessing sites (including www, docs, wiki) in the python.org tree, or is it just me? (Or just .au?) No problem here in Durham, NC, USA. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is it faster the second time ?

2009-01-25 Thread Philip Semanchuk
On Jan 23, 2009, at 12:46 PM, jalanb3 wrote: Hello the group, I am wondering why doctests run slower the first time. In the transcript below "try" is a script which finds and runs doctests in the current directory. It also shows how long it takes to run these tests. I added a new test which s

Re: Process crash with no reason

2009-01-26 Thread Philip Semanchuk
On Jan 26, 2009, at 1:13 PM, gil.shi...@gmail.com wrote: Hi All, I'm running a program that is acting as a nice interface to sybase' replication server. The program is using the cherrypy web service for the GUI. The process is crashing every few days with no reason. In the log I can see INFO a

Re: Process crash with no reason

2009-01-27 Thread Philip Semanchuk
On Jan 27, 2009, at 7:00 AM, gil.shi...@gmail.com wrote: On Jan 26, 8:40 pm, Philip Semanchuk wrote: On Jan 26, 2009, at 1:13 PM, gil.shi...@gmail.com wrote: Hi All, I'm running a program that is acting as a nice interface to sybase' replication server. The program is using th

Re: Process crash with no reason

2009-01-27 Thread Philip Semanchuk
On Jan 27, 2009, at 10:34 AM, gil.shi...@gmail.com wrote: On Jan 27, 2:10 pm, Tim Golden wrote: gil.shi...@gmail.com wrote: On Jan 26, 8:40 pm, Philip Semanchuk wrote: On Jan 26, 2009, at 1:13 PM, gil.shi...@gmail.com wrote: Hi All, I'm running a program that is acting as a

Re: New to python, open source Mac OS X IDE?

2009-01-27 Thread Philip Semanchuk
On Jan 27, 2009, at 6:06 PM, joseph.a.mar...@gmail.com wrote: Greetings! I've heard enough raving about Python, I'm going to see for myself what all the praise is for! I'm on a Mac. I use Netbeans for Java, PHP, and C if needed. Do you even use an IDE for Python? Some people do; I don't.

Re: New to python, open source Mac OS X IDE?

2009-01-27 Thread Philip Semanchuk
On Jan 27, 2009, at 7:44 PM, James Stroud wrote: joseph.a.mar...@gmail.com wrote: Greetings! I've heard enough raving about Python, I'm going to see for myself what all the praise is for! I'm on a Mac. I use Netbeans for Java, PHP, and C if needed. Do you even use an IDE for Python? Any reco

Re: Process crash with no reason

2009-01-28 Thread Philip Semanchuk
On Jan 28, 2009, at 12:12 PM, gil.shi...@gmail.com wrote: On Jan 27, 5:59 pm, Philip Semanchuk wrote: On Jan 27, 2009, at 10:34 AM, gil.shi...@gmail.com wrote: On Jan 27, 2:10 pm, Tim Golden wrote: Then how are you interacting with Sybase? I'm using python's functions to run

Re: Profiling Python Apps on Mac?

2009-01-28 Thread Philip Semanchuk
On Jan 28, 2009, at 2:14 PM, RGK wrote: I'm writing a python app on a Mac (in Eclipse + PyDev w/ Python2.5 & wxPython under OSX 10.4) As I make program architecture decisions, it would be nice to be able to profile the choices. Should I add that extra thread? Is this big-assed xml obje

Calling into Python from a C thread

2009-02-02 Thread Philip Semanchuk
ng when my thread code is pure C, now I'm trying to add a call to a user-specified Python function. Thanks Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call python from a foreign language thread (C++)

2009-02-03 Thread Philip Semanchuk
ne tuning. I found this discussion useful: http://mail.python.org/pipermail/python-list/2006-November/413088.html It includes the quote, "The current thread state API doc, as you read it from top to bottom now, is in fact totally confusing for anyone who didn't develop Python himself" I like! =) Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: How to call python from a foreign language thread (C++)

2009-02-05 Thread Philip Semanchuk
continued to run even after my callback thread was invoked which I assume means that I released the GIL properly. As I mentioned before, this is part of my posix_ipc extension. This code (assuming I feel confident enough to release it) will be in the next version that should be out soon, so you will have a full working example with which to experiment. HTH, Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling into Python from a C thread

2009-02-09 Thread Philip Semanchuk
On Feb 9, 2009, at 12:02 PM, Aahz wrote: [posted & e-mailed] In article , Philip Semanchuk wrote: I'm trying call Python from inside of a C thread that's running in a Python extension I've written and I am not having much luck. My C thread function consists of simpl

Re: Calling into Python from a C thread

2009-02-09 Thread Philip Semanchuk
On Feb 9, 2009, at 2:35 PM, Christian Heimes wrote: Philip Semanchuk wrote: I didn't know there *was* such a thing. Thanks for the tip! For those who might be interested, the list is here: http://mail.python.org/mailman/listinfo/capi-sig FYI, I got my code working and it is in the l

Re: Python Launcher.app on OS X

2009-02-10 Thread Philip Semanchuk
On Feb 9, 2009, at 10:26 PM, kpp9c wrote: okay... for the life of me i do not see any Python Launcher.app and i just installed OS X 10.5 (running 10.5.6 on intel) and i also installed the dev kit. Where the heck is this application? Hi kp, I don't seem to have any such beast on my syste

Re: STMP, mail, sender-from, to-bcc-addr

2009-02-10 Thread Philip Semanchuk
that there is no BCC tag. It's your job as the programmer building the application that sends the message to send the mail to everyone on the BCC list. Something like this: for recipient in bcc: send_mail(to=recipient) Hope this helps Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling into Python from a C thread

2009-02-10 Thread Philip Semanchuk
On Feb 9, 2009, at 3:59 PM, Christian Heimes wrote: Philip Semanchuk wrote: Yes, that's accurate except for the word "forgot". To forget something one must first know it. =) I found the threading API documentation difficult to follow, but I suppose that what I'm doing is

Re: Python Launcher.app on OS X

2009-02-10 Thread Philip Semanchuk
On Feb 10, 2009, at 11:49 AM, Benjamin Kaplan wrote: On Tue, Feb 10, 2009 at 10:06 AM, Philip Semanchuk >wrote: On Feb 9, 2009, at 10:26 PM, kpp9c wrote: okay... for the life of me i do not see any Python Launcher.app and i just installed OS X 10.5 (running 10.5.6 on intel) an

Re: A little bit else I would like to discuss

2009-02-12 Thread Philip Semanchuk
On Feb 12, 2009, at 3:04 PM, azrael wrote: Why will Microsoft's products kick the ass of open source. Because anyone does what he wants. Let's say There are 5 GUI libraries competing against each other. Think about it what could these 5 teams acomplish if they would work together. Or maybe a fr

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Philip Semanchuk
On Feb 15, 2009, at 12:46 PM, pyt...@bdurham.com wrote: What's the Pythonic way to determine if a string is a number? By number I mean a valid integer or float. try: int(number) is_an_int = True except: is_an_int = False try: float(number) is_a_float = True except: is_a_fl

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Philip Semanchuk
On Feb 15, 2009, at 1:27 PM, Christian Heimes wrote: Philip Semanchuk schrieb: On Feb 15, 2009, at 12:46 PM, pyt...@bdurham.com wrote: What's the Pythonic way to determine if a string is a number? By number I mean a valid integer or float. try: int(number) is_an_int = True e

Re: Is there something easier than ORM?

2009-02-17 Thread Philip Semanchuk
e promoting ORM as the solution to all database access problems, and I certainly don't feel like it is. Good luck, Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads vs. processes, what to consider in choosing ?

2009-02-17 Thread Philip Semanchuk
ves to threads and multiprocessing, I'll point you to some low level libraries I wrote for doing interprocess communication: http://semanchuk.com/philip/posix_ipc/ http://semanchuk.com/philip/sysv_ipc/ Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Problems with OS X 10.5.6 and Python 2.5 and GDAL 1.6

2009-02-17 Thread Philip Semanchuk
On Feb 16, 2009, at 8:35 PM, Helly John J. wrote: Hi. I'm a newbie to python and am running: OS X 10.5.6 Python 2.5.4 Hi John, Are you using the system Python or have you installed another version? Cheers Philip and have run easy_install for gdal like this: /Library/Pytho

Re: Problems with OS X 10.5.6 and Python 2.5 and GDAL 1.6

2009-02-19 Thread Philip Semanchuk
On Feb 19, 2009, at 12:30 PM, Helly John J. wrote: Hi Philip. I installed the 2.5.4 binary from the python.org site. I did this because NumPy and SciPy currently only work with 2.5 and the system version was 2.4. It looks like you're using the same Python at the command line a

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: 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: 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: Best way to run multiple Python processes without overloading CPU or disk i/o

2008-12-02 Thread Philip Semanchuk
imitations. HTH Philip and disk i/o so that the maximum number of independent processes can be running at all times without overloading their environment? By process I mean independent application sessions vs. multiple threads of a single application. I'm looking for suggestions on what

Re: Running a Python script from crontab

2008-12-03 Thread Philip Semanchuk
On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wrote: I've included a switch to include or exclude the logging to console. When logging only to file, the script runs fine. Of course, I still don't understand why dual logging, and specifically to the console, causes a problem and if anyone has a

Re: Running a Python script from crontab

2008-12-03 Thread Philip Semanchuk
On Dec 3, 2008, at 1:33 PM, Astley Le Jasper wrote: On 3 Dec, 16:41, Philip Semanchuk <[EMAIL PROTECTED]> wrote: On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wrote: I've included a switch to include or exclude theloggingto console. Whenloggingonly to file, the script runs

Re: Running a Python script from crontab

2008-12-03 Thread Philip Semanchuk
On Dec 3, 2008, at 3:06 PM, Astley Le Jasper wrote: On 3 Dec, 19:49, Philip Semanchuk <[EMAIL PROTECTED]> wrote: On Dec 3, 2008, at 1:33 PM, Astley Le Jasper wrote: On 3 Dec, 16:41, Philip Semanchuk <[EMAIL PROTECTED]> wrote: On Dec 3, 2008, at 10:29 AM, Astley Le Jasper wr

Re: Running a Python script from crontab

2008-12-04 Thread Philip Semanchuk
On Dec 4, 2008, at 4:21 AM, Astley Le Jasper wrote: On Dec 4, 12:34 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: In message <[EMAIL PROTECTED]>, Philip Semanchuk wrote: In my experience, the environment in which a cron job runs is d

Re: Source code generation using Python

2008-12-06 Thread Philip Semanchuk
a better templating engine, I'll just say that I'm happy with how Mako addresses *my* needs. =) Good luck finding something that addresses yours. Cheers Philip The situation is really quite similar to HTML/PHP except, here we would have C++/Python. Any suggestions? Thanks, //Arne S. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-07 Thread Philip Slate
On Dec 7, 1:13 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > and friendlier to newbies. > > I'd rather say "more acceptable to java-brainwashed developpers". And I'd rather say you're trolling, but that's ok since you're preaching to the converted. You conveniently forgot to mention the

Re: Best way to run multiple Python processes without overloading CPU or disk i/o

2008-12-08 Thread Philip Semanchuk
On Dec 8, 2008, at 2:48 AM, Gabriel Genellina wrote: En Wed, 03 Dec 2008 02:29:32 -0200, Philip Semanchuk <[EMAIL PROTECTED]> escribió: On Dec 2, 2008, at 11:21 PM, [EMAIL PROTECTED] wrote: Is there a cross-platform way to launch multiple Python processes and monitor CPU

Re: When (and why) to use del?

2008-12-09 Thread Philip Semanchuk
all to the explicit del. On rare occasions (I can think of once or twice in all the Python I've written) I'll del a variable that might use lots of memory if it wouldn't otherwise get dereferenced quickly (say, by going out of scope). But in my experience that's quite rare. Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: When (and why) to use del?

2008-12-10 Thread Philip Semanchuk
On Dec 10, 2008, at 5:23 PM, Gabriel Genellina wrote: En Tue, 09 Dec 2008 15:29:17 -0200, Philip Semanchuk <[EMAIL PROTECTED] > escribió: On Dec 9, 2008, at 11:35 AM, Albert Hopkins wrote: def myfunction(): # do some stuff stuff my_

Re: Parallelizing python code - design/implementation questions

2008-12-13 Thread Philip Semanchuk
might find my IPC extensions useful. They're much less sophisticated than multiprocessing; they just give access to IPC semaphores and shared memory (no message queues yet) on Unix. POSIX IPC: http://semanchuk.com/philip/posix_ipc/ System V IPC: http://semanchuk.com/philip/sysv_ipc

Re: changing string encoding to different charset?

2008-12-14 Thread Philip Semanchuk
On Dec 14, 2008, at 9:21 AM, Daniel Woodhouse wrote: Is it possible to re-encode a string to a different character set in python? To be more specific, I want to change a text file encoded in windows-1251 to UTF-8. I've tried using string.encode, but get the error: UnicodeDecodeError: 'ascii' c

Re: Thread Locking issue - Can't allocate lock (sem_init fail)

2008-12-15 Thread Philip Semanchuk
ated on the process' heap. This would seem only RAM-limited, but I'll bet it isn't. You might want to start debugging by track exactly how many locks you're creating. If the number is really big, start investigating kernel semaphore limits and how they're set. Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Are Django/Turbogears too specific?

2008-12-21 Thread Philip Semanchuk
on the other hand, is a little more complicated because it's made of several different parts, but the positive side of "complicated" is "flexible". Do you think I should just use eg. CherryPy and some basic AJAX? Yes or no, depending on what you're trying to do! =) Go

Re: Are Django/Turbogears too specific?

2008-12-21 Thread Philip Semanchuk
On Dec 21, 2008, at 3:14 PM, Bruno Desthuilliers wrote: Philip Semanchuk a écrit : (snip) From the reading I did, I gathered that Django was really good if you want to do what Django is good at, but not as easy to customize as, say, Pylons. That was my first impression too, and was more

Re: Are Django/Turbogears too specific?

2008-12-22 Thread Philip Semanchuk
On Dec 22, 2008, at 1:52 AM, Tino Wildenhain wrote: Philip Semanchuk wrote: ... I prefer Mako over the other template languages I've seen. From what I can tell Mako is nearly identical to all other template languages you might have seen (e.g. PHP style tags). Thats why I personally

Re: SQL, lite lite lite

2008-12-29 Thread Philip Semanchuk
be disappointed if you were expecting the former. IMHO it does quite well at the latter. After a look at the syntax you're proposing, I wonder how you feel it differs from ORMs like SQLAlchemy (for instance). Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: multiprocessing vs thread performance

2008-12-31 Thread Philip Semanchuk
forge.net) Or sysv_ipc? Or posix_ipc? http://semanchuk.com/philip/sysv_ipc/ http://semanchuk.com/philip/posix_ipc/ Bug fix version of the latter coming out in a day or two... -- http://mail.python.org/mailman/listinfo/python-list

Re: How to declare python ints in C extensions?

2009-01-04 Thread Philip Semanchuk
x27;ve had to learn a lot about writing extensions from looking at the Python source code. Lots of valuable tricks to be learned there. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: pep-8 vs. external interfaces?

2009-01-06 Thread Philip Semanchuk
either way, somebody's going to complain that I did it wrong :-) I promise to be the first to complain no matter what you choose. ;) Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: having problems with a multi-conditional while statement

2009-01-06 Thread Philip Semanchuk
On Jan 6, 2009, at 7:18 PM, bowman.jos...@gmail.com wrote: Hi, I'm trying to write a multi-conditional while statement, and am having problems. I've broken it down to this simple demo. #!/usr/bin/python2.5 condition1 = False condition2 = False while not condition1 and not condition2: pri

Re: mac osx how to use a specific python environment

2009-01-07 Thread Philip Semanchuk
env in my python script. Hi Marco, I'm not exactly sure what you want to do. But if you execute `python` at the command line, OS X will launch whatever version of Python it finds first in your PATH. Hope this helps Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it ok to type check a boolean argument?

2009-01-07 Thread Philip Semanchuk
the interface would be less tempted to pass something like the last part of an ORDER BY statement, like "last_name, first_name, age DESC". I can understand your temptation to enforce bool-ness, but you have a very good point about this one function then being different from all of the others that aren't as picky. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Imaging Library and textmate

2009-01-09 Thread Philip Semanchuk
work either. I use TextMate but I don't know what you mean when you say you can't get TM to import a module. Can you give a little more context? There was a similar thread in this list with textmate but I can't understand how that issue was solved in the end. link?

Re: Python Imaging Library and textmate

2009-01-09 Thread Philip Semanchuk
On Jan 9, 2009, at 12:19 PM, bilgin arslan wrote: Hi Philip, I tried to install PIL with the directions given and it seemed to be ok. When I tried it with IDLE, import Image did not give an error and as far as I checked it seemed to be working. However, importing Image module in TextMate

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

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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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-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()

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: 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

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: 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: 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

<    1   2   3   4   5   >