Re: os.access() under windows

2007-12-05 Thread Tim Golden
Martin v. Löwis wrote: > In a POSIX world, you need read permission on the directory. > In Windows, with the "bypass-traversal-check" privilege, > you only need read permission on the directory if you want > to list it, not to access a file in the directory. Is it > actually possible for GetFileAtt

Re: Dictionary instantiation?

2007-12-07 Thread Tim Golden
Matt_D wrote: [... snip loads ...] > Wow, list spam. Indeed. > Sorry about this. Good. > Anyway, disregard my last two. I get it now. Glad to hear it. Might I suggest, though, that it's not necessary to repeat the entire history of the thread on every email. Unless you have reason to repr

Re: eclipse pywintypes.com_error

2007-12-07 Thread Tim Golden
[EMAIL PROTECTED] wrote: > i want to use active directory of my firm to user authentication.i am > using active_directory module By the way, if what you want to do is user *authentication* (as opposed to authorisation) then the active_directory module won't be any good to you. You want to use eith

Re: eclipse pywintypes.com_error

2007-12-07 Thread Tim Golden
[EMAIL PROTECTED] wrote: > i want to use active directory of my firm to user authentication.i am > using active_directory module(Tim Golden's module - > http://tgolden.sc.sabren.com/python/active_directory.html). > > i am using windows vista with an administrative account,python > 2.5 ,eclipse 3.2

Re: Converting Excel time-format (hours since 1.1.1901)

2007-12-07 Thread Tim Golden
[EMAIL PROTECTED] wrote: > On Dec 7, 7:20�am, Dirk Hagemann <[EMAIL PROTECTED]> wrote: >> Hello, >> >> From a zone-file of a Microsoft Active Directory integrated DNS server >> I get the date/time of the dynamic update entries in a format, which >> is as far as I know the hours since january 1st 19

Re: Any simpler way to do this

2007-12-07 Thread Tim Golden
Lars Johansen wrote: > I have a function that looks like this: > > def Chooser(color): > > if color == "RED": > x = term.RED > elif color == "BLUE": > x = term.BLUE > elif color == "GREEN": > x = term.GREEN > elif col

Re: eclipse pywintypes.com_error

2007-12-07 Thread Tim Golden
Spindle wrote: > I checked the key,and it was found under HKEY_CLASSES_ROOT.And as i > mentioned before, > the problem happens only with eclipse and pydev,on the same machine i > can run the script from command line or with IDLE without any errors. Well, that's bizarre then. Hopefully someone else

Re: eclipse pywintypes.com_error

2007-12-07 Thread Tim Golden
gurkan wrote: > i have treid the script : > > #import active_directory > import win32com.client > > win32com.client.Dispatch ("ADODB.Command") > #me = active_directory.find_user () > > #print me > > again i got the error : > > Traceback (most recent call last): > File "H:\dev\eclipse\workspa

Re: is it possible to install 2 Python versions on windows XP ?

2007-12-17 Thread Tim Golden
Dan wrote: > On Dec 17, 11:07 am, Stef Mientki <[EMAIL PROTECTED]> > wrote: >> hello, >> >> I'm currently using Python 2.4, >> and I don't dare to switch to 2.5, >> because I depend heavily on Scipy, which is based on 2.4 >> >> To test some other Python programs I need Python version 2.5. >> I've t

Re: Is there *any* real documentation to PyWin32?

2007-12-20 Thread Tim Golden
Benoit wrote: > I understand that the Win32 has been said to be itself poorly > documented, so perhaps that the documentation that comes with the > modules is of similar quality is no coincidence. Maybe I'm still too > young in my programming to grasp the good of that documentation, but > for myse

RE: blob problems in pysqlite

2006-04-26 Thread Tim Golden
[EMAIL PROTECTED] | I'm a long-time lurker and (I think) first time poster. | Only relatively new to python, and I'm trying to get pysqlite to work | with binary data, and having a tough time of it. | I want to set up a table with: | - a URL, | - some filenames related to that URL, | - and some si

RE: Speed of shutil.copy vs os.system("copy src dest") in win32

2006-04-27 Thread Tim Golden
[Russell Warren] | I just did a comparison of the copying speed of shutil.copy | against the | speed of a direct windows copy using os.system. I copied a file that | was 1083 KB. | | I'm very interested to see that the shutil.copy copyfileobj | implementation of hacking through the file and wri

Re: Can one query full name (or version) of selected packages at pypi?

2006-04-27 Thread Tim Golden
[Caleb Hattingh] > My big problem, being in South Africa, is > that I have to get any distros on cover CDs or order from > distro-resellers, and they never have Testing or Unstable. Broadband > hasn't exactly hit the local market, although things might be looking > up in a few years or so. I ha

RE: Importing modules through directory shortcuts on Windows

2006-04-27 Thread Tim Golden
[Roger Upole] | You can use win32file.DeviceIoControl to link directories. | I can post some code to do so if anyone's interested. I'd certainly be interested... Thanks TJG This e-mail has been scanned for all viruses by S

RE: blob problems in pysqlite

2006-04-27 Thread Tim Golden
[EMAIL PROTECTED] | I'm trying to use cPickle.loads(data) (code attached), and I get a: | "TypeError: loads() argument 1 must be string, not list" | | Is there a workaround for this? I've tried converting the | List of files | to a String before cPickling it, but the same result (expected). OK,

RE: Importing modules through directory shortcuts on Windows

2006-04-28 Thread Tim Golden
[Roger Upole] | [... snipped ugly code ...] Thanks; I'll have to find the time to experiment with that a bit. TJG This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more inform

RE: Get all attributes of a com object

2006-04-28 Thread Tim Golden
[bruno at modulix] | Duncan Booth wrote: | > That will show him the attributes of the Python wrapper | around the COM | > object, it won't show him the attributes of the underlying | COM object | > itself. | | I stand corrected - and shouldn't answer questions about MS technos :( In fact, i

RE: Get all attributes of a com object

2006-04-28 Thread Tim Golden
[Stefan Schukat] | You can only build a proxy module if you have the typelibrary | information which not all programs provide, since it prohibits | changes in the interface the easy way. E.g., MFC application | will normally not provide a typelibrary but support dynamic | dispatch. Oh. Thanks.

RE: os.startfile() - one or two arguments?

2006-04-28 Thread Tim Golden
[BartlebyScrivener] | Can any Windows user give a working example of adding a "command verb" | to os.startfile()? I'm afraid the core Python version of this command has only grown the command verb since 2.5a1. Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 Type "h

RE: Need to send email on HIGH Disk usage

2006-05-08 Thread Tim Golden
[C Saha] | I am looking for a py script which will send me email when | ever my disk becomes more than 90% full. By the way my OS is Win XP. | | If anybody have already has written same type of script or | something very similar kind of script will also be great. You can certainly do this wi

RE: Import data from Excel

2006-05-09 Thread Tim Golden
[Dale Strickland-Clark] | from win32com.client import GetObject, constants | | def GetExcelData(self, strFilePath): | """ Extract the data from the Excel sheet. | Returns tuple of tuples representing the rows and cells.""" | # The following line extracts | # all the data from she

Re: any plans to make pprint() a builtin?

2006-05-14 Thread Tim Golden
Duncan Booth wrote: > John Salerno wrote: > > > Just wondering if this will ever happen, maybe in 3.0 when print becomes > > a function too? It would be a nice option to have it available without > > importing it every time, but maybe making it a builtin violates some > > kind of pythonic ideal? >

RE: Windows Copy Gui

2006-05-15 Thread Tim Golden
[placid] | Just wondering if anyone knows how to pop up the dialog that windows | pops up when copying/moving/deleting files from one directory to | another, in python ? http://timgolden.me.uk/python/win32_how_do_i/copy-a-file.html#shell TJG ___

RE: Formmating excel cells with PyExcelerator or COM

2006-05-15 Thread Tim Golden
[Mauricio Tellez] | Hi, I just want that a number like 1234.123 appear in excel | as 1,234.12 | In excel I just select some cells, then right click on them | and select "Cell Formatting" then select Number, and check | "Use thounsands separator" and 2 decimal places. I can't find | how to do t

RE: Python script windows servcie

2006-05-17 Thread Tim Golden
[Mivabe] | Mivabe formulated the question : | > | > Google helped me discovering that it has something to do | something with | > 'CTRL_LOGOFF_EVENT'. I know what it means but i don't know | how to solve it. | > Is that something i have to configure in the script? | > | > I'n totally new to Py

RE: how to traverse network devices in our system?

2006-05-17 Thread Tim Golden
[EMAIL PROTECTED] | i would like to know whether python can help me querying the network | devices attached to my system (ethernet,wireless) and display their | module name and vendor name? Which OS? If it's windows, you can use WMI. I would guess Linux, tho', from your mention of module name. T

RE: Windows Registry Dump

2006-05-18 Thread Tim Golden
[Dirk Hagemann] | Does someone know how I can make a Text-Dump-File of a remote | Windows-Computer's Registry (not the whole registry - only a part of | it)? Well, your question doesn't seem to rule out this option so I thought I'd offer it: Use regedit to connect to the remote registry, then do

RE: Python Install

2006-05-18 Thread Tim Golden
[D] | Thanks, Paul - do you know where I can get the RPM? I only see the | source on the Python website. Thanks. http://www.python.org/pyvault/ (first Google hit for site:python.org RPM) TJG This e-mail has been scanned

RE: Windows Registry Dump

2006-05-19 Thread Tim Golden
[Dirk Hagemann] | @Diez: I'm not trying to hack into somebody's computer - it is about | collecting data from my company's anti-virus-parent-server. | And all the | information is only available in the registry (thanks Symantec...). | | @Tim, olso and Fredrik: THANKS - I will have a closer look

RE: Windows Registry Dump

2006-05-19 Thread Tim Golden
[Dirk Hagemann] | I want to do some analysis (as always ;-) ) and for that | reason I think | it's more practical to go trough a text-file. I can produce this | text-file also by right-click on the key (the folder) in the registry | and select "Export". There one can select Text-File and the |

RE: Win32: Detecting when system is locked or sleeping

2006-05-22 Thread Tim Golden
[rodmc] | I have written an application which works perfectly when the | machine is | operating under normal conditions, however when the screen becomes | locked it imediately starts to fill up several hundred MB's of memory. | | Is there a way to detect when the system is locked? This may not

RE: COM Server crashing when returning large arrays

2006-05-23 Thread Tim Golden
[Alastair Alexander] | Hi ... I'm using pythoncom to create a python COM server | application that needs to be able to return large arrays | to COM client apps. For example, I need to be able to | return an array to Excel that is 500 by 10, with each | element of the array holding a 32 byte st

Re: No math module??

2006-05-24 Thread Tim Golden
Tim Roberts wrote: > WIdgeteye <[EMAIL PROTECTED]> wrote: > > > >On Tue, 23 May 2006 12:40:49 +1000, Ben Finney wrote: > > > >Ok this is weird. I checked: > >/usr/local/lib/python2.3/lib-dynload/math.so > > > >Just as you have on your system and it's there. > >So why in the heck isn't it loading wi

Re: newbie: windows xp scripting

2006-05-24 Thread Tim Golden
Tim Roberts wrote: > "oscartheduck" <[EMAIL PROTECTED]> wrote: > > > >It wasn't, but after seeing your success I discovered what was wrong. > >My destination directory didn't exist, and for some reason windows > >wasn't automatically creating it to dump the files in. > > Right. The "copy" command

RE: hide python window

2006-05-26 Thread Tim Golden
[Bell, Kevin] | When I run a script, how can I make it run in the background? I don't | want to see the command window because it runs all day. I'm on | windows... Broadly, two options (depending on what "in the background" means): 1) Complex, but complete: run it as a service. See the example

