Re: taking python enterprise level?...

2010-03-03 Thread Philip Semanchuk
On Mar 3, 2010, at 3:58 PM, mk wrote: Philip Semanchuk wrote: So there *may* be some evidence that joins are indeed bad in practice. If someone has smth specific/interesting on the subject, please post. It's an unprovable assertion, or a meaningless one depending on how one define

Re: Working group for Python CPAN-equivalence?

2010-03-03 Thread Philip Semanchuk
Do Fedora & Ubuntu's package managers offer modules that appear in CPAN? In other words, if I was a Perl user under Ubuntu would I use the pkg manager to add a Perl module, or CPAN, or would both work? Thanks Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: NoSQL Movement?

2010-03-03 Thread Philip Semanchuk
On Mar 3, 2010, at 5:41 PM, Avid Fan wrote: Jonathan Gardner wrote: I see it as a sign of maturity with sufficiently scaled software that they no longer use an SQL database to manage their data. At some point in the project's lifetime, the data is understood well enough that the general

Re: Elementtree install problem in Ubuntu (a newbie ..)

2010-03-10 Thread Philip Semanchuk
ython >= 2.5, ElementTree is part the standard library so it doesn't need to be installed separately. Here's the documentation for it: http://www.python.org/doc/2.6.4/library/xml.etree.elementtree.html HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: show image in python

2010-03-11 Thread Philip Semanchuk
ail? Is that where you get the GLib warning? 2) I'm glad you posted your code, but because it has line numbers, it's awkward to copy & paste into a local example. Please show your code without line numbers. I'm unfamiliar with PIL, so this is just a wild guess, bu

Re: question regarding wxSlider

2010-03-12 Thread Philip Semanchuk
uch better chance of getting an answer. http://www.wxpython.org/maillist.php Developing a robotic hand sounds like fun! Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: subtraction is giving me a syntax error

2010-03-15 Thread Philip Semanchuk
On Mar 15, 2010, at 1:37 PM, Joel Pendery wrote: So I am trying to write a bit of code and a simple numerical subtraction y_diff = y_diff-H is giving me the error Syntaxerror: Non-ASCII character '\x96' in file on line 70, but no encoding declared. Even though I have deleted some lines befo

Re: Clustering and automated configuration & deployment toolkit with Python

