Re: Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

2015-09-22 Thread Ryan Stuart
gt; > On Tue, Sep 22, 2015 at 2:04 PM, Ryan Stuart > wrote: > >> On Thu, Sep 17, 2015 at 2:24 PM, sol433tt wrote: >> >>> I would like to have the Sqlite pragma statement "locking_mode" set to >>> "EXCLUSIVE" by default (RO database). Does thi

Re: Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

2015-09-21 Thread Ryan Stuart
ion of it being a compile time PRAGMA. Cheers > > There is some performance to be gained. I have a number of python scripts, > and don't want to alter the pragma statement for every script. This > computer never writes to the databases. > > thank you > > -- > https://mail

Re: Parser needed.

2015-06-09 Thread Ryan Stuart
tine is real nice... to get rid of fudd/white space... and > just tokens which is nice. > > So for now I will use that as my tokenizer ;) =D > > and bracket level counting and sections and stuff like that yeah... > > > Bye, > Skybuck. > -- > https://mail.python.org/mailman/listinfo/python-list > -- Ryan Stuart, B.Eng Software Engineer ABN: 81-206-082-133 W: http://www.textisbeautiful.net/ M: +61-431-299-036 -- https://mail.python.org/mailman/listinfo/python-list

Re: test2

2015-03-24 Thread Ryan Stuart
rch$', gui_search), > # (r'^delete/$', ipdb_input_delete), > (r'^api/add/$', api_add), #check sensornet urls.py and > views/sensors.py for cool tricks. > (r'^api/search/$', api_search), #check sensornet urls.py and > views/sensors.py for cool tricks. > (r'^api/file/$', api_file), > > #(r'^asset/media/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, '../asset/media')}), > > #(r'^ip_db/media/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, 'ip_db/media')}), > #(r'^media/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, 'media')}), > #(r'^static/(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/sensornet/static'}), > > # extjs4 stuff > #(r'^asset/overview/extjs/(?P.*)$', 'serve', {'document_root': > os.path.join(PROJECT_PATH, '../asset/extjs')}), > #(r'^extjs/(?P.*)$', 'django.views.static.serve', > {'document_root': os.path.join(PROJECT_PATH, '../ip_db/extjs')}), > #(r'^extjs/(?P.*)$', 'django.views.static.serve', > {'document_root': '/home/totis/tree/ipdb/django/ipdb/asset/static/extjs'}), > ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT), > 'ipdb.asset': { > 'handlers': ['console', 'logfile'], > 'level': 'DEBUG', > }, > } > } > > === > > > > -- > https://mail.python.org/mailman/listinfo/python-list > -- Ryan Stuart, B.Eng Software Engineer ABN: 81-206-082-133 W: http://www.textisbeautiful.net/ M: +61-431-299-036 -- https://mail.python.org/mailman/listinfo/python-list

Re: HELP!! How to ask a girl out with a simple witty Python code??