RE: hide python window, cont'd

2006-05-26 Thread Tim Golden
[John Salerno] | | Bell, Kevin wrote: | > Bell, Kevin wrote: | >> Great! And now that it's hiding w/ .pyw, how would I kill it if I | > want? | >> Just log off, or is there a better way? | >> | >> Kevin | >> | >> | > | >>> JOE WROTE: | >>> Close it in the Task Manager? | > | > | > I don't see

Re: How to detect when a user switches between windows (in WinXP)?

2007-12-27 Thread Tim Golden
Tim Roberts wrote: > [EMAIL PROTECTED] wrote: >> I'm a beginning-to-intermediate Python programmer with some experience >> in other languages. At the moment I am trying to write a Python >> program that will run in the background and execute a series of >> commands whenever I switch between windows

Re: SWbemObjectEx not found

2007-12-27 Thread Tim Golden
jmgmail wrote: > I have a working VBScript and failed to convert it to Python. Can > someone help? > > ==VBScript:== > Set locator = CreateObject("WbemScripting.SWbemLocator") > Set Services = locator.ConnectServer("smsroot1","root/SMS/site_A") > Set instCollection = > Services.Get("SMS_Collection

Re: How to get user home directory on Windows

2008-01-13 Thread Tim Golden
thebjorn wrote: > On Jan 12, 6:50 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: >> Update. >> I found a way for getting the home directory of the user but it >> requires to validate the user by providing username+password: >> >> def get_homedir(username, password): >> token = win32security

Re: How to get user home directory on Windows

2008-01-13 Thread Tim Golden
Martin P. Hellwig wrote: > Giampaolo Rodola' wrote: >> Hi all, >> I'm trying to use the pywin32 extension to find out the user's home >> directory but currently I didn't find a solution yet. >> What I'd need to do is not getting the home directory of the currently >> logged in user but something li

Re: hide object property from dir() function?

2008-01-15 Thread Tim Golden
jerryji wrote: > Sorry for this newbie question, I was puzzled why the existing > property of an object is not shown in the dir() function output. The under-development version of Python (2.6) allows for a __dir__ magic method by which the class implementer can return whatever he wishes from a dir

Re: common problem - elegant solution sought

2008-01-15 Thread Tim Golden
Helmut Jarausch wrote: > I'm looking for an elegant solution of the following tiny but common problem. > > I have a list of tuples (Unique_ID,Date) both of which are strings. > I want to delete the tuple (element) with a given Unique_ID, but > I don't known the corresponding Date. > > My straigh

Re: Opening/Running files through python

2008-01-17 Thread Tim Golden
Ionis wrote: > Hey guys, hope you can help me here. > > I am running in windows and I am trying to open a file via python. I > want the file (a text file) to open up in the users default text > editor. I'm not wanting to read a file, I just want to open it. Is > there a way? import os os.startfi

Re: What is a shortcut to the Default home directory in Windows

2008-01-18 Thread Tim Golden
Christian Heimes wrote: > Mike Driscoll wrote: >> I personally use Tim Golden's excellent win32 API wrapper, the >> winshell script. You can find it here: >> >> http://timgolden.me.uk/python/winshell.html > > Yeah. Tim's winshell is fine but it's not using the official win32 api. Umm... Is it not

Re: stdin, stdout, redmon

2008-01-22 Thread Tim Golden
Bernard Desnoues wrote: > Hello, > > I checked under linux and it works : > text.txt : > "first line of the text file > second line of the text file" > > test.py : > "import sys > a = sys.stdin.readlines() > x = ''.join(a) > x = x.upper() > sys.stdout.write(x)" > > >cat text.txt | python test.p

Re: what's wrong with the wmi.Terminate() method?

2008-01-23 Thread Tim Golden
[EMAIL PROTECTED] wrote: [... snip same problem as reported to python-win32 ...] See my reply on python-win32. TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess and & (ampersand)

2008-01-23 Thread Tim Golden
Steven Bethard wrote: > I'm having trouble using the subprocess module on Windows when my > command line includes special characters like "&" (ampersand):: > > >>> command = 'lynx.bat', '-dump', 'http://www.example.com/?x=1&y=2' > >>> kwargs = dict(stdin=subprocess.PIPE, > ... std

Re: subprocess and & (ampersand)

2008-01-23 Thread Tim Golden
Steven Bethard wrote: > I'm having trouble using the subprocess module on Windows when my > command line includes special characters like "&" (ampersand):: > > >>> command = 'lynx.bat', '-dump', 'http://www.example.com/?x=1&y=2' > >>> kwargs = dict(stdin=subprocess.PIPE, > ... std

Re: wxpython

2008-01-23 Thread Tim Golden
joe jacob wrote: > I am trying to open a file containing non displayable characters like > contents an exe file. The is is with the below mentioned code: > > self.text_ctrl_1.SetValue(file_content) > > If the file_content contains non displayable characters I am getting > an error like this: > >

Re: csv to xls using python 2.1.3

2008-01-23 Thread Tim Golden
LizzyLiz wrote: > Hi > > I need to convert a .csv file to .xls file using python 2.1.3 which > means I can't use pyExcelerator! Does anyone know how I can do this? > > Many thanks > LizzyLiz Use win32com.client to start Excel, tell it to .Open the .csv file and then tell it to .SaveAs an Excel

Re: subprocess and & (ampersand)

2008-01-23 Thread Tim Golden
Ross Ridge wrote: > Tim Golden <[EMAIL PROTECTED]> wrote: >> but this doesn't: >> >> >> "c:\Program Files\Mozilla Firefox\firefox.exe" "%*" >> >> >> >> import subprocess >> >> cmd = [ >> r"

Re: Python printing!

2008-01-23 Thread Tim Golden
SMALLp wrote: > Hy. How to use printer in python. I goggled little i I found only some > win32 package which doesn't look processing for cross platform > application. (I'm using USB printer and I tried to f=open("dev/...") usb > port but i couldn't fond where printer is! You perhaps want to lo

Re: wxpython

2008-01-24 Thread Tim Golden
[Tim Golden] >> wxPython is trying to interpret your byte stream as a Unicode >> text stream encoded as cp1252. But it's not, so it gives up >> in a heap. One solution is to pass the repr of file_content. >> Another solution is for you to prefilter the text, replaci

Re: wxpython

2008-01-24 Thread Tim Golden
[... snip stuff from TJG ...] joe jacob wrote: > Thanks for the information. I'll try to manage it some how. If you haven't already, try posting to a wxPython or wxWidgets mailing list; maybe someone's already done this kind of thing? TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows AVIFile problems

2008-01-25 Thread Tim Golden
c d saunter wrote: > I'm trying to access individual video frames of an AVI file from within > Python 2.4 or 2.5 under Windows XP. I thought that the recently-at-1.0 pyglet did that, only I can't now see it in their docs anywhere. Might be worth asking over there anyway [1] since it certainly com

Re: starting programs from python script on windows

2008-01-28 Thread Tim Golden
Benedict Verheyen wrote: > i want to automate starting programs on my windows machine and i want > to do it with windows. > This is a sample script: > > from subprocess import Popen, PIPE > import time > > print " Starting app 1" > time.sleep(1) > try: > p1 = Popen(["C:\Program Files\Microso

Re: find nearest time in datetime list

2008-01-30 Thread Tim Golden
washakie wrote: > Hello, > > I have a list of datetime objects: DTlist, I have another single datetime > object: dt, ... I need to find the nearest DTlist[i] to the dt is > there a simple way to do this? There isn't necessarily an exact match... import datetime dates = [datetime.date (20

Re: Why the HELL has nobody answered my question !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-02-01 Thread Tim Golden
Bjoern Schliessmann wrote: > Stefan Behnel wrote: > >> How do you know people in hell aren't doing any programming in >> Python? > > Common sense. In hell, everything is hacked together using Perl. Although see: http://xkcd.com/224/ TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows - remote system window text

2008-02-05 Thread Tim Golden
Gabriel Genellina wrote: > En Mon, 04 Feb 2008 17:25:00 -0200, rdahlstrom <[EMAIL PROTECTED]> > escribió: >> On Feb 4, 2:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >>> Well, i guess you will need a process on each machine you need to >>> monitor, and then you do have a client server

Re: Why does list have no 'get' method?

2008-02-07 Thread Tim Golden
Denis Bilenko wrote: > Why does list have no 'get' method with exactly the same semantics as > dict's get, > that is "return an element if there is one, but do NOT raise > an exception if there is not.": > > def get(self, item, default = None): > try: > return self[item] >

Re: how to run python script on remote machine

2008-02-08 Thread Tim Golden
Praveena Boppudi (c) wrote: > Can anyone help me in executing python scripts on remote computer? Both > are windows machines. A fair amount depends on just you want to achieve in the wider picture. I'm going to assume that you have Python/pywin32 installed on both machines. You can, for example,

Re: how to run python script on remote machine

2008-02-09 Thread Tim Golden
Tim Golden wrote: > ... You can, for example, use DCOM to instantiate a > remote Python interpreter but the rest you probably be quite hard > word. (Ahem!) Or maybe: You can, for example, use DCOM to instantiate a remote Python interpreter but doing the rest you'll probably find q

Re: Getting Wireless Signal Strength / Windows XP

2008-02-14 Thread Tim Golden
[Somehow got stuck in my outbox... ] [EMAIL PROTECTED] wrote: > Hello, > > I'm looking for a way to get wireless signal strength on Windows XP > with Python. I see there's a library for Linux, but I can't find > anything for windows. However, I see that using WMI I can access it in > theory at lea

Re: system32 directory

2008-03-06 Thread Tim Golden
Robert Dailey wrote: > Hi, > > Is there a way to get the System32 directory from windows through python? > For example, in C++ you do this by calling GetSystemDirectory(). Is there an > equivalent Python function for obtaining windows installation dependent > paths? First thing to do when asking

Re: system32 directory

2008-03-07 Thread Tim Golden
Robert Dailey wrote: > On Thu, Mar 6, 2008 at 2:42 AM, Tim Golden <[EMAIL PROTECTED]> wrote: >> >> First thing to do when asking "How do I do X in Python under Windows?" >> is to stick -- python X -- into Google and you get, eg: >> >> >>

Re: problem with join

2008-03-07 Thread Tim Golden
nodrogbrown wrote: > hi > i am using python on WinXP..i have a string 'folder ' that i want to > join to a set of imagefile names to create complete qualified names so > that i can create objects out of them > > folder='F:/brown/code/python/fgrp1' > filenms=['amber1.jpg', 'amber3.jpg', 'amy1.jpg',

Re: rmdir problem

2008-03-11 Thread Tim Golden
royG wrote: > hi > i am checking if a directory exists and if it does i want to delete it > and its contents.then i want to create the directory before creating > files in it. > > def myfolderops(): > testdir='..\mytestdir' > #if dir exist remove it > if isdir(testdir): > rmdir

Re: Spaces in path name

2008-03-14 Thread Tim Golden
David S wrote: > Gets me further but still seems to be issue with space after 'Program' as > code tries to run 'C:\Program'. Don't understand what is going on here... Slight apologies as I haven't followed this thread closely, but using the Acrobat Reader executable, which is, I think, good enou

Re: request for Details about Dictionaries in Python

2008-03-14 Thread Tim Golden
Matt Nordhoff wrote: > Michael Wieher wrote: >> I'm not sure if a well-written file/seek/read algorithm is faster than a >> relational database... >> sure a database can store relations and triggers and all that, but if >> he's just doing a lookup for static data, then I'm thinking disk IO is >> fa

Re: Spaces in path name

2008-03-15 Thread Tim Golden
joep wrote: > I had the same problem recently with subprocess.popen, when there is a > space in the executable and a space in an additional argument as in > the acrobat example. I finally found a past thread in this news group > that explained that you have to use two (2) leading double quotes, and

Re: Spaces in path name

2008-03-15 Thread Tim Golden
joep wrote: > On Mar 15, 5:42 pm, joep <[EMAIL PROTECTED]> wrote: >>> http://timgolden.me.uk/python/win32_how_do_i/run-a-command-with-a-spa... >> Note: this works for subprocess.call but for subprocess.Popen this >> does not work if there are two arguments in the command line with >> spaces. Especi

Re: Spaces in path name

2008-03-16 Thread Tim Golden
Tim Golden wrote: > joep wrote: >> On Mar 15, 5:42 pm, joep <[EMAIL PROTECTED]> wrote: >>>> http://timgolden.me.uk/python/win32_how_do_i/run-a-command-with-a-spa... >>> Note: this works for subprocess.call but for subprocess.Popen this >>> does not w

Re: Spaces in path name

2008-03-16 Thread Tim Golden
joep wrote: > > Tim Golden wrote: > >> subprocess.call ([ >> >>r"C:\Program Files\Adobe\Acrobat 5.0\Reader\acro reader.exe", >> >> r"C:\Program Files\Adobe\Acr >> obat 5.0\Reader\plug_ins.donotuse\Annotations\Stamps\abc def.p

Re: Spaces in path name

2008-03-16 Thread Tim Golden
joep wrote: > I assume that there is some difference how subprocess.call and > subprocess.Popen handle and format the command. subprocess.Popen does > the correct formatting when only one file path has spaces and requires > double quoting, but not if there are two file paths with spaces in it. The

Re: Types, Cython, program readability

2008-03-16 Thread Tim Golden
[EMAIL PROTECTED] wrote: > It seems the development of Cython is going very well, quite > differently from the dead-looking Pyrex. I'll leave others to comment on how dead Pyrex is or isn't ... > Hopefully Cython will become > more user-friendly too (Pyrex is far from being user-friendly for > W

Re: Spaces in path name

2008-03-16 Thread Tim Golden
Tim Golden wrote: > What I haven't investigated yet is whether the additional flags > your example is passing (shell=True etc.) cause the main Popen > mechanism to take a different path. Sure enough, passing shell=True -- which is probably quite a rare requirement -- causes the code

Re: Spaces in path name

2008-03-16 Thread Tim Golden
joep wrote: > > Tim Golden wrote: >> Tim Golden wrote: >>> What I haven't investigated yet is whether the additional flags >>> your example is passing (shell=True etc.) cause the main Popen >>> mechanism to take a different path. >> Sure enough,

Re: Spaces in path name

2008-03-16 Thread Tim Golden
Tim Golden wrote: > Well I've got a patch ready to go (which basically just > wraps a shell=True command line with an *extra* pair of > double-quotes, the same as you do for an os.system call). > I'll try to put some time into the subprocess docs as well, > at least as f

Re: When file-like objects aren't file-like enough for Windows

2008-03-16 Thread Tim Golden
William McBrine wrote: > Now, I have a similar problem with subprocess.Popen... The code that > works in Linux looks like this: > > source = urllib.urlopen(url) > child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stdin=source) > try: > shutil.copyfileobj(child.stdout, self

Re: Types, Cython, program readability

2008-03-17 Thread Tim Golden
Tom Stambaugh wrote: >> I'm not entirely sure why you think Pyrex should "contain a compiler". >> It certainly works well enough with the free [beer] MS VS 2008 Express >> and I'm fairly sure it's fine with MingW. Both of those are readily >> available and I don't imagine anyone who's going to use

Re: Spaces in path name

2008-03-17 Thread Tim Golden
Gertjan Klein wrote: > joep wrote: > >> * If shell=True is required, then the executable is a build-in shell >> command, which does not contain spaces, and, therefore, has no >> problems > > This is only true when you are referring to directly executable files. > However, Shell=True is also requi

Re: Convert binary file

2008-03-18 Thread Tim Golden
Diez B. Roggisch wrote: > Vamp4L schrieb: >> Hello, >> Specifically, I'm trying to convert the Internet Explorer history >> file (index.dat) into a readable format. Anyone done something >> similar or know of any functions that may help with such a task? I'm >> not sure exactly what kind of fil

Re: stdout custom

2008-03-18 Thread Tim Golden
[EMAIL PROTECTED] wrote: >>> Can I allocate a second console window, so I can place certain output >>> to that directly, and leave the original streams alone? I've rather lost track of what you're trying to do, but I would second Gabriel's suggestion of the standard Windows method of debug outpu

Re: My python interpreter became mad !

2008-03-25 Thread Tim Golden
Benjamin Watine wrote: > Yes, my python interpreter seems to became mad ; or may be it's me ! :) > > I'm trying to use re module to match text with regular expression. In a > first time, all works right. But since yesterday, I have a very strange > behaviour : > > $ python2.4 > Python 2.4.4 (#2

Re: Reading new mail from outlook

2008-03-25 Thread Tim Golden
SPJ wrote: > I am trying to create new tickets in the ticketing system using python. When > I > receive new email from a particular address, I have to trigger the python > script > and parse the mail in required format. > > The main hurdle here is, how to invoke the script on arrival of new

Re: Reading new mail from outlook using Python

2008-03-25 Thread Tim Golden
SPJ wrote: > Thanks... > > I could access the folders in outlook express using the COM interface. > Now I am stuck with how to read to a file only new mails. Well, this Google query: http://www.google.co.uk/search?hl=en&q=OUTLOOK.application+unread+messages seems to indicate some useful hits.

Re: py2exe socket.gaierror (10093)

2008-03-27 Thread Tim Golden
Python Programming on Win32 wrote: > The problem is running smtplib in a py2exe compiled exe file. When it > tries to establish a socket to the mail server it fails. > > Just wondering someone has encountered this before, and if someone > might be able to point me in the right direction. > > Unha

Re: Problem with write binary data to OLE field in Access

2008-03-27 Thread Tim Golden
lialie wrote: [... snip slightly confused indication that reading back a binary item using GetChunk appears to double its length ...] Well I don't know why this should be happening, but I do at least have a few suggestions: 1) Try using ADODB.Stream instead of GetChunk etc. 2) Try using the adod

Re: Checking processes running under Windows

2008-03-27 Thread Tim Golden
João Rodrigues wrote: > Hello all! I'm trying to write a script that needs to check which processes > are running under Windows (XP Pro, Home, whatever). The method I'm using is: > process_list = os.popen('TASKLIST').read() > > However, XP Home doesn't have the tasklist.exe tool so, this is

Re: Finding Full Path to Process EXE

2008-03-28 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hello, > > I would like to write a script that would enumerate all running > processes and return the full path to the EXE of each running > process. However, I can't seem to find any good info on how to do > this..any help is greatly appreciated. Thanks. I have this

Re: Process crash with no reason

2009-01-27 Thread Tim Golden
gil.shi...@gmail.com wrote: On Jan 26, 8:40 pm, Philip Semanchuk wrote: On Jan 26, 2009, at 1:13 PM, gil.shi...@gmail.com wrote: Hi All, I'm running a program that is acting as a nice interface to sybase' replication server. The program is using the cherrypy web service for the GUI. The proce

Re: errno 22 instead of errno 2

2009-01-28 Thread Tim Golden
Glenn Linderman wrote: open("c:\abc","rb") This simple one-line script, produces errno 22 on Python 2.6, but errno 2 on Python 2.5.2 Is this an unintentional regression? Or is this an intentional bug fix? The file doesn't exist (errno 2) but I guess on Windows it is also somewhat an invali

Re: Weird invisible arguments issues with Windows

2009-01-29 Thread Tim Golden
Uberman wrote: I've installed Python 2.6.1 (AMD64) under Windows Vista Ultimate 64-bit. First off, it didn't register the extension for .PY (although it did register .PYC). After manually associating the .PY extension with the python.exe executable, I am now getting some weirdness on the comman

Re: parsing text from a file

2009-01-30 Thread Tim Golden
Wes James wrote: If I read a windows registry file with a line like this: "{C15039B5-C47C-47BD-A698-A462F4148F52}"="v2.0|Action=Allow|Active=TRUE|Dir=In|Protocol=6|Profile=Public|App=C:\\Program Files\\LANDesk\\LDClient\\tmcsvc.exe|Name=LANDesk Targeted Multicast|Edge=FALSE|" Watch out. .reg

Re: import wx works interactive but not from script

2009-02-10 Thread Tim Golden
jefm wrote: when I call "import wx" from the interactive console, it works (i.e. it doesn't complain). But when I call the same from a script, it complains that it can not find the wx module. works for interactive Python 2.6.1 (r261:67517, Dec 4 2008, 16:

Re: COM and threading, "CoInitialize"?

2009-02-10 Thread Tim Golden
Ferdinand Sousa wrote: Greetings to list members, I am trying to use an Acrobat COM object in a class that is subclassed from threading.Thread. Since threading.Thread is subclassed, the __init__ method of the inheriting class must explicitly call the threading.Thread.__init__ method of the paren

Re: import wx works interactive but not from script

2009-02-10 Thread Tim Golden
jefm wrote: I ran the script from a command line, so it is not a file association thing. Ummm... if you ran it by just typing the script name -- c:\test\whatever.py rather than c:\pythonxx\python c:\test\whatever.py -- then it certainly could be a file association issue. I do have multiple ve

Re: access to MS Access password-protected database?

2009-02-11 Thread Tim Golden
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. Caveat: I've never done it and I have no Access db to hand, but

Re: A little bit else I would like to discuss

2009-02-12 Thread Tim Golden
Philip Semanchuk wrote: On Feb 12, 2009, at 3:04 PM, azrael wrote: Why will Microsoft's products kick the ass of open source. Because anyone does what he wants. Let's say There are 5 GUI libraries competing against each other. Think about it what could these 5 teams acomplish if they would wor

Re: Invoking CutePDF from within Python

2009-02-13 Thread Tim Golden
John Henry wrote: I have a need to invoke CutePDF from within a Python program. All I need is to say "Print this to CUTEPDF and store as xyz.pdf". Private Sub Print_PDF() lRetVal = RegCreateKeyEx(HKEY_CURRENT_USER, "Software\Custom PDF Printer", _ 0&, vbNullString

<    5   6   7   8   9   10   11   12   13   14   >