2010-03-15 Thread Philip Semanchuk
on remote machines. It sounds like code which you could build on or borrow from. HTH Philip The cluster could be used in at least two ways: - submit code/files via a web interface, monitor the task via the web interface and download the results from the master node (user<>web interface<

Re: multiprocessing on freebsd

2010-03-17 Thread Philip Semanchuk
ust link to the realtime libs (pass -lrt to the linker). This tripped me up for a while. Linking to the realtime libs is required for all POSIX IPC calls under Linux; FreeBSD does not require it for semaphores or shared mem, only message queues. Hope this helps Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the matter with docs.python.org?

2010-03-24 Thread Philip Semanchuk
On Mar 24, 2010, at 12:05 PM, kj wrote: In the last couple of weeks, docs.python.org has been down repeatedly (like right now). Has anyone else noticed this? http://downforeveryoneorjustme.com/docs.python.org Works for me... HTH Philip -- http://mail.python.org/mailman/listinfo/python

Re: sqlite version on windows

2010-03-26 Thread Philip Semanchuk
or maybe just a lack of time to test when building new WIndows distros for Python.org. bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes as namespaces?

2010-03-26 Thread Philip Semanchuk
stants are arbitrary and may change. # However bool(NONE) is guaranteed to be False NONE = 0 GAUSSIAN = 1 LORENTZIAN = 2 Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes as namespaces?

2010-03-26 Thread Philip Semanchuk
modules called foo_constants.py, bar_constants.py, etc. My Currency(type=CurrencyType.USD, value=decimal.Decimal(".02")), Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes as namespaces?

2010-03-27 Thread Philip Semanchuk
On Mar 27, 2010, at 8:04 AM, J. Clifford Dyer wrote: On Fri, Mar 26, 2010 at 02:49:02PM +, kj wrote regarding Classes as namespaces?: What's the word on using "classes as namespaces"? E.g. class _cfg(object): spam = 1 jambon = 3 huevos = 2 breakfast = (_cfg.spam, _cfg.jambon,

Re: Python Psycopg2 - Interface Error : Connection already closed

2010-03-28 Thread Philip Semanchuk
mailing list are probably a much better crowd to ask: http://lists.initd.org/mailman/listinfo/psycopg Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: CPAN for python?

2010-03-30 Thread Philip Semanchuk
On Mar 30, 2010, at 12:23 PM, Someone Something wrote: Hi, I've learned python a few months ago but I still use Perl because of CPAN and the tremendous amount of stuff that's already been done for you. is there something like CPAN for python? Yes and no, depending on what CPAN means to yo

Re: psycopg2 / psycopg2.DataError: invalid input syntax for type timestamp with time zone:

2010-03-30 Thread Philip Semanchuk
on. Try the query directly in Postgres -- does it work there? If so, then your next step should be to ask on the psycopg2 mailing list that Google can find for you. Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Unladen Swallow dead?

2010-11-17 Thread Philip Semanchuk
e: > "http://www.mtholyoke.edu/~ebarnes/python/dead-parrot.htm"; A link to the source material: http://www.youtube.com/user/montypython?blend=1&ob=4#p/c/6FD5A97331C1B802/0/npjOSLCR2hE -- Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing pysqlite on Win64

2010-11-20 Thread Philip Semanchuk
ons of Python come with a built-in sqlite interface. That might be an easier approach for you. Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Backup postgresql database from python

2010-12-04 Thread Philip Semanchuk
x27;s probably not what you were looking for though. As D'Arcy said, the first thing to establish is why you want to avoid pg_dump. Another important question is whether or not you expect the database to be in use while you're doing backups. bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: is py2exe still active ?

2010-12-08 Thread Philip Semanchuk
ages but many of those packages are hosted elsewhere. The places where those packages are hosted may or may not have an issue tracker, etc. For instance, one the packages that I offer through PyPI (posix_ipc) is hosted on my personal Web site. Hope this helps Philip > - Orig

Re: Searching Python-list

2011-01-05 Thread Philip Semanchuk
: http://www.google.com/search?q=site:mail.python.org%2Fpipermail%2Fpython-list%2F+banana HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: What INI config file module allows lists of duplicate same-named options?

2011-01-10 Thread Philip Semanchuk
e expect semicolon, some make no allowances for non-ASCII encodings, some expect UTF-8 or ISO-8859-1 or Win-1252, some only allow '=' as the key/value separator, some allow other characters. INI files are nice and simple but there's devils in those details. Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Career path - where next?

2011-01-12 Thread Philip Semanchuk
else's) will help to convince some employers that you're worth taking a look at. If nothing else it gives you a public example of the work that you can point them to. Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: examples of realistic multiprocessing usage?

2011-01-16 Thread Philip Semanchuk
gluino.com/ I grepped through the code to see that it's using multiprocessing.Listener. I didn't go any further than that because our project is BSD licensed and the license for Gluino is unclear. Until I find out whether or not its under an equally permissive license, I can't borrow ideas and/or

Re: getdefaultencoding - how to change this?

2011-01-20 Thread Philip Semanchuk
'm glad that worked for you. Alternatively, it seems like you can set the default encoding in site.py which sounds easier than recompiling Python. Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: getdefaultencoding - how to change this?

2011-01-20 Thread Philip Semanchuk
On Jan 20, 2011, at 11:47 AM, Robert Kern wrote: > On 1/20/11 9:47 AM, Philip Semanchuk wrote: > >> I'm glad that worked for you. Alternatively, it seems like you can set the >> default encoding in site.py which sounds easier than recompiling Python. > > Never

Re: examples of realistic multiprocessing usage?

2011-01-21 Thread Philip Semanchuk
aid. I carefully avoid GPLed code on our BSD-licensed project not because I need fear anyone's legal department, but out of respect for the author(s) of the GPL-ed code. The way I see it, the author of GPL-ed code gives away something valuable and asks for just one thing in return: respe

Re: help with multiprocessing pool

2011-01-27 Thread Philip Semanchuk
in it so I guess that's the platform you're on. But in case you're on Windows, note that that platform requires some extra care when using multiprocessing: http://docs.python.org/library/multiprocessing.html#windows Good luck Philip > I wrote a function that can take a

Re: help with multiprocessing pool

2011-01-27 Thread Philip Semanchuk
uch as > themultiprocessing.Pool examples will not work in the interactive interpreter. I suspect this is the problem with the demo above. Your original code ran fine in the interpreter, though, correct? bye Philip > > On Jan 27, 2011, at 6:39 AM, Philip Semanchuk wrote: > >>

interrupted system call w/ Queue.get

2011-02-17 Thread Philip Winston
We have a multiprocess Python program that uses Queue to communicate between processes. Recently we've seen some errors while blocked waiting on Queue.get: IOError: [Errno 4] Interrupted system call What causes the exception? Is it necessary to catch this exception and manually retry the Queue

Re: LDFLAGS problem

2011-02-21 Thread Philip Semanchuk
command 'gcc' failed with exit status 1 > > where should I be looking to fix this problem? It's been a while since I built anything on FreeBSD, but one thing that jumps out at me is that you say you're building on 8.0 but the build output you gave us mentions 7.0. That doesn't sound right at all. Are you using ports? bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils examples?

2010-04-16 Thread Philip Semanchuk
On Apr 16, 2010, at 3:12 PM, TomF wrote: I'm packaging up a program with distutils and I've run into problems trying to get setup.py right. It's not a standalone package; it's a script plus modules, data files and documentation. I've been over the distutils documentation but I'm having t

Re: print executed query

2010-04-29 Thread Philip Semanchuk
great, if I could see how query is constructed and can the also copy it and execute in console. Im using psycopg2, btw If you can fiddle with the Postgres server settings, the server has options for logging lots of things, including the queries it executes. Hope this helps Philip --

Re: Ann: Validating Emails and HTTP URLs in Python

2010-05-03 Thread Philip Semanchuk
code. I can't say I checked each and every result, but I never saw anything that would lead me to believe it was misbehaving. It might be interesting to compare the results of running a large list of URLs through your code and theirs. Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Ann: Validating Emails and HTTP URLs in Python

2010-05-03 Thread Philip Semanchuk
er saw anything that would lead me to believe it was misbehaving. It might be interesting to compare the results of running a large list of URLs through your code and theirs. Good luck Philip It's getting a set of URLs that's the main problem. I've tested it with URL examples in

Re: Exclusively lock a file to prevent other processes from reading it?

2010-05-04 Thread Philip Semanchuk
On May 4, 2010, at 5:37 PM, pyt...@bdurham.com wrote: Is there a way to exclusively lock a file to prevent other processes from reading it while we have it open? I need to cache some overflow data to disk in a temp file and I want to make sure no other processes can read the contents of this f

Re: reading xml from python

2010-05-11 Thread Philip Semanchuk
ative simple (not too much creating new classes) way to do this. Any suggestions appreciated. Hej Martin, Did you look in the standard library? ElementTree in the XML section of the standard library will do what you want. There are several other choices there if you don't like that.

Re: Getting System error with PyModule_AddIntConstant funtion

2010-05-18 Thread Philip Semanchuk
result without error in PyObject_Call " Hi Mathan, You're not checking the return code from PyModule_Create(). Is it returning NULL? Also, there's a list specific to Python's C API. You might get a better response to your question there: http://mail.python.org/mai

Re: Best XML python package to learn for Ubuntu Linux ?

2010-05-19 Thread Philip Semanchuk
. It was a popular 3rd party package even before it became part of the standard library, so a lot of code uses it. It's a good place to start. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: logging: AttributeError: 'module' object has no attribute 'getLogger'

2010-05-23 Thread Philip Semanchuk
, it first looks in the current directory and imports logging.py, which in this case is the file it's already executing. It never finds the standard library's logging module. One way you could have figured this out would be to add this as the first line of main(): print dir(

Re: UnicodeDecodeError having fetch web page

2010-05-25 Thread Philip Semanchuk
On May 25, 2010, at 3:13 PM, Barry wrote: Hi, The code below is giving me the error: Traceback (most recent call last): File "C:\Users\Administratör\Desktop\test.py", line 4, in UnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position 1: unexpected code byte What am i doing wr

Re: UnicodeDecodeError having fetch web page

2010-05-25 Thread Philip Semanchuk
On May 25, 2010, at 4:00 PM, Barry wrote: On 25 Maj, 21:39, Philip Semanchuk wrote: On May 25, 2010, at 3:13 PM, Barry wrote: Hi, The code below is giving me the error: Traceback (most recent call last): File "C:\Users\Administratör\Desktop\test.py", line 4, in UnicodeD

Re: [WxPython] Advice on Temperature Application Method & Structure

2010-05-26 Thread Philip Semanchuk
valid) and when OK is clicked. It's nice to be able to simply call the validators in that case. Good luck with your app Philip Temperature Converter Application: """ Temperature Application Description: This application uses WxPython to create a simple windows app to

Re: Python vs. Fedora and CentOS

2010-05-29 Thread Philip Semanchuk
F7 released in May 2007. http://distrowatch.com/table.php?distribution=fedora I think the OP is referring to RHEL (Enterprise Linux). Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI programs

2010-05-30 Thread Philip Semanchuk
. Would also like to hear pros/cons with the different modules/apps. There's lots of discussion on this topic in the archives of this mailing list and others. These modules haven't changed dramatically over the past few years, so any recent-ish conversation is relevant. Good luck Philip

Re: Python vs. Fedora and CentOS

2010-05-31 Thread Philip Semanchuk
distrowatch.org backs this up -- the latest Python available for Centos 5.x is 2.4: http://distrowatch.com/table.php?distribution=centos Did you perhaps install Python 2.5 on your own by compiling the source tarball? bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: getting MemoryError with dicts; suspect memory fragmentation

2010-06-04 Thread Philip Semanchuk
x27;t looked at 'em myself. http://us.pycon.org/2010/conference/schedule/event/12/ Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: General questions - where & how

2010-06-04 Thread Philip Semanchuk
On Jun 4, 2010, at 1:22 PM, Uriah Eisenstein wrote: Hi all, I'm relatively new to Python and have a few questions. Frankly, it took me a while to find on python.org what seems like a suitable place to post my questions. However, I'd like to check the archives and see if they haven't been

Re: numpy arrays to python compatible arrays

2010-06-10 Thread Philip Semanchuk
On Jun 10, 2010, at 9:58 AM, Javier Montoya wrote: Dear all, I'm new to python and have been working with the numpy package. I have some numpy float arrays (obtained from np.fromfile and np.cov functions) and would like to convert them to simple python arrays. I was wondering which is the best

Re: Installing Python 3.1.2 from source, how do you resolve the sqlite3-dev dependency?

2010-06-16 Thread Philip Semanchuk
ere's probably a better way to do it. In fact, I encourage you to look for a better way to do it and let us know about it. That way I won't have to risk screwing up my OS by renaming system libraries. =) Good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Ignorance and Google Groups (again)

