Re: Python 2.7 released

2010-07-07 Thread imageguy
> I, too, have multiple versions installed -- newer ones for running code > I haven't upgraded; older ones for compatibility testing where needed. > I just install to the default c:\pythonxy directories (although I like > the idea of a common root) and I put NTFS hardlinks into my general > c:\too

Re: Moving from PHP to Python. Is it Possible

2009-12-11 Thread imageguy
> So My question is. > For example I had this kind of python file and we want to use this as plugin > template > >   >   <% >   for n in range(3): >       # This indent will persist >   %> >   This paragraph will be >   repeated 3 times. >   <% >   # This line will cause the block to end >   %> >

Inheritance and Design Question

2009-05-27 Thread imageguy
I have an object the I would like to use as a base class. Some of the methods I would like to override completely, but others I would simply like to call the base class method and use the return value in the child method. The purpose here is to eliminate the duplication of valuable code in the pa

Re: Killing threads

2009-04-05 Thread imageguy
> For more info, see the slides from my thread > tutorial:http://pythoncraft.com/OSCON2001/ > -- > Aahz (a...@pythoncraft.com)           <*>        http://www.pythoncraft.com/ > Aahz, thanks for this reference and link to your presentation. At the risk of highjacking the OP's question, I am bit

Re: Killing threads

2009-04-05 Thread imageguy
On Apr 4, 10:43 pm, ericwoodwo...@gmail.com wrote: > Hi, >      I'm new to python and even newer to threading and it seems as > though I'm missing something fundamental about threads.  Basically I > have a program that looks like this: > > class ThreadOne(threading.Thread): >      while 1: >      

Re: split problem if the delimiter is inside the text limiter

2009-03-18 Thread imageguy
> You have to know the original encoding (I mean, the one used for the csv > file), else there's nothing you can do. Then it's just a matter of > decoding (to unicode) then encoding (to utf8), ie (if your source is in > latin1): > > utf_string = latin1_string.decode("latin1").encode("utf8") The O

Re: Restructure dictionary (Python 2.5)

2009-03-02 Thread imageguy
> ... this is a crappy solution that's underusing Python. Please > enlighten me of a better way! > > - Fencer One thing that springs to mind is using the dict method .setdefault for dkey, vallist in old_dict.iteritems(): for val in vallist: new_dict.setdefault(val, set()).add(dkey)

Re: access to MS Access password-protected database?

2009-02-11 Thread imageguy
On Feb 11, 10:43 am, Ken McDonald wrote: > Can anyone direct me towards a code snippet showing how to use Python   > to insert data into a password-protected MS Access database? My google   > searches have been uninformative for dbs that are password-protected. > > Thanks, > Ken You post is a lit

Re: kinterbasdb + firebird 1.5 with python 2.6 ?

2009-02-03 Thread imageguy
On Feb 3, 2:32 pm, Laszlo Nagy wrote: > Does anyone know how to get firebird 1.5 driver (kinterbasdb) for > FireBird 1.5? > > My problem: > >     * python 2.6 already installed on a server >     * there is a firebird 1.5 database on the same server >     * I need to access it from python 2.6 > > A

Re: DrPython and py2exe

2009-01-23 Thread imageguy
But the irritating thing is that DOS window stays open until > particular instance of DrPython isn't closed. This is a relatively simple fix I think. You can change the extension of the drPython.py to drpython.pyw and the python windows executable (pythonw.exe) will launch the program instead o

Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-13 Thread imageguy
On Jan 13, 1:01 am, Miles wrote: > On Tue, Jan 13, 2009 at 12:02 AM, imageguy wrote: > > Using py2.5.4 and entering the following lines in IDLE, I don't really > > understand why I get the result shown in line 8. > > > Note the difference between lines 7 and 10 is

Re: Ternary operator and tuple unpacking -- What am I missing ?

2009-01-12 Thread imageguy
> understand why I get the result shown in line 8. >7) >>> c,d = n if n is not None else 0,0 >8) >>> print c,d >9) (22, 11) 0 OOPS sorry that should be line 9. g. -- http://mail.python.org/mailman/listinfo/python-list

Ternary operator and tuple unpacking -- What am I missing ?

2009-01-12 Thread imageguy
Using py2.5.4 and entering the following lines in IDLE, I don't really understand why I get the result shown in line 8. Note the difference between lines 7 and 10 is that 'else' clause result enclosed in brackets, however, in line 2, both the 'c,d' variables are assign correctly without the bracke

Re: Reverse order of bit in repeating seqence of byte string

2009-01-03 Thread imageguy
On Jan 2, 7:33 pm, John Machin wrote: > For some very strange definition of "works". You say you have 'bgr' > and want to convert it to 'rbg'. The following code converts 'bgr' to > 'rgb', which is somewhat more plausible, but not what you said you > wanted. Well that's embarrassing ... you are

Reverse order of bit in repeating seqence of byte string

2009-01-02 Thread imageguy
I am looking for the most efficient method of replacing a repeating sequence in a byte string returned from a imaging .dll, connected via I receive the byte string with the following sequence 'bgrbgrbgrbgr' and I would like to convert this to 'rbgrbgrbgrbg' FWIW, the string is created using ctypes

Re: something else instead of PIL?

