Re: Need help with file encoding-decoding

2011-09-23 Thread Philip Semanchuk
On Sep 23, 2011, at 7:44 AM, Yaşar Arabacı wrote: > Hi, > > I'am trying to write a mass html downloader, and it processes files after it > downloaded them. I have problems with encodings, and decodings. Sometimes I > get UnicodeDecodeErrors, or > I get half-pages in after processing part. Or mor

Re: Numpy.array with dtype works on list of tuples not on list of lists?

2011-09-18 Thread Philip Semanchuk
On Sep 18, 2011, at 11:55 AM, Alex van der Spek wrote: > Why does this not work? > dat=[[1,2,3],[4,5,6]] col=[('a','f4'),('b','f4'),('c','f4')] arr=numpy.array(dat,dtype=col) > > Traceback (most recent call last): > File "", line 1, in > arr=numpy.array(dat,dtype=col) > TypeEr

Python Tools for Visual Studio - anyone using it?

2011-08-30 Thread Philip Semanchuk
Hi all, I was reminded today (via Slashdot) of Python Tools for Visual Studio which was discussed on this list back in March (http://mail.python.org/pipermail/python-list/2011-March/1267662.html) and has reached version 1.0. Is anyone here using it? Care to share pros & cons? Here's the URL for

Re: Help parsing a text file

2011-08-29 Thread Philip Semanchuk
On Aug 29, 2011, at 2:21 PM, William Gill wrote: > I haven't done much with Python for a couple years, bouncing around between > other languages and scripts as needs suggest, so I have some minor difficulty > keeping Python functionality Python functionality in my head, but I can > overcome th

Re: Button Label change on EVT_BUTTON in wxpython!!!

2011-08-28 Thread Philip Semanchuk
On Aug 28, 2011, at 9:30 PM, Ven wrote: > Some system info before proceeding further: > > Platform: Mac OS X 10.7.1 > Python Version: ActiveState Python 2.7.1 > wxPython Version: [url=http://downloads.sourceforge.net/wxpython/ > wxPython2.9-osx-2.9.2.1-cocoa-py2.7.dmg]wxPython2.9-osx-cocoa-py2.7

Re: Understanding .pth in site-packages

2011-08-27 Thread Philip Semanchuk
On Aug 27, 2011, at 6:49 PM, Josh English wrote: > When I run: os.listdir('c:\Python27\lib\site-packages') I get the contents in > order, so the folders come before .pth files (as nothing comes before > something.) That's one definition of "in order". =) > I would guess Python is using os.li

Re: Understanding .pth in site-packages

2011-08-27 Thread Philip Semanchuk
On Aug 27, 2011, at 4:14 PM, Terry Reedy wrote: > On 8/27/2011 2:07 PM, Philip Semanchuk wrote: >> >> On Aug 27, 2011, at 1:57 PM, Josh English wrote: >> >>> Philip, >>> >>> Yes, the proper path should be c:\dev\XmlDB, which has the >&g

Re: Understanding .pth in site-packages

2011-08-27 Thread Philip Semanchuk
On Aug 27, 2011, at 1:57 PM, Josh English wrote: > Philip, > > Yes, the proper path should be c:\dev\XmlDB, which has the setup.py, xmldb > subfolder, the docs subfolder, and example subfolder, and the other text > files proscribed by the package development folder. > > I could only get it to

Re: Understanding .pth in site-packages

2011-08-27 Thread Philip Semanchuk
On Aug 27, 2011, at 12:56 PM, Josh English wrote: > (This may be a shortened double post) > > I have a development version of a library in c:\dev\XmlDB\xmldb > > After testing the setup script I also have c:\python27\lib\site-packages\xmldb > > Now I'm continuing to develop it and simultaneous

Re: Immediate Requirement for a Data Warehouse Developer

2011-08-25 Thread Philip Semanchuk
On Aug 25, 2011, at 9:24 AM, Sirisha wrote: > Position Profile – Senior Data Warehouse Developer As was mentioned on the list less than 24 hours ago, please don't post job listings to this mailing list. Use the Python jobs board instead: http://www.python.org/community/jobs/ -- http://mail.p

Re: Hot Girls are Looking for Sex

2011-08-19 Thread Philip Semanchuk
On Aug 19, 2011, at 4:17 PM, Matty Sarro wrote: > That's great - but do they program in python? Please don't repost URLs sent by a spammer. Only Google truly knows how its algorithm works, but the general consensus is that the more times Google sees a link repeated, the more credibility the l

Re: List spam

2011-08-18 Thread Philip Semanchuk
On Aug 18, 2011, at 1:10 PM, Peter Pearson wrote: > On Thu, 18 Aug 2011 12:15:59 -0400, gene heskett wrote: > [snip] >> What is wrong with the mailing list only approach? > > In the mailing-list approach, how do I search for prior discussions > on a subject? (I'm not particularly opposed to th

Re: List spam

2011-08-18 Thread Philip Semanchuk
On Aug 18, 2011, at 8:58 AM, Jason Staudenmayer wrote: > I really like this list as part of my learning tools but the amount of spam > that I've been getting from it is CRAZY. Doesn't anything get scanned before > it sent to the list? This has been discussed on the list a number of times befor

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Philip Semanchuk
On Aug 16, 2011, at 10:15 PM, Terry Reedy wrote: > On 8/16/2011 8:18 PM, Philip Semanchuk wrote: > >> Hi Terry, >> To generalize from your example, are you saying that there's a mild >> admonition > > against shadowing builtins with unrelated variable name

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Philip Semanchuk
On Aug 16, 2011, at 9:29 PM, Steven D'Aprano wrote: > I have no objection to lint tools. But separation of concerns should apply: > the Python compiler should just compile what I tell it to, the linter > should warn me if I'm running with scissors. This point (also made by Ethan) I can agree wit

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Philip Semanchuk
On Aug 16, 2011, at 7:29 PM, Terry Reedy wrote: > On 8/16/2011 1:15 PM, Gerrat Rickert wrote: > >> I think that best practices would suggest that one shouldn't use >> variable >> names that shadow builtins (except in specific, special circumstances), >> so I don't really think this would be an a

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Philip Semanchuk
On Aug 16, 2011, at 12:19 PM, Ethan Furman wrote: > Philip Semanchuk wrote: >> On Aug 16, 2011, at 11:41 AM, Ethan Furman wrote: >>> Philip Semanchuk wrote: >>>> If we are to eschew warnings in >>>> cases where they might be highlighting something harmle

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Philip Semanchuk
On Aug 16, 2011, at 11:41 AM, Ethan Furman wrote: > Philip Semanchuk wrote: >> On Aug 16, 2011, at 1:15 AM, Steven D'Aprano wrote: >>> Protecting n00bs from their own errors is an admirable aim, but have you >>> considered that warnings for something which may be

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Philip Semanchuk
On Aug 16, 2011, at 11:12 AM, Chris Angelico wrote: > On Tue, Aug 16, 2011 at 3:13 PM, Philip Semanchuk > wrote: > >> One need look no further than the standard library to see a strong >> counterexample. grep through the Python source for " file =". I see

Re: Why no warnings when re-assigning builtin names?

2011-08-16 Thread Philip Semanchuk
On Aug 16, 2011, at 1:15 AM, Steven D'Aprano wrote: > On Tue, 16 Aug 2011 01:23 pm Philip Semanchuk wrote: > >> >> On Aug 15, 2011, at 9:32 PM, Steven D'Aprano wrote: >> >>> On Tue, 16 Aug 2011 08:15 am Chris Angelico wrote: >>> >>&g

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Philip Semanchuk
On Aug 15, 2011, at 9:32 PM, Steven D'Aprano wrote: > On Tue, 16 Aug 2011 08:15 am Chris Angelico wrote: > >> If you want a future directive that deals with it, I'd do it the other >> way - from __future__ import mask_builtin_warning or something - so >> the default remains as it currently is. B

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Philip Semanchuk
On Aug 15, 2011, at 5:52 PM, Gerrat Rickert wrote: > With surprising regularity, I see program postings (eg. on > StackOverflow) from inexperienced Python users accidentally > re-assigning built-in names. > > > > For example, they'll innocently call some variable, "list", and assign a > list

Re: Help needed with using SWIG wrapped code in Python

2011-08-15 Thread Philip Semanchuk
On Aug 15, 2011, at 4:08 AM, Vipul Raheja wrote: > Hi, > > I have wrapped a library from C++ to Python using SWIG. But I am facing > problems while importing and using it in Python. Hi Vipul, Did you try asking about this on the SWIG mailing list? bye Philip -- http://mail.python.org/mailma

Re: multiprocessing timing issue

2011-08-10 Thread Philip Semanchuk
On Aug 9, 2011, at 1:07 PM, Tim Arnold wrote: > Hi, I'm having problems with an empty Queue using multiprocessing. > > The task: > I have a bunch of chapters that I want to gather data on individually and > then update a report database with the results. > I'm using multiprocessing to do the da

Re: WxPython and TK

2011-08-08 Thread Philip Semanchuk
On Aug 7, 2011, at 8:26 PM, azrael wrote: > Today I found a quote from Guido. > > wxPython is the best and most mature cross-platform GUI toolkit, given a > number of constraints. The only reason wxPython isn't the standard Python GUI > toolkit is that Tkinter was there first. > -- Guido van R

Re: Table Driven GUI Definition?

2011-08-05 Thread Philip Semanchuk
On Aug 5, 2011, at 6:20 PM, Tim Daneliuk wrote: > On 8/5/2011 3:42 PM, Philip Semanchuk wrote: >> >> On Aug 5, 2011, at 4:10 PM, Tim Daneliuk wrote: >> >>> On 8/5/2011 2:05 PM, Irmen de Jong said this: >>>> On 05-08-11 19:53, Tim Daneliuk wrote:

Re: Table Driven GUI Definition?

2011-08-05 Thread Philip Semanchuk
On Aug 5, 2011, at 4:10 PM, Tim Daneliuk wrote: > On 8/5/2011 2:05 PM, Irmen de Jong said this: >> On 05-08-11 19:53, Tim Daneliuk wrote: >>> I have a task where I want to create pretty simple one page visual >>> interfaces (Graphical or Text, but it needs to run across Windows, >>> Cygwin, Linux

Re: Deeply nested dictionaries - should I look into a database or am I just doing it wrong?

2011-07-31 Thread Philip Semanchuk
On Jul 31, 2011, at 4:04 PM, Thorsten Kampe wrote: > * Andrew Berg (Sun, 31 Jul 2011 13:36:43 -0500) >> On 2011.07.31 02:41 AM, Thorsten Kampe wrote: >>> Another approach would be named tuples instead of dictionaries or >>> flat SQL tables. >> What would the advantage of that be? > > QueueItem.x

Re: how to get Python to insert special characters in an xml file?

2011-07-15 Thread Philip Semanchuk
On Jul 15, 2011, at 7:53 AM, hackingKK wrote: > Hello all. > I am currently developing a python application which reads and writes some > data to an xml file. > I use the elementTree library for doing this. > My simple question is that if I have some thing like & as in "kk & company " > as orga

Re: wx MenuItem - icon is missing

2011-07-06 Thread Philip Semanchuk
On Jul 6, 2011, at 2:25 AM, Laszlo Nagy wrote: > >>> Under windows, this displays the icon for the popup menu item. Under GTK it >>> doesn't and there is no error message, no exception. >> >> I get different results than you. >> >> Under Ubuntu 9.04 w with wx 2.8.9.1, when I right click I see

Re: wx MenuItem - icon is missing

2011-07-05 Thread Philip Semanchuk
On Jul 5, 2011, at 3:32 PM, Laszlo Nagy wrote: > >> 1. Post a complete example that demonstrates the problem so that we don't >> have to dummy up a wx app ourselves to try your code. > [code sample snipped] > > Under windows, this displays the icon for the popup menu item. Under GTK it > d

Re: wx MenuItem - icon is missing

2011-07-05 Thread Philip Semanchuk
On Jul 5, 2011, at 4:02 AM, Laszlo Nagy wrote: >def onPopupMenu(self,evt): >menu = wx.Menu() >for title,bitmap in self.getPopupMenuItems(): >item = wx.MenuItem(None,-1,title) >if bitmap: >item.SetBitmap(bitmap) >menu.AppendIt

Re: unzip problem

2011-06-24 Thread Philip Semanchuk
On Jun 24, 2011, at 10:55 AM, Ahmed, Shakir wrote: > Hi, > > > > I am getting following error message while unziping a .zip file. Any > help or idea is highly appreciated. > > > > Error message>>> > > Traceback (most recent call last): > > File "C:\Zip_Process\py\test2_new.py", line 15,

Re: search through this list's email archives

2011-06-23 Thread Philip Semanchuk
On Jun 23, 2011, at 12:11 PM, Cathy James wrote: > Dear All, > > I looked through this forum's archives, but I can't find a way to > search for a topic through the archive. Am I missing something? http://www.google.com/search?q=site%3Amail.python.org%2Fpipermail%2Fpython-list%2F+++banana -- h

Re: dummy, underscore and unused local variables

2011-06-13 Thread Philip Semanchuk
On Jun 13, 2011, at 11:37 AM, Tim Johnson wrote: > NOTE: I see much on google regarding unused local variables, > however, doing a search for 'python _' hasn't proved fruitful. Yes, Google's not good for searching punctuation. But 'python underscore dummy OR unused' might work better. > On a

Re: Validating string for FDQN

2011-06-06 Thread Philip Semanchuk
On Jun 6, 2011, at 8:40 PM, Eric wrote: > Hello, > > Is there a library or regex that can determine if a string is a fqdn > (fully qualified domain name)? I'm writing a script that needs to add > a defined domain to the end of a hostname if it isn't already a fqdn > and doesn't contain the defin

Re: Newbie question about SQLite + Python and twitter

2011-05-25 Thread Philip Semanchuk
On May 25, 2011, at 2:17 PM, Jayme Proni Filho wrote: > Helo guys, > > I'm building a local application for twitter for my brother's store. I'm in > the beginning and I have some newbie problems, so: > > I create a table called tb_messages with int auto increment and varchar(140) > fields; > I

Re: checking if a list is empty

2011-05-06 Thread Philip Semanchuk
On May 6, 2011, at 5:57 PM, scattered wrote: > On May 6, 2:36 am, Jabba Laci wrote: >> Hi, >> >> If I want to check if a list is empty, which is the more pythonic way? >> >> li = [] >> >> (1) if len(li) == 0: >> ... >> or >> (2) if not li: >> ... >> >> Thanks, >> >> Laszlo > > is there any

Re: ElementTree XML parsing problem

2011-04-27 Thread Philip Semanchuk
On Apr 27, 2011, at 2:26 PM, Mike wrote: > I'm using ElementTree to parse an XML file, but it stops at the second record > (id = 002), which contains a non-standard ascii character, ä. Here's the XML: > > > > > > > > > > > The complaint offered up by the parser is > > Unexpected error

Re: Terrible FPU performance

2011-04-26 Thread Philip Semanchuk
On Apr 26, 2011, at 1:34 PM, Mihai Badoiu wrote: > Already did. They suggested the python list, because the asm generated code > is really correct and the problem might be with the python running on top. Does the same timing in consistency appear when you use pure Python? bye Philip > > On

Re: De-tupleizing a list

2011-04-25 Thread Philip Semanchuk
On Apr 25, 2011, at 11:28 PM, Gnarlodious wrote: > I have an SQLite query that returns a list of tuples: > > [('0A',), ('1B',), ('2C',), ('3D',),... > > What is the most Pythonic way to loop through the list returning a > list like this?: > > ['0A', '1B', '2C', '3D',... This works for me -

Re: renaming files in OS X

2011-04-20 Thread Philip Semanchuk
On Apr 20, 2011, at 10:02 AM, wrote: > Hello, > > I'm considering using os.rename or shutil for renaming > files on OS X (Snow Leopard). However, I've read that > shutil doesn't copy the resource fork or metadata for > the files on OS X. I'm not sure about os.rename though. > I need to

Re: multiprocessing

2011-04-07 Thread Philip Semanchuk
On Apr 7, 2011, at 8:57 PM, Kerensa McElroy wrote: > > Hi, > > thanks for your response. > > I checked out multiprocessing.value, however from what I can make out, it > works with object of only a very limited type. Is there a way to do this for > more complex objects? (In reality, my object

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-07 Thread Philip Semanchuk
On Apr 7, 2011, at 3:41 AM, John Ladasky wrote: > Following up to my own post... > > On Apr 6, 11:40 pm, John Ladasky wrote: > >> What's up with that? > > Apparently, "what's up" is that I will need to implement a third > method in my ndarray subclass -- namely, __reduce__. > > http://www.ma

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-05 Thread Philip Semanchuk
On Apr 5, 2011, at 12:58 PM, John Ladasky wrote: > Hi Philip, > > Thanks for the reply. > > On Apr 4, 4:34 pm, Philip Semanchuk wrote: >> So if you're going to use multiprocessing, you're going to use pickle, and >> you >> need pickleable objects

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread Philip Semanchuk
On Apr 4, 2011, at 9:03 PM, Dan Stromberg wrote: > On Mon, Apr 4, 2011 at 4:34 PM, Philip Semanchuk wrote: > >> So if you're going to use multiprocessing, you're going to use pickle, and >> you need pickleable objects. >> > > http://docs.python.org/li

Re: PyThreadState_Swap crash

2011-04-04 Thread Philip Semanchuk
On Apr 4, 2011, at 9:08 AM, Wiktor Adamski wrote: > I have 2 threads in C code using python 2.5.2. First thread creates > new interpreter (i need several interpreters but those 2 threads use > only one) like that: > > PyEval_AcquireLock(); > threadState = Py_NewInterpreter(); > PyThreadState_Swa

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread Philip Semanchuk
On Apr 4, 2011, at 4:20 PM, John Ladasky wrote: > I have been playing with multiprocessing for a while now, and I have > some familiarity with Pool. Apparently, arguments passed to a Pool > subprocess must be able to be pickled. Hi John, multiprocessing's use of pickle is not limited to Pool.

Re: calling 64 bit routines from 32 bit matlab on Mac OS X

2011-03-15 Thread Philip Semanchuk
On Mar 15, 2011, at 11:58 AM, Danny Shevitz wrote: > Howdy, > > I have run into an issue that I am not sure how to deal with, and would > appreciate any insight anyone could offer. > > I am running on Mac OS X 10.5 and have a reasonably large tool chain including > python, PyQt, Numpy... If I d

Re: Is there any python library that parse c++ source code statically

2011-03-13 Thread Philip Semanchuk
On Mar 13, 2011, at 11:46 AM, Stefan Behnel wrote: > Francesco Bochicchio, 13.03.2011 10:37: >> On 13 Mar, 10:14, kuangye wrote: >>> Hi, all. I need to generate other programming language source code >>> from C++ source code for a project. To achieve this, the first step is >>> to "understand" t

Re: Do you monitor your Python packages in inux distributions?

2011-03-12 Thread Philip Semanchuk
On Mar 12, 2011, at 2:26 PM, s...@pobox.com wrote: > > I'm one of the SpamBayes developers and in a half-assed way try to keep > track of SB dribbles on the net via a saved Google search. About a month > ago I got a hit on an Ubuntu bug tracker about a SpamBayes bug. As it turns > out, Ubuntu

Re: multiprocessing module in async db query

2011-03-09 Thread Philip Semanchuk
o use threads. A Queue object for threads exists in the standard library too. You might find that useful. HTH Philip > > On Mar 8, 6:34 pm, Philip Semanchuk wrote: >> On Mar 8, 2011, at 3:25 PM, Sheng wrote: >> >>> This looks like a tornado problem, but trus

Re: multiprocessing module in async db query

2011-03-08 Thread Philip Semanchuk
On Mar 8, 2011, at 3:25 PM, Sheng wrote: > This looks like a tornado problem, but trust me, it is almost all > about the mechanism of multiprocessing module. [snip] > So the workflow is like this, > > get() --> fork a subprocess to process the query request in > async_func() -> when async_fun

Re: questions about multiprocessing

2011-03-04 Thread Philip Semanchuk
On Mar 4, 2011, at 11:08 PM, Vincent Ren wrote: > Hello, everyone, recently I am trying to learn python's > multiprocessing, but > I got confused as a beginner. > > If I run the code below: > > from multiprocessing import Pool > import urllib2 > otasks = [ > 'http://www.php.net' > 'http

Re: Checking against NULL will be eliminated?

2011-03-02 Thread Philip Semanchuk
On Mar 2, 2011, at 9:21 AM, Stefan Behnel wrote: > Claudiu Popa, 02.03.2011 14:51: >> Hello Python-list, >> >> >> I don't know how to call it, but the following Python 3.2 code seems to >> raise a >> FutureWarning. >> >> def func(root=None): >> nonlocal arg >> if root: >>arg

Re: LDFLAGS problem

2011-02-21 Thread Philip Semanchuk
On Feb 21, 2011, at 12:56 PM, Robin Becker wrote: > After installing python 2.7.1 on a Freebsd 8.0 system with the normal > configure make dance > > ./configure --prefix=$HOME/PYTHON --enable-unicode=ucs2 > make > make install > > I find that when I build extensions PIL, MySQLdb I'm getting er

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

Re: help with multiprocessing pool

2011-01-27 Thread Philip Semanchuk
On Jan 25, 2011, at 8:19 PM, Craig Yoshioka wrote: > Hi all, > > I could really use some help with a problem I'm having. Hiya Craig, I don't know if I can help, but it's really difficult to do without a full working example. Also, your code has several OS X-isms in it so I guess that's the

Re: examples of realistic multiprocessing usage?

2011-01-21 Thread Philip Semanchuk
On Jan 21, 2011, at 3:36 PM, Dan Stromberg wrote: > On Fri, Jan 21, 2011 at 3:20 AM, Adam Skutt wrote: >> On Jan 20, 11:51 pm, Albert van der Horst >> wrote: >>> This is what some people want you to believe. Arm twisting by >>> GPL-ers when you borrow their ideas? That is really unheard of. >>

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: getdefaultencoding - how to change this?

2011-01-20 Thread Philip Semanchuk
On Jan 20, 2011, at 10:39 AM, Helmut Jarausch wrote: > On Thu, 20 Jan 2011 14:31:09 +, Helmut Jarausch wrote: > >> Hi, >> I've searched the net but didn't find the information I need. Using >> Python-2.7.1, I know, I can't modify defaultencoding at run time. Python >> even ignores >> export

Re: examples of realistic multiprocessing usage?

2011-01-16 Thread Philip Semanchuk
On Jan 16, 2011, at 2:05 PM, TomF wrote: > I'm trying to multiprocess my python code to take advantage of multiple > cores. I've read the module docs for threading and multiprocessing, and I've > done some web searches. All the examples I've found are too simple: the > processes take simple

Re: Career path - where next?

2011-01-12 Thread Philip Semanchuk
On Jan 12, 2011, at 11:37 AM, Alan Harris-Reid wrote: > > Hi there, I wonder if any Python folk out there can help me. > > For many years I was a contractor developing desktop and web applications > using Visual Foxpro as my main language, with Foxpro, SQL-server and Oracle > as back-end data

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

2011-01-10 Thread Philip Semanchuk
On Jan 10, 2011, at 6:05 PM, Ben Finney wrote: > "Thomas L. Shinnick" writes: > >> Here, I need to list multiple file/dir path pairs. A list of multiple >> items to be acted upon in a common way. It is a list. Simple. >> Except I can't find a library/pypi module with the obvious extension. >

Re: Searching Python-list

2011-01-05 Thread Philip Semanchuk
On Jan 5, 2011, at 8:31 PM, Slie wrote: > I was wondering if anyone could tell me how to search through the Archives > otter then manually looking through each month. Do a Google search and include this term: site:mail.python.org/pipermail/python-list/ e.g. to search for banana: http://www.go

Re: is py2exe still active ?

2010-12-08 Thread Philip Semanchuk
On Dec 8, 2010, at 5:09 AM, Octavian Rasnita wrote: > Hi Steve, > > I may put some stupid questions because I am very new to Python, but... I > heard about pypi/pip. Aren't all these Python libraries (like cxFreeze) > provided on a central archive where we can get them and also report the bugs

Re: Backup postgresql database from python

2010-12-04 Thread Philip Semanchuk
On Dec 4, 2010, at 2:32 PM, D'Arcy J.M. Cain wrote: > On Sat, 4 Dec 2010 19:12:08 + > starglider develop wrote: >> I need to backup a postgresql database from python withour using pg_dump! >> Is any way of doing that? > > Probably. I guess the first question is why can't you use pg_dump? >

Re: Installing pysqlite on Win64

2010-11-20 Thread Philip Semanchuk
On Nov 20, 2010, at 12:37 PM, Navid Parvini wrote: > Dear All, > > I want to install pysqlite on my Windows 64 bit machine. I have python 2.4.3 > on it. > Would you please let me know how can I do it? > > That is, I need to use the source file (i.e pysqlite-2.5.6.tar.gz) or there > is an exec

Re: Is Unladen Swallow dead?

2010-11-17 Thread Philip Semanchuk
On Nov 17, 2010, at 5:09 PM, John Nagle wrote: > On 11/17/2010 12:49 PM, John Ladasky wrote: >> On Nov 16, 2:30 pm, laspi wrote: >>> Is Unladen Swallow dead? >> >> No, it's just resting. > > For those who don't get that, The Monty Python reference: > "http://www.mtholyoke.edu/~ebarnes/python/d

Re: Copy Protected PDFs and PIL

2010-11-11 Thread Philip Semanchuk
On Nov 11, 2010, at 3:28 PM, Brett Bowman wrote: > I'm trying to parse some basic details and a thumbnail from ~12,000 PDFs for > my company, but a few hundred of them are copy protected. To make matters > worse, I can't seem to trap the error it causes: whenever it happens PIL > throws a "FATAL

Re: Silly newbie question - Caret character (^)

2010-11-09 Thread Philip Semanchuk
On Nov 9, 2010, at 1:04 AM, Lawrence D'Oliveiro wrote: > In message , Seebs wrote: > >> On 2010-11-09, Lawrence D'Oliveiro >> wrote: >> >>> In message , Dennis >>> Lee Bieber wrote: Have you ever looked at the reference manual for Ada? >> >>> Or even worse, the annotated reference.

Re: Silly newbie question - Carrot character (^)

2010-11-07 Thread Philip Semanchuk
On Nov 6, 2010, at 10:45 AM, D'Arcy J.M. Cain wrote: > On Sat, 6 Nov 2010 10:22:47 -0400 > Philip Semanchuk wrote: >>> The tutorial isn't meant as an exhaustive lesson on every single Python >>> feature. >> >> I agree, and I don't expect othe

Re: Silly newbie question - Carrot character (^)

2010-11-06 Thread Philip Semanchuk
On Nov 6, 2010, at 12:33 AM, Steven D'Aprano wrote: > On Fri, 05 Nov 2010 23:21:11 -0400, Philip Semanchuk wrote: > >> Take the OP's question. How is one supposed to find out about bitwise >> operators in Python? AFAICT they're not mentioned in the tutori

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Philip Semanchuk
On Nov 5, 2010, at 6:51 PM, Seebs wrote: > On 2010-11-05, Nobody wrote: >> However, it's still written for language lawyers. > >> IMHO, the lack of a reference manual for the language itself is a major >> hole in Python's documentation. > > I'm a bit lost here. Could you highlight some of the

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Philip Semanchuk
On Nov 5, 2010, at 5:21 PM, Nobody wrote: > On Fri, 05 Nov 2010 10:12:05 -0400, Philip Semanchuk wrote: > >> As others have said, ^ is for XOR. That's buried here in the >> documentation: >> http://docs.python.org/release/2.7/reference/... >> >> Not

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Philip Semanchuk
On Nov 5, 2010, at 12:43 PM, Peter Pearson wrote: > On Fri, 5 Nov 2010 10:12:05 -0400, Philip Semanchuk wrote: >> >> BTW the more common name for this character is caret (ka-RAY). > > Yes, it's caret, but no, it's KA-rit, almost the same as > carrot. It

Re: Silly newbie question - Carrot character (^)

2010-11-05 Thread Philip Semanchuk
On Nov 5, 2010, at 9:43 AM, Matty Sarro wrote: > Hey Everyone, > Just curious - I'm working on a program which includes a calculation of a > circle, and I found myself trying to use pi*radius^2, and getting errors > that data types float and int are unsupported for "^". Now, I realized I was > ma

Re: Compiling/Installing Python 2.7 on OSX 10.6

2010-11-04 Thread Philip Semanchuk
On Nov 4, 2010, at 4:05 PM, Ned Deily wrote: > In article > <238cec6d-2f47-4c97-8941-e28e68089...@a9g2000pro.googlegroups.com>, > Jeremy wrote: > [...] >> I downloaded the source from python.org and extracted with 'tar -xzvf >> Python-2.7.tgz' My home space is on some network somewhere. I thi

Re: Create a GUI and EXE for a python app?

2010-10-28 Thread Philip Semanchuk
On Oct 28, 2010, at 5:43 PM, brad...@hotmail.com wrote: > Thanks ill give it a try! Anyone know about the GUI then? Lots of people know about GUIs, the problem is that it's not a simple subject. There's lots of free education on the subject in the list archives. Here's my very brief summary of

Re: Python 2.7 or 3.1

2010-10-26 Thread Philip Semanchuk
On Oct 26, 2010, at 11:10 PM, Jorge Biquez wrote: > Hello Christian and all . > > Thanks for the comments. I am newbie to Python trying to learn all the > comments, that , by the way, I am very impressed of the knowledge of the > people present in this list. > > I was wondering if you can com

Re: Help Need in running a Python Program from terminal

2010-10-25 Thread Philip Semanchuk
On Oct 25, 2010, at 7:16 AM, Raji wrote: > Greetings ! > > I want to analyse and debug a python program ( its a astrology application > ) > > Downloaded the code from here http://openastro.org/?Download > for Ubuntu > > When i executed the main file python o

Re: get python bit version as in (32 or 64)

2010-10-19 Thread Philip Semanchuk
On Oct 19, 2010, at 5:38 PM, Hexamorph wrote: > On 19.10.2010 23:18, Vincent Davis wrote: >> How do I get the bit version of the installed python. In my case, osx >> python2.7 binary installed. I know it runs 64 bt as I can see it in >> activity monitor. but how do I ask python? >> sys.version >>

Re: get python bit version as in (32 or 64)

2010-10-19 Thread Philip Semanchuk
On Oct 19, 2010, at 5:18 PM, Vincent Davis wrote: > How do I get the bit version of the installed python. In my case, osx > python2.7 binary installed. I know it runs 64 bt as I can see it in > activity monitor. but how do I ask python? > sys.version > '2.7 (r27:82508, Jul 3 2010, 21:12:11) \n[G

Re: Does everyone keep getting recruiting emails from google?

2010-10-14 Thread Philip Semanchuk
On Oct 14, 2010, at 11:49 AM, Daniel Fetchinson wrote: > I keep getting recruiting emails from charlesngu...@google.com about > working for google as an engineer. I know what you mean. Apparently Charles Nguyen doesn't realize that I already get no end of emails and phone calls from Sergei and

Re: Compiling as 32bit on MacOSX

2010-10-13 Thread Philip Semanchuk
On Oct 13, 2010, at 3:54 AM, Gregory Ewing wrote: > Philip Semanchuk wrote: > >> Hi Greg, >> Are you talking about compiling Python itself or extensions? > > I've managed to get Python itself compiled as 32 bit, > and that also seems to take care of extension

Re: Compiling as 32bit on MacOSX

2010-10-12 Thread Philip Semanchuk
On Oct 12, 2010, at 8:29 PM, Gregory Ewing wrote: > I'm getting my Python environment set up on a new > Snow Leopard machine, and I'd like to compile everything > in 32 bit mode for the time being, because some of the > extensions I need use APIs that aren't available in > 64 bit. > > Is there s

Re: SQLite is quite SQL compliant

2010-10-03 Thread Philip Semanchuk
On Oct 3, 2010, at 2:21 PM, John Nagle wrote: > On 10/2/2010 3:06 PM, Seebs wrote: > >> I would agree that the word "nonstandard" seems to be a little strong and >> discouraging. sqlite is a source of joy, a small bright point of decent >> and functional software in a world full of misbehaving

Re: SQLite is quite SQL compliant

2010-10-02 Thread Philip Semanchuk
On Oct 2, 2010, at 6:58 PM, Tim Chase wrote: > On 10/02/10 17:06, Seebs wrote: >> On 2010-10-02, Ravi wrote: >>> The documentation of the sqlite module at >>> http://docs.python.org/library/sqlite3.html says: >> >>> "...allows accessing the database using a nonstandard >>> variant of the SQL...

how to test get_special_folder_path()?

2010-09-29 Thread Philip Semanchuk
Hi all, The documentation for get_special_folder_path() and friends says that they're "available as additional built-in functions in the installation script". http://docs.python.org/distutils/builtdist.html#the-postinstallation-script Does anyone know of a way to play around with these functions

Re: if the else short form

2010-09-29 Thread Philip Semanchuk
On Sep 29, 2010, at 7:19 AM, Tom Potts wrote: > This is just a sneaky shorthand, which is fine if that's what you want, but > it makes it harder to read. The reason it works is that 'fill==True' is a > boolean expression, which evaluates to True or False, but if you force a > True into being an

Re: Parsing error for ConfigParser

2010-09-23 Thread Philip Semanchuk
On Sep 23, 2010, at 1:22 PM, Andrew Z. wrote: > Is there a way to parse RealPlayer's realplayerrc in Python? I need > to support Python 2.5 - 2.7 > > Example code > > import urllib2 > import ConfigParser > f = urllib2.urlopen('http://pastebin.com/download.php?i=N1AcUg3w') > config = ConfigPars

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Philip Semanchuk
On Sep 21, 2010, at 8:29 AM, Ant wrote: > Hi all, > > I've just seen this: http://sheddingbikes.com/posts/1285063820.html > > Whatever you think of Zed Shaw (author of the Mongrel Ruby server and > relatively recent Python convert), he has a very good point in this. I > run Fedora 12 on my home

Re: Python in Linux - barrier to Python 3.x

2010-09-21 Thread Philip Semanchuk
On Sep 21, 2010, at 8:29 AM, Ant wrote: > Hi all, > > I've just seen this: http://sheddingbikes.com/posts/1285063820.html > > Whatever you think of Zed Shaw (author of the Mongrel Ruby server and > relatively recent Python convert), he has a very good point in this. I > run Fedora 12 on my home

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-19 Thread Philip Semanchuk
On Sep 19, 2010, at 6:05 PM, Xavier Ho wrote: > On 20 September 2010 07:59, Ken Watford > >> wrote: > >> >> Not that I disagree with you, but you might find this helpful: >> http://tinyurl.com/preview.php >> -- >> http://mail.python.org/mailman/listinfo/python-list >> > > I don't think the O

Re: This Is International Don’t-Squawk-Like-A -Parrot Day

2010-09-19 Thread Philip Semanchuk
On Sep 19, 2010, at 7:37 AM, Tim Chase wrote: > On 09/18/10 23:46, Lawrence D'Oliveiro wrote: >> Do your bit to help stamp out parrocy. > > Did you send this by mistake? It looks like a parroty-error. I think it's a > bit off... What an wkward thing to say. Are you crackers? -- http://m

Re: Standard library function to remove folder with files and subfolders?

2010-09-18 Thread Philip Semanchuk
On Sep 18, 2010, at 5:24 PM, pyt...@bdurham.com wrote: > Is there a standard library function to remove a folder that may > contain files and subfolders? Or must I write a function that > walks my folder's children and deletes all files/subfolders > first, and then call os.removedirs()? In Pytho

Re: self-closing window with wxPython

2010-09-17 Thread Philip Semanchuk
On Sep 17, 2010, at 12:05 PM, Jabba Laci wrote: > Hi, > > I'd like to create a simple alarm application that shows an alarm > window. The application should shut down automatically after 5 > seconds. The problem is the following: > * If I keep the mouse outside of the window, the application kee

Re: Extracting item from list of tuples?

2010-09-05 Thread Philip Semanchuk
On Sep 5, 2010, at 1:45 PM, Peter Otten wrote: Philip Semanchuk wrote: On Sep 5, 2010, at 1:09 PM, Roy Smith wrote: I'm using httplib, and want to get the Location header from the response. The getheaders() method gives you back a list of (name, value) tuples. It would be a lot

Re: Extracting item from list of tuples?

2010-09-05 Thread Philip Semanchuk
On Sep 5, 2010, at 1:09 PM, Roy Smith wrote: I'm using httplib, and want to get the Location header from the response. The getheaders() method gives you back a list of (name, value) tuples. It would be a lot more convenient if it gave you back a dict, but it is what it is. Anyway, I came

Re: Floating numbers

2010-08-12 Thread Philip Semanchuk
On Aug 12, 2010, at 4:43 PM, Bradley Hintze wrote: Hi all. Is there a way I can keep my floating point number as I typed it? For example, I want 34.52 to be 34.52 and NOT 34.520002. Hi Bradley, Use the Decimal type instead. It's not as convenient as float, but it will give you a consis

  1   2   3   4   >