2010-06-30 Thread Philip Semanchuk
On Jun 30, 2010, at 4:55 PM, D'Arcy J.M. Cain wrote: On Wed, 30 Jun 2010 13:10:43 -0700 (PDT) garryTX wrote: On Jun 29, 5:31 pm, nanothermite911fbibustards [...] you ignorant mf. stfu. You shouldn't be calling people ignorant for what they post if you are just going to repost every word

Re: Shared object access problems

2010-07-04 Thread Philip Semanchuk
hi Tim, This seems more likely to be a MySQLdb problem than a Python one. Have you considered asking in the MySQLdb forums? On Jul 4, 2010, at 7:46 PM, Tim Johnson wrote: Using python 2.6.4 on slackware 13.1 I have MySQLdb 'by hand', that is: by 1)downloading MySQL-python-1.2.3c1.tar.gz 2)un

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-05 Thread Philip Semanchuk
se. I'd be willing to contribute my experiences to a document somewhere. (Is there a Wiki?) I would have found such a document very helpful before I started porting. Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-05 Thread Philip Semanchuk
On Jul 5, 2010, at 6:41 PM, Chris Rebert wrote: On Mon, Jul 5, 2010 at 3:38 PM, Philip Semanchuk wrote: On Jul 5, 2010, at 4:30 PM, D'Arcy J.M. Cain wrote: On Mon, 05 Jul 2010 14:42:13 -0400 Terry Reedy wrote: Good start. Now what is blocking those four? Lack of developer interest