2015-03-04 Thread Ryan Stuart
On Thu, 5 Mar 2015 at 11:35 Xrrific wrote: > Could you please come up with something witty incorporating a simple > python line like If...then... but..etc. > Send her this: import base64 print(base64.b64decode('CkhpLCAKVGhpcyBpcyBzb21lb25lIGZyb20gdGhlIHB5dGhvbiBtYWlsaW5nIGxpc3QuIFRoaXMgZ3V5ICho

Re: Are threads bad? - was: Future of Pypy?

2015-02-24 Thread Ryan Stuart
On Tue Feb 24 2015 at 3:32:47 PM Paul Rubin wrote: > Ryan Stuart writes: > Sure, the shared memory introduces the possibility of some bad errors, > I'm just saying that I've found that by staying with a certain > straightforward style, it doesn't seem difficult i

Re: Future of Pypy?

2015-02-22 Thread Ryan Stuart
On Mon Feb 23 2015 at 4:15:42 PM Paul Rubin wrote: > > What do you mean about Queues working with processes? I meant > Queue.Queue. There is multiprocessing.Queue but that's much less > capable, and it uses cumbersome IPC like pipes or sockets instead of a > lighter weight lock. Threads can als

Re: Future of Pypy?

2015-02-22 Thread Ryan Stuart
On Mon Feb 23 2015 at 1:50:40 PM Paul Rubin wrote: > That article is about the hazards of mutable state shared between > threads. The key to using threads safely is to not do that. So the > "transfer" example in the article would instead be a message handler in > the thread holding the account

Re: Future of Pypy?

2015-02-22 Thread Ryan Stuart
On Mon Feb 23 2015 at 12:05:46 PM Paul Rubin wrote: > I don't see what the big deal is. I hear tons of horror stories about > threads and I believe them, but the thing is, they almost always revolve > around acquiring and releasing locks in the wrong order, forgetting to > lock things, stuff lik

Re: TypeError: list indices must be integers, not tuple

2015-02-10 Thread Ryan Stuart
Hi, There is a lot of issues with this code. First, setting fav to a 1 tuples with a string probably isn't what you want. What you probably mean is: if restraunt == ("Pizza"): fav = 1 Second, when you are trying to lookup items in Menu, you are using the incorrect fav. Lists have int indicie

Re: Profiler for long-running application

2015-02-09 Thread Ryan Stuart
Hi Asad, Is there any reason why you can't just use profile/cProfile? In particular, you could use the api of that module to save out the profile stats to an external file with a unique name and then inspect them later with a tool like snakeviz . The code to

Convert 3d NumPy array into 2d

2014-08-27 Thread phinn stuart
Hi everyone, how can I convert (1L, 480L, 1440L) shaped numpy array into (480L, 1440L)? Thanks in the advance. phinn -- https://mail.python.org/mailman/listinfo/python-list

Re: I look for a list to convert time zone abbreviation to full time zone in python

2013-12-03 Thread Stuart Bishop
he database is corrected). Also, to correctly represent this you need to specify the point in time. EST in 'Tue Dec 3 20:44:00 EST 2013' maps to about 3 timezones. EST in 'Tue Dec 3 20:44:00 EST 2011' maps to about 6. -- Stuart Bishop http://www.stuartbishop.net/ -- https://mail.

Re: OAuth 2.0 implementation

2012-03-27 Thread Stuart Bishop
il account') and OAuth ('post this message to your Facebook wall'). -- Stuart Bishop http://www.stuartbishop.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Applications - Separating DB Connections

2011-06-08 Thread Stuart MacKay
/en/1.0.1/api/contrib/files.html and the --config option on http://docs.fabfile.org/en/1.0.1/usage/fab.html Stuart MacKay Lisbon, Portugal Hello Everyone: I am trying to find a way to extract and remove database connection information (username, password, schema name) from the application

Re: FW: help please

2011-05-18 Thread Stuart MacKay
d to answer the question then asking the poster to phrase it better is going to help solve the issue faster but for a mailing list like this simply ignore it. Stuart -- http://mail.python.org/mailman/listinfo/python-list

Re: hmac module and key format

2011-02-21 Thread Stuart Longland
On Feb 21, 4:59 am, Peter Pearson wrote: > On Sun, 20 Feb 2011 04:01:20 -0800, Paul Rubin > wrote: > > Stuart Longland writes: > >> What format does hmac require the key to be in? > > > It's an arbitrary string.   > > >     I have a key in hexadeci

hmac module and key format

2011-02-20 Thread Stuart Longland
ould enlighten me, I'd be most grateful. Regards, Stuart Longland -- http://mail.python.org/mailman/listinfo/python-list

Re: exceptions and unicode

2010-06-19 Thread Stuart McGraw
On 06/16/2010 03:51 PM, Thomas Jollans wrote: > On 06/16/2010 10:10 PM, Stuart McGraw wrote: >> Note that the exceptions may be anything (I just used IOError >> as an example) and are generated in bowels of an API that I >> can't/won't mess with. > > Yeah, w

Re: exceptions and unicode

2010-06-19 Thread Stuart McGraw
On 06/16/2010 03:53 PM, Martin v. Loewis wrote: >> So how do I get what I want? > > Submit a patch. You would have to explain why this is a bug fix and not > a new feature, as new features are not allowed anymore for 2.x. Thanks. Actually I have no idea if this is a bug or a feature (despite r

exceptions and unicode

2010-06-16 Thread Stuart McGraw
I am having a problem with exceptions and unicode. try: open ('file.txt') except IOError, e: pass str (e) => "[Errno 2] No such file or directory: 'file.txt'" which is fine but... try: open (u'フィイル.txt') except IOError, e: pass str (e) => "[Errno 2] No such file or directory: u'\

Re: Python books, literature etc

2010-01-07 Thread Stuart Murray-Smith
> Have a look at the Getting Started section of the wiki: > > http://wiki.python.org/moin/ > > specially the PythonBooks section Perfect! Exactly what I'm looking for :) Thanks Gabriel! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python books, literature etc

2010-01-07 Thread Stuart Murray-Smith
2010/1/6 J : > A good point was brought up to me privately, and I agree completely, > that the OP should re-state the request with a bit more specifics... > > Since the OP says he is at least familiar with Python, does he need > info on beginner level books that are general purpose, or is he > inte

Python books, literature etc

2010-01-06 Thread Stuart Murray-Smith
Greetings list I can code in Python (strong beginner), and would like to read more books and/or online resources. Could someone please point out any good books, websites, tutorials etc to help me get to the next level. Your help && insight highly appreciated :) Stuart

Re: PYTHONPATH issue with sibling package names

2009-09-10 Thread Stuart Moffatt
On Sep 10, 10:12 am, "Diez B. Roggisch" wrote: > Stuart Moffatt wrote: > > Environment: Eclipse 3.4.2, Windows XP Pro SP2, Pydev 1.4.4, python > > 2.6 > > > When I work in eclipse with java, I like to break up my client and > > server packages, like this

PYTHONPATH issue with sibling package names

2009-09-10 Thread Stuart Moffatt
Environment: Eclipse 3.4.2, Windows XP Pro SP2, Pydev 1.4.4, python 2.6 When I work in eclipse with java, I like to break up my client and server packages, like this: client-project/src/org/me/client server-project/src/org/me/api server-project/src/org/me/dao server-project/src/org/me/entity ser

Re: How to create a virtual serial port?

2009-04-12 Thread Stuart Davenport
On Apr 11, 6:56 pm, Grant Edwards wrote: > On 2009-04-11, Grant Edwards wrote: > > > You can write a port redirector in user-space in MS-Windows, > > but you can't in Linux/Unix.  On Unix systems you have to > > write a kernel module that sits below the tty layer. > > Perhaps I should elucidate f

Re: How to create a virtual serial port?

2009-04-11 Thread Stuart Davenport
On 11 Apr, 08:52, Scott David Daniels wrote: > Stuart Davenport wrote: > > ... I'm on a OS X, python 2.5. Basically I will have a remote application > > pushing data (GPS) over the network to a python application I have > > running on my Mac, I want this python app

Re: How to create a virtual serial port?

2009-04-10 Thread Stuart Davenport
On 10 Apr, 20:45, Scott David Daniels wrote: > Stuart Davenport wrote: > > Hi, > > > I am trying to work out if its possible, to create a virtual serial > > port with Python? Would anyone know how to go about this in code? Any > > help would be greatly appreciated!

How to create a virtual serial port?

2009-04-10 Thread Stuart Davenport
Hi, I am trying to work out if its possible, to create a virtual serial port with Python? Would anyone know how to go about this in code? Any help would be greatly appreciated! :) I have a had a google and the topics returned only seem to reflect "reading" serial port data, particularly pySerial

