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.
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
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
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
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
?
>
> 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
>
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
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
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
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)
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
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
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
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
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
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
16 matches
Mail list logo