Re: Recommend a MySQLdb Forum

2010-07-07 Thread Philip Semanchuk
On Jul 6, 2010, at 3:16 PM, Tim Johnson wrote: Greetings: I would appreciate it if some could recommend a MySQLdb forum. The one associated the sourceforge project seems like a good bet. 1) go here: http://sourceforge.net/projects/mysql-python/ 2) click support -- http://mail.python.org/mai

Re: Python -- floating point arithmetic

2010-07-07 Thread Philip Semanchuk
"What Every Computer Scientist Should Know About Floating- Point Arithmetic": http://docs.sun.com/source/806-3568/ncg_goldberg.html Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-08 Thread Philip Semanchuk
On Jul 7, 2010, at 11:26 PM, Terry Reedy wrote: On 7/7/2010 5:29 AM, geremy condra wrote: On Tue, Jul 6, 2010 at 1:37 AM, Terry Reedy wrote: On 7/5/2010 9:00 PM, Philip Semanchuk wrote: On Jul 5, 2010, at 6:41 PM, Chris Rebert wrote: On Mon, Jul 5, 2010 at 3:38 PM, Philip Semanchu I

Re: executing python scripts within wx frames

2010-07-13 Thread Philip Semanchuk
t/stderr of a process that you launch. This sounds like what you're looking for. bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python portable/Can I install it on an USB Stick?

