RE: removing text string

2008-09-10 Thread Adam Pletcher
You just want to drop the last two characters? Slice it. >>> s = "080829-7_A"[:-2] >>> print s 080829-7 - Adam > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Ahmed, Shakir > Sent: Wednesday, September 10, 2008 10:22 AM > To: python-list@python.

RE: installing on vista

2008-02-16 Thread Adam Pletcher
I have Python 2.5 and win32 extensions on Vista at work, no problems. I have to ask the obvious question... did you download the right win32 installer? There's different ones for Python 2.4 vs. 2.5, etc. - Adam From: [EMAIL PROTECTED] on behalf of [EMAIL PRO

RE: Running files with the associated program...

2008-02-05 Thread Adam Pletcher
import subprocess proc = subprocess.Popen(r'C:\example.bmp', shell=True) - Adam From: [EMAIL PROTECTED] on behalf of E-Lo Sent: Tue 2/5/2008 6:34 PM To: python-list@python.org Subject: Running files with the associated program... Hello all, How can I start a

RE: python for game programming

2008-02-03 Thread Adam Pletcher
02_game_scripting_in_python.php <http://www.gamasutra.com/view/feature/2963/gdc_2002_game_scripting_in_python.php> -- Adam Pletcher Technical Art Director Volition/THQ www.volition-inc.com From: [EMAIL PROTECTED] on behalf of t3chn0n3rd Sent: Sun 2/3/20

RE: formated local time

2007-11-15 Thread Adam Pletcher
datetime also has the strftime method: import datetime datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') - Adam > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of [EMAIL PROTECTED] > Sent: Thursday, November 15, 2007 9:56 AM > To: python-list@py

RE: current script path via execfile?

2007-11-14 Thread Adam Pletcher
? > > En Tue, 13 Nov 2007 13:42:04 -0300, Adam Pletcher <[EMAIL PROTECTED] > inc.com> > escribió: > > > I have an app with an embedded Python interpreter. In that > interpreter, > > I want to use "execfile" (or something similar) to execute a script >

RE: Creating Installer or Executable in Python

2007-11-14 Thread Adam Pletcher
I'd second InnoSetup for Windows installers, it's easy and powerful (and free). However, I don't think it can create actual .MSI files, only .EXE installers. I wish it would create .MSIs, since those are easier to automatically deploy for large user groups. I'm not aware of any free tools for bu

current script path via execfile?

2007-11-13 Thread Adam Pletcher
I have an app with an embedded Python interpreter. In that interpreter, I want to use "execfile" (or something similar) to execute a script from disk. The script needs to somehow acquire the full path to itself, but I can't work out how to do this. Since it's run with execfile in the embedded

RE: crawler in python and mysql

2007-11-12 Thread Adam Pletcher
ified site locally. Including images, but you could probably limit it to HTML easily enough. I haven't used either extensively, but they appear to work as advertised. It should be easy to modify one and tie it into the MySQLdb extensions: http://sourceforge.net/projects/mysql-pyth

RE: Extended date and time

2007-11-11 Thread Adam Pletcher
The "time" module in the standard library does epoch, and conversions. Get current local time in seconds since epoch (1970): >>> import time >>> now_secs = time.time() >>> print now_secs 1194790069.33 Convert to a struct_time object for conversions: >>> now_struct = time.localtime(now_secs)

RE: howto kill a windows process by name ?

2007-10-05 Thread Adam Pletcher
Take a look at "killProcName.py", in the win32 extension package. - Adam > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of stef mientki > Sent: Friday, October 05, 2007 4:40 PM > To: python-list@python.org > Subject: howto kill a windows process by

RE: Time A Script

2007-07-11 Thread Adam Pletcher
Try: --- import time start_time = time.time() run_time = time.time() - start_time print 'Run time: %f seconds' % run_time --- Also have a look at the timeit module for more timing functionality. - Adam From: [EMAIL PROTECTED] [mailto:[EMAIL PROT

RE: Writing TGA image files?

2007-06-29 Thread Adam Pletcher
Sorry, I was replying via the email list and didn't realize it would thread that way. - Adam From: [EMAIL PROTECTED] on behalf of Ben Finney Sent: Fri 6/29/2007 2:55 AM To: python-list@python.org Subject: Re: Writing TGA image files? "Adam Pletche

Writing TGA image files?

2007-06-28 Thread Adam Pletcher
Does anyone have Python code for writing Targa (TGA) image files? Ideally, with options for bit-depth/alpha channel, and RLE compression, but I'm probably reaching there. PIL is read-only for TGAs, unfortunately, and so far I'm striking out on Google. Thanks. -- Adam Pletcher Tec

RE: copy locked files

2007-06-18 Thread Adam Pletcher
Do you mean files marked in-use by the OS, like DLLs used by an open application? There shouldn't be anything preventing you from copying in-use files, or even read-only files if that's what you meant: import shutil shutil.copy('C:\\my_application\\test.dll', 'C:\\new_folder\\test.dll') Alth

RE: Who uses Python?

2007-06-04 Thread Adam Pletcher
mer or sysadmin would use Python, I suppose. -- Adam Pletcher Senior Technical Artist Volition / THQ www.volition-inc.com > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > On Behalf Of walterbyrd > Sent: Monday, June 04, 2007 2:37 PM > To: pyth