Re: HTTPError... read the response body?

2009-03-03 Thread Stuart Davenport
On Mar 2, 11:50 pm, Wojtek Walczak wrote: > On Mon, 2 Mar 2009 14:29:12 -0800 (PST), Stuart Davenport wrote: > > Hi, > > > I am trying to connect to a web service but I am getting HTTP 400, I > > am not too concerned about the HTTP error - but what I'd like to know

HTTPError... read the response body?

2009-03-02 Thread Stuart Davenport
Hi There, I am trying to connect to a web service but I am getting HTTP 400, I am not too concerned about the HTTP error - but what I'd like to know if there is anyway I can read the response body in the HTTP 400 or 500 case? Does the HTTPError allow this? or the urllib2 in anyway? This is what I

Installing python 2.6 on Vista

2008-11-23 Thread GALLOWAY Stuart J (SVHM)
, Stuart Disclaimer : The contents of this e-mail including any attachments are intended only for the person or entity to which this e-mail is addressed and may contain confidential, privileged and/or commercially sensitive material. If you are not, or believe you may not be, the intended

Re: PyRun_String using my module in a def

2007-07-04 Thread Stuart
but now it just says "name 'execfile' is not defined" Thanks for your help! :) On Jul 4, 10:23 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > Stuart <[EMAIL PROTECTED]> wrote: > >... > > > PyObject *rstring = PyRun_String( cmd, Py_file_input, main_di

need a variation algorithm for Lists in Dictionaries

2007-07-04 Thread Marc Stuart
Hi, I am trying to create a function, where I pass a dictionary with a lits of strings, and try to return a a list of strings, for all variations, any ideas ? Thanks def getAllVariants(someDict): keys = someDict.keys() for x in keys: print len(someDict[x])

PyRun_String using my module in a def

2007-07-04 Thread Stuart
I've written my own python modules with the C API, called dlfl. I've now embedded a python interpreter into my Qt application. I am able to execute multiline/singleline blocks and it has no problems remembering definitions from one execute to the next. The problem arises when i try and use a dlfl m

Re: pydoc with METH_VARGS

2007-06-24 Thread Stuart
I'm asking if there's some sort of commenting or input file or something to customize the output pydoc generates. Thanks. On Jun 23, 11:00 pm, 7stud <[EMAIL PROTECTED]> wrote: > On Jun 23, 2:13 pm, Stuart <[EMAIL PROTECTED]> wrote: > > > With my Python

pydoc with METH_VARGS

2007-06-23 Thread Stuart
With my Python extension module all the function definitions are with METH_VARGS. The result being that pydoc, just puts "(...)" for the argument list. Can I hand edit this to put the specific variable names I want? With optional arguments in brackets or something? Thanks. -- http://mail.python.

RE: Readline()

2007-03-16 Thread Taylor, Stuart
ime < currentTime: print "timed out" sys.stdout.flush() break time.sleep(1) From: Taylor, Stuart [mailto:[EMAIL PROTECTED] Sent: 13 March 2007 09:50 To: Sick Monkey; Taylor, Stuart Cc:

RE: Readline()

2007-03-13 Thread Taylor, Stuart
_ From: Sick Monkey [mailto:[EMAIL PROTECTED] Sent: 13 March 2007 01:51 To: Taylor, Stuart Cc: python-list@python.org Subject: Re: Readline() Maybe if you show us your code we can better assist you. But maybe you can use a global variable or a try-catch method to keep threads fr

Readline()

2007-03-12 Thread Taylor, Stuart
e can point me in the correct implementation of this problem I would be gratefull. Thank you Stuart -- http://mail.python.org/mailman/listinfo/python-list

Re: pytz2007c error

2007-03-06 Thread Stuart Bishop
is function. Is this a problem from Windows ? Looks like it. I've opened a bug. https://bugs.beta.launchpad.net/pytz/+bug/90096 Current workaround is to use an earlier release. This will be fixed as pytz needs to remain cross platform. -- Stuart Bishop <[EMAIL PROTECTED]> http

Re: Is Python Right for Me?

2007-02-03 Thread Stuart D. Gathman
/ http://www.livewires.org.uk/python/pdfsheets.html As an adult, just skip rapidly through the elementary material. The final module (Games sheets) walks you through creating 3 2D games with pygame! -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Ph

Re: Vim scripting with python

2007-02-03 Thread Stuart D. Gathman
unction() > python << EOF > import vim, string > ...blablabla > EOF > endfunction > > but I would like to use external ".py" files. :py import myfile Use :py inside your vimrc - don't run python externally. -- Stuart D. Gathman <[EMAIL PR

Re: Debugging SocketServer.ThreadingTCPServer

2007-02-03 Thread Stuart D. Gathman
On Tue, 16 Jan 2007 09:11:38 -0500, Jean-Paul Calderone wrote: > On Tue, 16 Jan 2007 00:23:35 -0500, "Stuart D. Gathman" > <[EMAIL PROTECTED]> wrote: >>I have a ThreadingTCPServer application (pygossip, part of >>http://sourceforge.net/projects/pymilter). It mo

doctest problem with null byte

2007-01-25 Thread Stuart D. Gathman
doctest does *not* like the null byte in the example (yes, this happens with real life input): ** File "/home/stuart/pyspf/spf.py", line 1453, in spf.quote_value Failed example: quote_value('-all') Excepti

Re: Best way to document Python code...

2007-01-22 Thread Stuart D. Gathman
On Mon, 22 Jan 2007 17:35:18 -0500, Stuart D. Gathman wrote: > The HTML generated by pydoc doesn't link to standard modules properly. > They are generated as relative links. So it can't be used without > modification for generating docs for a web page about a python

Re: Best way to document Python code...

2007-01-22 Thread Stuart D. Gathman
about a python package. I'm struggling with the same issue. Coding Python is so much easier than Java. However documenting Java is so much easier than Python. Just include doc comments, run javadoc, and voila! -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management

Debugging SocketServer.ThreadingTCPServer

2007-01-15 Thread Stuart D. Gathman
get a thread dump? If needed, I can import pdb and set options at startup, but there needs to be some external way of triggering the dump since I can't reproduce it at will. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 F

Re: I'm looking for a pythonic red-black tree...

2006-12-16 Thread Stuart D. Gathman
d seriously consider trying to modify Python to replace the built-in dict with a skip-list algorithm and compare the performance. Failing that, an extension module implementing a sorted container of some description would be useful. -- Stuart D. Gathman <[EMAIL PROTECTED]> B

Package vs. module

2006-12-16 Thread Stuart D. Gathman
etpass 2) package that cannot be run directly from command line 3) single file module with associated driver package is the most pythonic? -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledi

Re: Automatic debugging of copy by reference errors?

2006-12-09 Thread Stuart D. Gathman
r than copied. I'm not sure it's worth turning python into fortran - even for selected namespaces. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis&qu

Re: Driver selection

2006-12-09 Thread Stuart D. Gathman
On Fri, 08 Dec 2006 21:35:41 -0800, Gabriel Genellina wrote: > On 9 dic, 00:53, "Stuart D. Gathman" <[EMAIL PROTECTED]> wrote: >> Or you can modify the source to "from drivermodule import DNSLookup". >> >> What is the friendliest way to make this c

Driver selection

2006-12-08 Thread Stuart D. Gathman
r run time. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis" - background song for a Microsoft sponsored "Where do you want to go from here?" commercial.

Re: NFS server

2006-11-27 Thread Stuart D. Gathman
, apparently python was used for quickly building test rigs while developing NFS v4. Having a framework for python NFS server could be useful - think custom filesystem. Although a python binding for fuse + C NFS server would be more general (use locally as well as remotely). -- Stua

File upload from client application (non-form based upload)

2006-11-22 Thread stuart
ntents("php://input"); fwrite($file_handle, $mydata); fclose($file_handle); What I need is a Python equivalent of the the above PHP script. The content-type in the POST header is currently set to "application/octet-stream" which works fine with the php code above. Any help, advise,

Re: psycopg2 faster way to retrieve last x records

2006-11-07 Thread Stuart Bishop
ly need the results in tempounix order, then: SELECT * FROM ( SELECT * FROM seconds ORDER BY tempounix DESC LIMIT 200 ) AS whatever ORDER BY tempounix; -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: does raw_input() return unicode?

2006-10-10 Thread Stuart McGraw
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Stuart McGraw schrieb: > > So, does raw_input() ever return unicode objects and if > > so, under what conditions? > > At the moment, it only returns unicode objects when invoked

does raw_input() return unicode?

2006-10-09 Thread Stuart McGraw
In the announcement for Python-2.3 http://groups.google.com/group/comp.lang.python/msg/287e94d9fe25388d?hl=en it says "raw_input(): can now return Unicode objects". But I didn't see anything about this in Andrew Kuchling's "2.3 What's New", nor does the current python docs for raw_input() say an

Re: does anybody earn a living programming in python?

2006-09-27 Thread Stuart Bishop
me. It indicated a level of care and pride about their profession rather than someone who just treated cutting code as a day job. That might be changing now that Python is becoming more visible on peoples radar. -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: PostgreSQL, psycopg2 and OID-less tables

2006-09-27 Thread Stuart Bishop
e and column name don't contain odd characters like = or ' or ., in which case you need to properly quote them). The reason it is better is that in odd cases the sequence name will not always be %(tableid)s_%(columnid)s_seq, such as after you have renamed a table. -- Stuart Bishop <

Re: A critique of cgi.escape

2006-09-27 Thread Stuart Bishop
here are better approaches than making non-backwards compatible changes to functions people have been relying on since Python 1.5. -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: elementtree: line numbers and iterparse

2006-09-12 Thread Stuart McGraw
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Stuart McGraw wrote: > > Now I find i need to get and save the input file line > > number of each node. Googling turned up a way > > to do it by subclassing FancyTreeBuilder

elementtree: line numbers and iterparse

2006-09-12 Thread Stuart McGraw
I have a broad (~200K nodes) but shallow xml file I want to parse with Elementtree. There are too many nodes to read into memory simultaneously so I use iterparse() to process each node sequentially. Now I find i need to get and save the input file line number of each node. Googling turned up

Re: smtplib timeout

2006-07-25 Thread Stuart D. Gathman
On Tue, 25 Jul 2006 09:21:40 -0700, Alan Kennedy wrote: > [Stuart D. Gathman] >> I need to set a timelimit for the operation of >> smtplib.sendmail. It has to be thread based, because pymilter uses >> libmilter which is thread based. > > Have you tried setting a de

smtplib timeout

2006-07-25 Thread Stuart D. Gathman
nice timeout exception, the thread running the function continues to run. In fact, the problem is worse, because even more threads are created. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis ma

Re: Help beautify ugly heuristic code

2006-07-24 Thread Stuart D. Gathman
uld it handle ip bytes that are the same: 1.2.2.2 Mitja has proposed a scoring system reminiscent of SpamAssassin. This gives me a few things to try. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Conf

Retrieve a GIF's palette entries using Python Imaging Library (PIL)

2006-01-13 Thread Stuart
I am using the Python Imaging Library (PIL) to process GIF images. I need to be able to retrieve the RGB values for each color palette entry. I see that the 'Image' class has a 'palette' attribute which returns an object of type 'ImagePalette'. However, the documentation is a bit lacking regar

Re: Encoding sniffer?

2006-01-11 Thread Stuart Bishop
(s, 'ISO-8859-15') except UnicodeDecodeError: pass Feel free to update your available code. Otherwise, I can probably post ours somewhere if necessary. -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: How login & download file from remote web site? Passwords a problem?

2006-01-09 Thread Stuart Turner
s must tell *my* software their > password. > > Is there a wise way to solve this or avoid this can of worms? > > Chris Chris, As a suggestion, why not look at the urllib and getpass modules. If you get stuck, mail me and I'll send you over some sample code, - Stuart -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Stuart D. Gathman
al iterator */ for (_idx = 0; _idx < NLST; ++_idx) { int *i = lst[_idx]; if (*i == *_i2) i = &_i4; } for (_idx = 0; _idx < NLST; ++_idx) printf("%d\n",*lst[_idx]); -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc.

Re: inline function call

2006-01-04 Thread Stuart D. Gathman
to specialize only those functions that need it after profiling your application. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis" - background song for a Microsoft

Re: Spiritual Programming (OT, but Python-inspired)

2006-01-03 Thread Stuart D. Gathman
On Mon, 02 Jan 2006 19:05:04 -0500, Steven D'Aprano wrote: > I don't dare ask where your evidence for this hypothesis is, but I will > ask what are your reasons for imagining this? What is the chain of > thought that leads from: > > Step 1: We live in a temporal world. > > to: > > Step N: Our

Re: sorting with expensive compares?

2005-12-28 Thread Stuart D. Gathman
lision pairs of MP3 files where one member carries a freely redistributable license, and the other a "copy this and we'll sue your ass off" license in an effort to trap the unwary. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 5

Re: bizarre id() results

2005-12-15 Thread Stuart McGraw
"Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] and several other people responded with similar information. [...] Bound methods are created on the fly. [...] Ahhh! That was the piece I was missing. Thank you all! -- http://mail.python.org/mailman/listinf

bizarre id() results

2005-12-15 Thread Stuart McGraw
The following was cut and pasted exactly (except for the # lines which I added after the fact) from an interactive python session in a Window 2000 cmd.exe window. Can somebody please explain to me what the heck is going on?!?! Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (I

Re: Why are there no ordered dictionaries?

2005-11-22 Thread Stuart McGraw
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Stuart McGraw wrote > > > > What would improve the Cheese Shop's interface for you? > > > > Getting rid of those damn top level links to old versions. > > Seeing

Re: Why are there no ordered dictionaries?

2005-11-22 Thread Stuart McGraw
"A.M. Kuchling" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] [...] > What would improve the Cheese Shop's interface for you? Getting rid of those damn top level links to old versions. Seeing a long list of old versions, when 99% of visitors are only interested in the current vers

Re: Python Book

2005-11-13 Thread Stuart McGraw
"Stuart McGraw" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > David Beasley's Essential Python (New Riders). It's a little dated > now (covers only up to version 2.2) [...] Oops, that should be "Beazley", "Python Ess

Re: Python Book

2005-11-13 Thread Stuart McGraw
David Beasley's Essential Python (New Riders). It's a little dated now (covers only up to version 2.2) but lucid, consise, well organized. It restricts itself to Python's syntax and semantics and does not waste time explaining basic programming concepts. I made several attempts to learn Python bu

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Stuart Turner
Thanks to Everyone for replying - it has given me much food for thought. - Stuart Stuart Turner wrote: > Hi Everyone, > > I'm working hard trying to get Python 'accepted' in the organisation I > work > for. I'm making some good in-roads. One chap sent

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Stuart Turner
I'm already using it for a ton of things - I want to try and get broader acceptance in the organisation for it to be made and 'officially supported product'. Stefan Arentz wrote: > Stuart Turner <[EMAIL PROTECTED]> writes: > >> Hi Everyone, >> &

Getting Python Accepted in my Organisation

2005-11-03 Thread Stuart Turner
ad been in a similar position. Any help appreciated, Thanks in advance, - Stuart "Python is a scripting language like Perl, awk, tcl, Java etc...  it is not quite a fully developed OO language, but does support some OO that Perl doesn't.  To be clear, these scripting languages have

Re: wxpython - passing arg to wx.app OnInit

2005-10-23 Thread Stuart McGraw
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Stuart McGraw wrote: > > I have a wxPython app, conventionally structured > > with a Application class derived from wx.App. > > My problem is that the app accepts a command >

wxpython - passing arg to wx.app OnInit

2005-10-22 Thread Stuart McGraw
I have a wxPython app, conventionally structured with a Application class derived from wx.App. My problem is that the app accepts a command line argument that must be acted upon within the OnInit() method of the Application class. How do I pass it cleanly from main() into app.OnInit()? In the si

Re: Postgres PL/Python

2005-09-15 Thread Stuart Bishop
that talks to the internal database APIs you are still stuck with just the equivalent of 'print' as your toolkit. -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: how to write thread-safe module ? and pytz

2005-08-13 Thread Stuart Bishop
gt;> for t in threads: t.start() ... Exception in thread Thread-249: Traceback (most recent call last): File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap self.run() File "/usr/lib/python2.4/threading.py", line 422, in run self.__target(*self.__args, **self.__kwargs) File "", line 5, in doit IndexError: list assignment index out of range -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/ signature.asc Description: OpenPGP digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Python-Excel: How to paste selected cells (range) to different location on the same sheet in Excel

2005-08-09 Thread Stuart Corrie
Did you use the excel macro recorder and look at the results to help you write that program? It seems to bear all the hallmarks of code generated that way. The macro recorder can be great, but almost always it is possible to speed up code by altering it afterwards, to condense and speed up the

Re: Ideas for Python project?

2005-08-03 Thread Stuart Turner
adventurous I could build a GUI for it. > > I have just bought the Foundations of Python Network Programming book, > so maybe something network related would be good? > > Cheers > Jon I saw a competition in Linux format - may be something to consider. - Stuart -- http://mail.python.org/mailman/listinfo/python-list

Re: Friend wants to learn python

2005-07-28 Thread Stuart Turner
tion of 'Python in a Nutshell, Python Cookbook and whatever I could find on the web' I also find giving yourself a *real* programming task makes you learn a lot quicker! - Stuart -- http://mail.python.org/mailman/listinfo/python-list

Tix example code?

2005-07-13 Thread Stuart McGraw
I am having trouble trying to figure out how to use Tix widgets in a Python program. The documentation is scanty and in TCL syntax with no examples. Specifically, I'm trying to use a Tix ComboBox widget and haven't been able to figure out how to initialize the set of values in the widget's lis

Re: DB API 2.0 and transactions

2005-06-16 Thread Stuart Bishop
pygresql.org/cvsweb.cgi/pygresql/module/pgdb.py?rev=1.27 fwiw psycopg 1.1.18 has the correct behavior (as usual). I can add this test to the DB-API 2.0 Anal Compliance Test Suite if we want, although it sounds like it is only an issue with PostgreSQL drivers. - -- Stuart Bishop <[EMAIL P

Re: Memory Usage

2005-01-24 Thread Stuart McGarrity
Do you have a page file? The Mem column should be RAM usage and not total working set. Some of it could be swapped to the page file. A free tool like process explorer can give you better informaton than the task manager. "rbt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Would

Re: Tabnanny really useful?

2004-12-23 Thread Stuart Bishop
will totally confuse someone with their editor misconfigured with 4 char tabs? - -- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/ -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFByp4nAfqZj7rGN0oRAoq9AJ4scAe0A3aFnx7jRZuqtRXXaxAcRgCfYkVf FbH2HBFA4/44KgZfpiPu

Re: Help beautify ugly heuristic code

2004-12-10 Thread Stuart D. Gathman
On Fri, 10 Dec 2004 22:03:20 +, JanC wrote: > Stuart D. Gathman schreef: > >> I have a function that recognizes PTR records for dynamic IPs. There > Did you also think about ISPs that use such a PTR record for both dynamic > and fixed IPs? There seems to be a lot o

Re: Help beautify ugly heuristic code

2004-12-10 Thread Stuart D. Gathman
That gives me a few things to try. -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154 "Confutatis maledictis, flamis acribus addictis" - background song for a Microsoft sponsored "Where do you want t

Re: Creating Fixed Length Records

2004-12-08 Thread Stuart D. Gathman
x27;8s6s2s' >>> v = ('foo','bar','AA') >>> struct.pack(fmt,*v) 'foo\x00\x00\x00\x00\x00bar\x00\x00\x00AA' -- Stuart D. Gathman <[EMAIL PROTECTED]> Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-

Re: Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 19:52:53 -0500, Lonnie Princehouse wrote: > I don't think a Bayesian classifier is going to be very helpful here, > unless you have tens of thousands of examples to feed it, or unless it We do have tens of thousands of examples to feed it. > The series of if host.find(...) li

Re: Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 18:39:15 -0500, Lonnie Princehouse wrote: > Regular expressions. > > It takes a while to craft the expressions, but this will be more > elegant, more extensible, and considerably faster to compute (matching > compiled re's is fast). I'm already doing that with the rehmac rege

Re: Help beautify ugly heuristic code

2004-12-08 Thread Stuart D. Gathman
On Wed, 08 Dec 2004 18:00:06 -0500, Mitja wrote: > On Wed, 08 Dec 2004 16:09:43 -0500, Stuart D. Gathman <[EMAIL PROTECTED]> > wrote: > >> I have a function that recognizes PTR records for dynamic IPs Here >> is the very ugly code so far. >> ... >

  1   2   >