2010-07-14 Thread Philip Semanchuk
On Jul 14, 2010, at 3:28 PM, Thomas Tundor wrote: Is Python portable? Can I install it on an USB Stick? Or is Python installing (at least on WinXP) services or register some DLLs or write something into Registry? http://www.portablepython.com/ -- http://mail.python.org/mailman/listinfo/

Binary compatibility across Python versions?

2010-07-26 Thread Philip Semanchuk
and pointers to official documentation on the subject. Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Binary compatibility across Python versions?

2010-07-27 Thread Philip Semanchuk
On Jul 26, 2010, at 5:19 PM, Ned Deily wrote: In article , Christian Heimes wrote: [Philip Semanchuk wrote:] Specifically, I'm concerned with binaries created by SWIG for a C++ library that our project uses. We'd like to ship precompiled binaries for Linux, OS X and Windows for

Re: [Tutor] Finding the version # of a module, and py module problem

2010-08-05 Thread Philip Semanchuk
talled = getattr(module, attribute_name) break Hope this helps a little, Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] Finding the version # of a module, and py module problem

2010-08-06 Thread Philip Semanchuk
On Aug 6, 2010, at 10:20 AM, Richard D. Moores wrote: On Thu, Aug 5, 2010 at 18:47, Philip Semanchuk wrote: it's just a question of whether or not the module in question exposes any kind of a version attribute. There's no standard, unfortunately. The most popular convention s

Re: [Tutor] Finding the version # of a module, and py module problem

2010-08-06 Thread Philip Semanchuk
version = getattr(module, attribute_name) print "module %s has version %s" % (dependency, version) break bye Philip # Try each module import sys import numpy import scipy import string dependencies = "numyp", "scipy" fo

Re: Floating numbers

2010-08-12 Thread Philip Semanchuk
com/source/806-3568/ncg_goldberg.html There's a gentler discussion of it here: http://en.wikipedia.org/wiki/Floating_point#Representable_numbers.2C_conversion_and_rounding HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-05 Thread Philip Semanchuk
On Jun 5, 2009, at 10:13 AM, Thomas Heller wrote: s...@pobox.com schrieb: If there is no C++ compiler available then the proposed layout sniffing just wouldn't be done and either a configure error would be emitted or a run-time exception raised if a program attempted to use that feature.

Create multiple variables (with a loop?)

2009-06-05 Thread Philip Gröger
for each of them (to their neighbours). Don't know how else I could do that. Maybe a huuuge matrix? Thx for your help! - Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: installation in mac os x

2009-06-10 Thread Philip Semanchuk
On Jun 10, 2009, at 10:38 PM, Karl Jansson wrote: Hi, I was doing the tutorial at http://www.python.org/doc/current/tutorial/ , and I came across some code that did not work, and I got the following error: AttributeError: 'str' object has no attribute 'format'. So I downloaded a .dmg

Create 3D Surface / Contour (with vpython?)

2009-06-17 Thread Philip Gröger
nts/images/3D_contour2.jpg). I think you know what I mean. Reason: I want to simulate waves in a square basin. Hope I dont need to use hundrets of little spheres (in case of vpython) for the surface ;) Thanks alot - Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: SHM and Touchpad

2009-06-17 Thread Philip Semanchuk
e was (and still is) a old Python IPC module called shm. It uses Sys V semaphores, not POSIX semaphores like the shm in pypi. The old shm module has been replaced by two newer ones. For Sys V IPC: http://semanchuk.com/philip/sysv_ipc/ For POSIX IPC: http://semanchuk.com/philip/posix_ipc/ Th

KeyboardInterrupt eats my error and then won't be caught