2008-12-18 Thread imageguy
On Dec 17, 3:48 pm, Reimar Bauer wrote: > Hi > > what has happened to PIL? No updates since two years. > > Or does one know an alternative lib for resizing images? > > cheers > Reimar I have found the FreeImage library with the Python bindings quite workable. I work with multi-page TIF images and

Re: dBase III files and Visual Foxpro 6 files

2008-12-09 Thread imageguy
On Dec 8, 2:53 am, Ethan Furman <[EMAIL PROTECTED]> wrote: > Greetings All! > > I nearly have support complete for dBase III dbf/dbt files -- just > wrapping up support for dates.  The null value has been a hindrance for > awhile but I nearly have that solved as well. > > For any who know of a cool

Re: Executing a hidden/background program

2008-11-03 Thread imageguy
On Nov 2, 6:32 am, [EMAIL PROTECTED] wrote: > On Nov 2, 3:59 am, "Mike Driscoll" <[EMAIL PROTECTED]> wrote: > > > You probably want to create a Windows service with Python. There are > > various ways to accomplish this. > > Was considering a Windows service too, however would like to avoid > that a

Re: String to hexadecimal conversion

2008-09-12 Thread imageguy
On Sep 8, 5:05 am, Praveena P <[EMAIL PROTECTED]> wrote: > Hi folks, > > I am new to Python... so am not too sure about how the type conversion > works. > > I have to read a file that contains hexadecimal data and use the data > further to do some arithmetic calculations. > A sample of the input is

Examples using msilib to build windows installers

2008-04-03 Thread imageguy
I have been using InnoSetup to distribute my wxpython app and ir works great, howver, I would like to offer a *.msi installer to customers as an option and this isn't available using Innosetup. It would appear to me that the msilib library included with standard python 2.5 would allow be to do thi

distutils setup - changing the location in site-packages

2008-02-21 Thread imageguy
I am hoping if someone can set me straight. I have created a setup script for a module, however, when running the install on my own machine, I would like to place the module in a specific site-packages directory/package. So if I start with a module in .\dev\mygreatmodule.py I want to end up

Re: Removal of element from list while traversing causes the next element to be skipped

2008-01-29 Thread imageguy
On Jan 29, 12:34 pm, William McBrine <[EMAIL PROTECTED]> wrote: > Look at this -- from Python 2.5.1: > > >>> a = [1, 2, 3, 4, 5] > >>> for x in a: > > ...     if x == 3: > ...         a.remove(x) > ...     print x > ... > 1 > 2 > 3 > 5 > > >>> a > [1, 2, 4, 5] > > Sure, the resulting list is correc

Re: py2exe - change name of exe created

2007-09-07 Thread imageguy
On Sep 7, 11:22 am, Thomas Heller <[EMAIL PROTECTED]> wrote: > imageguy schrieb: > > > > > > > Sorry for the double post, sent it to quickly. > > > I have a setup script like this; > > > setup(windows = [{"script":"myprogra

application version checking against database

2007-09-07 Thread imageguy
We are trying to implement a system that checks the version of the application against a version number stored in the database. We don't want the app and the db don't become out of sync. We have tried setting a __version__ variable in the top most module, however, it seems that this is not access

Re: py2exe - change name of exe created

2007-09-07 Thread imageguy
Sorry for the double post, sent it to quickly. I have a setup script like this; setup(windows = [{"script":"myprogram.py", "icon_resources":[(0,"nabbitt.ico")], "other_resources": [(24,1,manifest)]} ], name = "My Program ver 0.1",

py2exe - change name of exe created

2007-09-07 Thread imageguy
I have a setup script like this; setup(windows = [{"script":"myprogram.py", "icon_resources":[(0,"nabbitt.ico")], "other_resources": [(24,1,manifest)]} ], name = "Nabbitt ver 0.1", data_files = [("",rootdata)],

py2exe - change name of exe created

2007-09-07 Thread imageguy
I have a setup script like this; setup(windows = [{"script":"myprogram.py", "icon_resources":[(0,"nabbitt.ico")], "other_resources": [(24,1,manifest)]} ], name = "Nabbitt ver 0.1", data_files = [("",rootdata)],

Re: Open HTML file in IE

2007-07-19 Thread imageguy
On Jul 18, 3:20 am, gravey <[EMAIL PROTECTED]> wrote: > Hello. > > Apologies if this is a basic question, but I want to open a HTML > file from my local drive (is generated by another Python script) > in Internet Explorer. I've had a look at the webbrowser module and > this doesn't seem to be what

Re: msbin to ieee

2007-05-10 Thread imageguy
On May 6, 6:44 pm, revuesbio <[EMAIL PROTECTED]> wrote: > Hi > Does anyone have the python version of the conversion from msbin to > ieee? > Thank u Not sure if this helps, but I think this thread has the answer; http://groups.google.com/group/comp.lang.python/browse_thread/thread/286d9f6daff9bfab

Re: Rendering text question (context is MSWin UI Automation)

2007-01-23 Thread imageguy
> I am trying to use UI Automation to drive an MS Windows app (with pywinauto). > > I need to scrape the app's window contents and use some form of OCR to get at > the texts (pywinauto can't get at them). > > As an alternative to integrating an OCR engine, and since I know the fonts and > sizes use