2009-06-18 Thread Philip Semanchuk
der Ubuntu 8.0.4. If anyone wants to look at my C code, the relevant case statement is on line 555 of posix_ipc_module.c. http://semanchuk.com/philip/posix_ipc/ http://semanchuk.com/philip/sysv_ipc/ Any suggestions would be appreciated. Thanks Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: KeyboardInterrupt eats my error and then won't be caught

2009-06-20 Thread Philip Semanchuk
m ever in NL or NZ I'll buy you a beer. =) Cheers Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: KeyboardInterrupt eats my error and then won't be caught

2009-06-21 Thread Philip Semanchuk
On Jun 20, 2009, at 10:21 PM, greg wrote: Philip Semanchuk wrote: Best of all, PyErr_CheckSignals() doesn't interfere with a Python- level signal handler if one is set. Ah, I hadn't realised that you were doing this in C code, and I was trying to think of a Python-level soluti

Re: urllib2 content-type headers

2009-06-21 Thread Philip Semanchuk
if you find you don't need it in your final solution. good luck Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: How to output a complex List object to a file.

2009-06-22 Thread Philip Semanchuk
On Jun 22, 2009, at 9:17 AM, Jim Qiu wrote: Hi all, I have a object list list this: from bots.botsconfig import * from D96Arecords import recorddefs from edifactsyntax3 import syntax structure=[ {ID:'UNH',MIN:1,MAX:1,LEVEL:[ {ID:'BGM',MIN:1,MAX:1}, {ID:'DTM',MIN:1,MAX:5}, ...snip...

Re: python needs a tutorial for install and setup on a Mac

2009-06-22 Thread Philip Semanchuk
On Jun 22, 2009, at 8:56 AM, aberry wrote: thanks for suggestion... what should I put in 'bashrc ' so that I can switch between different version. as python command will always point to one Python framework (lets either 2.4.x or 2.5.x). Something like this would work: alias py25='/Librar

Re: C-extension 2 times slower than exe

2009-06-23 Thread Philip Semanchuk
On Jun 23, 2009, at 9:51 AM, Rolf Wester wrote: Hi, I have a C++ program that I would like to steer using Python. I made the wrapper using swig and linked the code (without the main function) into a shared object. My Python script loads the extension and calls a function of the C-extensio

Re: [Mac] file copy

2009-06-23 Thread Philip Semanchuk
ourceFork xattr -h gives options for this command. To the OP -- I remember reading somewhere that xattr is written in Python. You might find it useful or even be able to import it directly. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: [Mac] file copy

2009-06-23 Thread Philip Semanchuk
On Jun 23, 2009, at 12:20 PM, Tobias Weber wrote: In article , Philip Semanchuk wrote: I think resource forks are now stored as extended attributes, and No I'll take your word for it because I was just guessing, but then why do the xattrs in the example I gave show a resource

Animate Surface / Clear Scene (vpython)

2009-06-24 Thread Philip Gröger
er surface without deleting the old one. Or is there a "clear scene from all objects" command? If animating such a surface in vpython is too complicated / slow / etc ... I have to try mayavi. But I already know vpython ;) thanks alot -Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: installation in mac os x

2009-06-24 Thread Philip Semanchuk
have 2.6 installed, it is difficult to suggest how to invoke it. Let us know what you find. bye Philip -- http://mail.python.org/mailman/listinfo/python-list

Animate 3D Surface

2009-06-27 Thread Philip Gröger
ayavi mailing lists, but I didn't get an answer from them. I just hope someone of you can give me some "construct" which will work. Maybe I am just using the wrong methods. thanks alot!! - Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: postgreSQL python bindings - which one?

2009-06-27 Thread Philip Semanchuk
On Jun 27, 2009, at 8:27 AM, Albert Hopkins wrote: On Fri, 2009-06-26 at 21:10 -0700, Horace Blegg wrote: Hi, I'm having a hard time deciding which set of PGSQL python bindings to go with. I don't know much about SQL to begin with, so the collage of packages of somewhat daunting. I'm startin

Re: dealloc function in python extend c module

2009-07-02 Thread Philip Semanchuk
programs, but it can be useful for testing. Hope this helps Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: String to List Question

2009-07-02 Thread Philip Semanchuk
e just what you need. http://docs.python.org/library/stdtypes.html#str.split HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: dealloc function in python extend c module

2009-07-02 Thread Philip Semanchuk
On Jul 2, 2009, at 9:28 PM, Gabriel Genellina wrote: En Thu, 02 Jul 2009 14:22:53 -0300, Philip Semanchuk escribió: Hi Shen, I'm no expert on Python memory management, but since no once else has answered your question I'll tell you what I *think* is happening. Python does

How to map size_t using ctypes?

2009-07-06 Thread Philip Semanchuk
most platforms), but I like my code to be more robust than that. Furthermore, this is scientific code and it's entirely possible that someone will want to pass a huge array with more elements than can be described by a 32-bit long. Suggestions appreciated. Thanks Philip -- http://mai

Re: How to map size_t using ctypes?

2009-07-06 Thread Philip Semanchuk
On Jul 6, 2009, at 12:10 PM, Diez B. Roggisch wrote: Philip Semanchuk wrote: Hi all, I can't figure out how to map a C variable of size_t via Python's ctypes module. Let's say I have a C function like this: void populate_big_array(double *the_array, size_t element_count) {.

Re: Catching control-C

2009-07-06 Thread Philip Semanchuk
: http://docs.python.org/library/signal.html You want to trap SIGINT. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Catching control-C

2009-07-06 Thread Philip Semanchuk
On Jul 6, 2009, at 6:02 PM, Michael Mossey wrote: On Jul 6, 2:47 pm, Philip Semanchuk wrote: On Jul 6, 2009, at 5:37 PM, Michael Mossey wrote: What is required in a python program to make sure it catches a control- c on the command-line? Do some i/o? The OS here is Linux. You can use a

Re: How to map size_t using ctypes?

2009-07-07 Thread Philip Semanchuk
On Jul 6, 2009, at 11:51 PM, Gabriel Genellina wrote: En Mon, 06 Jul 2009 13:29:21 -0300, Philip Semanchuk escribió: On Jul 6, 2009, at 12:10 PM, Diez B. Roggisch wrote: Philip Semanchuk wrote: I can't figure out how to map a C variable of size_t via Python's ctypes module. f

Re: extract c/cpp include file with regular expression

2009-07-23 Thread Philip Semanchuk
le, it will be not necessary to check and match '<' with '>' and " with ", but I'm wondering to see more elegant way to do such thing. Hi tiefeng, Regexes are always a little ugly IMO. =) A side note -- does your parser need to handle /* comments like this

Re: extract c/cpp include file with regular expression

2009-07-23 Thread Philip Semanchuk
On Jul 23, 2009, at 12:36 PM, tiefeng wu wrote: 2009/7/24 Philip Semanchuk : I know this will sound like a sarcastic comment, but it is sincere: my suggestion is that if you want to parse C/C++ (or Python, or Perl, or Fortran, etc.), use a real parser, not regexes unless you're wi

Re: 2.3 missing on OSX

2009-07-23 Thread Philip Semanchuk
On Jul 23, 2009, at 4:53 PM, Laran Evans wrote: I just tried to run MacVim on OSX 10.5. It crashed with this: Dyld Error Message: Library not loaded: /System/Library/Frameworks/Python.framework/ Versions/2.3/Python Referenced from: /Users/laran/Downloads/MacVim-7_2-stable-1_2/ MacVim.app/Con

Re: 2.3 missing on OSX

2009-07-23 Thread Philip Semanchuk
On Jul 23, 2009, at 5:01 PM, Diez B. Roggisch wrote: Laran Evans schrieb: I just tried to run MacVim on OSX 10.5. It crashed with this: Dyld Error Message: Library not loaded: /System/Library/Frameworks/Python.framework/ Versions/2.3/Python Referenced from: /Users/laran/Downloads/MacVim-7_2-

Re: Bridging Python and C

2009-07-23 Thread Philip Semanchuk
ass params to C functions. Works great for me! HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help in passing a "-c command" argument to the interactive shell.

2009-07-28 Thread Philip Semanchuk
but that's probably not the case. "python --version" (again, no quotes) should tell you what version you're running. HTH Philip -- http://mail.python.org/mailman/listinfo/python-list

Re: Semaphore Techniques

2009-07-28 Thread Philip Semanchuk
ou are going to write your own semaphore I highly recommend Cython. My POSIX IPC extension permits manipulation of interprocess semaphores: http://semanchuk.com/philip/posix_ipc/ There's also one for SysV IPC: http://semanchuk.com/philip/sysv_ipc/ Enjoy P -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem in installing PyGreSQL

2009-08-03 Thread Philip Semanchuk
http://initd.org/ Hope this helps Philip -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   >