Re: bool value 'False' no memory address?

2007-04-04 Thread Tim Golden
Jakub Stolarski wrote: > On Apr 4, 12:36 pm, "autin" <[EMAIL PROTECTED]> wrote: >> such as:>>>b = False > id(b) >> Traceback (most recent call last): >> File "", line 1, in ? >> TypeError: 'bool' object is not callable >> >> --- >> how to desc it? > b = False id(b) > 135311308 > >

Re: How to tell when a file is opened

2007-04-07 Thread Tim Golden
Adam wrote: > I want to know if it possible to tell when a file is opened. However I > don't want it to be the last access time. I want to know how many > times a file opened so I can generate statistics of file usage. > > I will be wanting to watch all files on a server so this will be on > quite

Re: How to tell when a file is opened

2007-04-08 Thread Tim Golden
momobear wrote: >> Will look into NTFS change journals when I get some spare time. > How can we get NTFS change journals? Is there any API for this purpose > or we could implement our own? > there're an api in windows help us montior file changes. > win32file.ReadDirectoryChangesW Don't know what

Re: how to use the string '\\.\'

2007-04-09 Thread Tim Golden
人言落日是天涯,望极天涯不见家 wrote: > print r'\\.\' > > This line will cause error. I just want to print the > \\.\ > why the prefix character "r" isn't effective. Thanks! Because of the way in which Python parses strings, you can't end a string -- even a raw one -- with an odd (1, 3, 5 etc) number of backsla

Re: Shutting down windows using win32api

2007-04-11 Thread Tim Golden
On a whim, given the terseness of your post, I cut-and-pasted your subject line into Google, added "python" for good measure, and looked at the results. I suggest you might do the same. Granted, maybe this will raise more questions, but at least it shows willing :) TJG -- http://mail.python.org/

Re: Arrays, Got Me Confused

2007-04-13 Thread Tim Golden
Michael Bentley wrote: > > On Apr 13, 2007, at 7:04 AM, Robert Rawlins - Think Blue wrote: >> #!/usr/bin/python >> >> # Filename: Firewall.py >> class Firewall: >>def __init__(self): >> >> Self.FireArray = array(c) >> >> p = Firewall() >> >> print p >> Throws: >> >> >> >> Tra

Re: Arrays, Got Me Confused

2007-04-13 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > Hello Guys, > > Wider fragments of code don't really exists at this moment in time :-D this > is just a bit of a 'tester' class for me to get used to the methods. > Basically I'm trying to create a class that contains an array of MAC > address, these look somet

Re: Writing Log CSV (Efficiently)

2007-04-16 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I'm looking to write a Log file which will be CSV based, and there is a good > possibility that it'll get quite busy once its up and running, so I'm > looking for the most efficient way to achieve it. [... snip ...] > myfile = open("Logs/Applica

Re: Writing Log CSV (Efficiently)

2007-04-16 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > The log at its highest rate of write may be looking at an operation a > second I think I can probably type stuff in faster than that if I try :) You probably don't have a performance issue there. , I've not got much experience with this kind of thing so I'm n

Re: Writing Log CSV (Efficiently)

2007-04-16 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > Thanks for that Tim, > > I could use a little more help with this CSV stuff this afternoon and I > can't get it to write the output I want for the life of me. I'm trying to > write a method for my logging class that receives a string as an argument, > and then

Re: sql to xml

2007-04-17 Thread Tim Golden
Ros wrote: > Hi, > > I wish to write xml file after validating data from mssql database. > I am using xml data mapping list and would use it for validating data. All right, I'm not going answer the question you're asking (a) because I'm not really sure what the question is and (b) because I'm not

Re: question of easyExcel (<>)

2007-04-17 Thread Tim Golden
Tommy Zong wrote: > class easyExcel: [... snip ...] > However, I found a problem today - it works fine in single thread version > but can not work properly in multi-thread version - If I move excel file > operations to sub-thread, it will complain 'CoInitialize has not been > called'. I noticed

Re: Deleting or Empty a File

2007-04-17 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I'm looking to clear those log files we were discussing earlier chaps, > > What the best method to do this? Delete the file completely? Or just empty > its content? Not sure there is a "best method". For simplicity I'd just delete it and let the logger recreat

Re: Screen Control in WinXP and Linux

2007-04-18 Thread Tim Golden
peter wrote: > I've been wrestling on and off with this problem for over a year now, > without success. Basically, I am looking for a simple set of screen > and keyboard manipulation commands that will run identically under > Linux and Windows. Nothing fancy - just clear the screen, print a > str

Re: X root Operator help

2007-04-18 Thread Tim Golden
lucidparadox wrote: > I'm currently new to Python and I haven't been able to find the > operator/math function to find the square root or even the x root of a > number. Without ever having used it, I would guess it's the sqrt function in the math module. (Possibly also of interest: the pow func

Re: how to convert xml file to word document.

2007-09-20 Thread Tim Golden
prajwala wrote: >I want to convert xml file to a word document using python. Is > there > any built in module available? >or Is there any other way to convert xml file to word document. Insofar as it is textual, an xml file *is* a Word document. Just open it up in Word and see. I assume yo

Re: frange() question

2007-09-20 Thread Tim Golden
George Trojan wrote: > A while ago I found somewhere the following implementation of frange(): . . . > return (limit1 + n*increment for n in range(count)) > > I am puzzled by the parentheses in the last line. Somehow they make > frange to be a generator: > But I always thought that generato

Re: Python-list Digest, Vol 48, Issue 301

2007-09-20 Thread Tim Golden
Christoph Scheit wrote: > Hello, > > is there a way to do something like > for i,j in l1, l2: > print i,j I'm assuming that l1 and l2 are in fact lists (or at least sequences). If that's the case: l1 = [1, 2, 3] l2 = ['a', 'b', 'c'] for i, j in zip (l1, l2): print i, j TJG -- http:/

Re: looking for ocbc example

2007-09-21 Thread Tim Golden
Carl K wrote: > It seems there are 2 odbc modules - pyOdbc and mxOdbc - anyone know the > difference? In short, pyodbc is open source; mxOdbc requires a commercial license. pyodbc is a newcomer, but appears to work for everything I've thrown at it (which is not much). mxOdbc has been around longe

Re: SHOCK: WHY None?

2007-09-21 Thread Tim Golden
n00m wrote: > def f(i,sm): > if i+1==len(a): > print sm+a[i] > return sm+a[i] > else: > f(i+1,sm+a[i]) > > a=[1,2,3,4,5] > > print f(0,0) > > > 15 > None You're not actually returning anything from the recursive call. TJG -- http://mail.python.org/mailman/list

Re: Cross-platform time out decorator

2007-09-27 Thread Tim Golden
Joel wrote: > I've been using this nice timing out decorator : > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/307871 . The > problem is that since it relies on sigalarm, it doesn't work under > windows. Would anyone know how to do a cross-platform version? I don't think you're going to

Re: Cross-platform time out decorator

2007-09-27 Thread Tim Golden
Steve Holden wrote: > Joel wrote: >> On Sep 27, 4:36 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: >>> Joel <[EMAIL PROTECTED]> writes: I found the solution : http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440569 describes a solution based on threads. I tested it and it works

Re: LastWriteTime in windows registry

2007-10-02 Thread Tim Golden
Peters, Matthew J. ET3 wrote: > I'm looking for a way to read the lastwritetime property of > a windows registry key. ... I found the function in perl So what does the Perl source say? It presumably hooks some kind of Windows API. Take that and, if it isn't already exposed via pywin32

Re: Subprocesses on Windows

2007-10-03 Thread Tim Golden
Nachiket Joshi wrote: > Well before I explain my problem, let me tell you all that > I am not a professional programmer and new to python too. Welcome to the world of Python, home to professional and non-professional programmers alike! > I just write some scripts as and when required Same coul

Re: enumerate overflow

2007-10-03 Thread Tim Golden
Steve Holden wrote: > I wouldn't dream of suggesting it's impossible. > I just regard "soon" as less than an hour in > commuter's terms, I suppose. Sadly, speaking as a Londoner, an hour is indeed "soon" in commuter terms. TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Cross platform way of finding number of processors on a machine?

2007-10-05 Thread Tim Golden
Nicholas Bastin wrote: > On 10/4/07, John <[EMAIL PROTECTED]> wrote: >> Is there a way to find the number of processors on a machine (on linux/ >> windows/macos/cygwin) using python code (using the same code/cross >> platform code)? > > There's no single call that will give you the same info on ev

Re: Cross platform way of finding number of processors on a machine?

2007-10-05 Thread Tim Golden
[Tim Golden] >>""" >>Windows Server 2003, Windows XP, and Windows 2000: >> This property is not available. >>""" >> >> since it's presumably not available in anything earlier either, >> that leaves you w

Re: Problem using subprocess.Popen on windows

2007-10-07 Thread Tim Golden
jorma kala wrote: > I get an error that I don't understand when using the subprocess module > on Windows. > I guess I'm missing out something very basic. > For instance, to execute and capture the output of the ms-dos dir > command, I tried the following: > > from subprocess import * > > p1 = P

Re: How to create a file on users XP desktop

2007-10-07 Thread Tim Golden
Tim Chase wrote: >> You are assuming the system is not localized, that won't work if you >> distribute your applications internationally. In my system it is not >> "Desktop", it is "Escritorio", and I guess it will vary with every >> locale. Does someone know a way to find out what name does the de

Re: How to create a file on users XP desktop

2007-10-07 Thread Tim Golden
Tim Chase wrote: >> You are assuming the system is not localized, that won't work if you >> distribute your applications internationally. In my system it is not >> "Desktop", it is "Escritorio", and I guess it will vary with every >> locale. Does someone know a way to find out what name does the de

Re: How to create a file on users XP desktop

2007-10-08 Thread Tim Golden
[EMAIL PROTECTED] wrote: > On Oct 8, 9:19 am, goldtech <[EMAIL PROTECTED]> wrote: >>> from win32com.shell import shell, shellcon >>> desktop = shell.SHGetFolderPath (0, shellcon.CSIDL_DESKTOP, 0, 0) >>> >> Tim, >> >> How did you learn Win32com? >> >> Other than the O'Reilly book, I've never found

Re: How to create a file on users XP desktop

2007-10-09 Thread Tim Golden
tough - there's tons of stuff in >>> there. I've never been able to find the Win32com classes, methods, >>> usage examples when I browse COM in PythonWin. >>> >>> For example where is, shell.SHGetFolderPath and shellcon.CSIDL_DESKTOP >>> officia

Re: Script to Remove Attachments in Exchange Mailbox

2007-10-11 Thread Tim Golden
KDawg44 wrote: > Hi, > > I am frustrated with my users who send large files around the office > instead of using the network shares. [...] > Which means that there are 8 copies of the same file 4MB taking up > space, or a 4MB file turned into a 32MB file." > > So, what I would like, is to write

Re: Python module for making Quicktime or mpeg movies from images

2007-10-11 Thread Tim Golden
jeremito wrote: > On Oct 11, 10:43 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> jeremito wrote: >>> My Python script makes a bunch of images that I want to use as frames >>> in a movie. I've tried searching for a module that will take these >>> images and put them together in a Quicktime o

Re: Script to Remove Attachments in Exchange Mailbox

2007-10-12 Thread Tim Golden
[KDawg44] >>> I am frustrated with my users who send large files around the office >>> instead of using the network shares. [Tim Golden] >> I have something v. similar, ... >> It's a while since they were last run to they're probably quite >> dus

Re: Pyro: ActiveState (wind32) to Unix

2007-10-12 Thread Tim Golden
Sells, Fred wrote: > I'm using ActiveState python on a windows box to talk to ACtive Directory. > I'm running a Pyro Server on the same box. > > The client is Linux running std Python 2.4. > > It works just fine until the server codes calls some > win32com.client api; then I get > > > Tra

Re: Script to Remove Attachments in Exchange Mailbox

2007-10-12 Thread Tim Golden
Tim Golden wrote: > [KDawg44] > >>>> I am frustrated with my users who send large files around the office >>>> instead of using the network shares. > > [Tim Golden] >>> I have something v. similar, ... >>> It's a while since they were

Re: Pyro: ActiveState (wind32) to Unix

2007-10-13 Thread Tim Golden
Tim Golden wrote: > Sells, Fred wrote: >> I'm using ActiveState python on a windows box to talk to ACtive >> Directory. > > I'm running a Pyro Server on the same box. >> >> The client is Linux running std Python 2.4. >> >&g

Re: Capturing OutputDebugString information in python

2007-10-17 Thread Tim Golden
danbrotherston wrote: > I am trying to get the output from the win32 platform command > OutputDebugString. I have used the following C++ code as a > guideline: > > http://groups.google.com/group/microsoft.public.vc.utilities/browse_frm/thread/1434418cb968d053/1a3c957675242c7e?lnk=st&q=DBWIN_BUFFE

Re: Capturing OutputDebugString information in python

2007-10-18 Thread Tim Golden
danbrotherston wrote: > > > Wow, more of a response than I expected, thanks very much for the > research. While not related to the mutex, the problem did appear to > be permission related. For the record, on windows XP > > import sys > import mmap > import win32event > > buffer_ready = win32e

Re: Please Help !!!

2007-10-19 Thread Tim Golden
marc wyburn wrote: > On Oct 17, 10:32 am, Heiko Schlierkamp <[EMAIL PROTECTED] > africa.com.na> wrote: >> I need to update the virus program every day with the new dat file from >> mcafee >> I would like to us a Bat file to go to the web page and download the dat >> file automatically to a specific

Re: Check File Change Every 10 Seconds

2007-10-22 Thread Tim Golden
he last time I parsed its >> content >> into the application then I need to parse it in again. However, I need >> this >> process to not interrupt the rest of my application flow. > > See this article by Tim Golden: > http://timgolden.me.uk/python/win32_how_do_i/wat

Re: Iteration for Factorials

2007-10-22 Thread Tim Golden
Marco Mariani wrote: > From the cookbook, this time. > It satisfies the requirements nicely ;) > > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 > [... snip the ultimate general-purpose answer to the OP's question ... I really hope that's a wink up there, Marco. The poor g

Re: Iteration for Factorials

2007-10-22 Thread Tim Golden
Marco Mariani wrote: > Tim Golden wrote: > >>> From the cookbook, this time. >>> It satisfies the requirements nicely ;) >>> >>> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691 >> [... snip the ultimate general-purpose answer to th

Re: Syntax coloring in Python interpreter

2007-11-02 Thread Tim Golden
Neil Cerutti wrote: > On 2007-11-01, Chris Mellon <[EMAIL PROTECTED]> wrote: >> On Nov 1, 2007 3:01 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote: >>> On 2007-11-01, Lee Capps <[EMAIL PROTECTED]> wrote: On Nov 1, 2007, at 1:45 PM, braver wrote: > Greetings -- as a long time user of both Pytho

Re: WMI Python, writing remotely and retrieving env variables values

2007-01-13 Thread Tim Golden
Thierry Lam wrote: > I'm using the WMI library for python and I was able to connect to > another computer on the network with the following line: > > c = wmi.WMI(computer="the-network-computer", user="hello", > password="hello") > > Is there a way to write information to a file on that computer? >

Re: Search Queue

2007-01-16 Thread Tim Golden
abcd wrote: > I have a class such as... [... ] > And I am storing them in a Queue.Queue... > > import Queue > q = Queue.Queue() > q.put(Foo('blah')) > q.put(Foo('hello world')) > q.put(Foo('test')) > > how can I search "q" for an instance of Foo which has 'id' equal to say > 2? Typically a queue

Re: Check a windows service

2007-01-16 Thread Tim Golden
awel wrote: > I'm new in python and I would like to know if it's possible to check if > a specific windows service is present and if it's possible how can I > do? This is one way: http://tgolden.sc.sabren.com/python/wmi_cookbook.html#automatic_services You'd have to change that example slightly

Re: Check a windows service

2007-01-17 Thread Tim Golden
awel wrote: > Sorry, but could you give me an example with a real service 'cause I've > tried this script but nothings happened, no error, nothings ; even if I > launch it in cmd prompt. Well, as that example said, it was designed to show automatic services which are not running. If you don't have

Re: Win XP "Sleep" mode: can Py wake up?

2007-01-26 Thread Tim Golden
> Does anyone have any experience having python deal with sleep mode? I'd > love to run something that would hear a sleep event coming and pickle > some data before sleep, then after coming out of sleep, unpickle... It should, in theory, be possibly by trapping the WMI Win32_PowerManagementEvent

Re: excel find last column

2007-02-09 Thread Tim Golden
Lance Hoffmeyer wrote: > I ran makepy.py and loaded Microsoft Excel Object Library 11.0 > I have imported: > > import win32com.client > from win32com.client import constants > import re > import codecs,win32com.client > import time > import datetime > import win32com.client.dynamic > > > using t

Re: WindowsNT user authentication

2007-02-12 Thread Tim Golden
billie wrote: > Hi there, > I would like to submit a username/password pair to a Windows NT > workstation and find out if it's valid. > Moreover I would like to get the user's home directory given the > username. > Does it is possible to do that by using pywin32 extension? http://timgolden.me.uk/p

Re: WindowsNT user authentication

2007-02-12 Thread Tim Golden
billie wrote: > Do you got any idea about how getting user's home directory? The answer to that is unfortunately slightly complicated, because Windows has no such thing as a "user's home directory" or, if you prefer, it has several such things. If you want, you can let Python make the decision,

Re: WindowsNT user authentication

2007-02-14 Thread Tim Golden
billie wrote: > Another question, I'm sorry. > Do you got any idea about how to get permissions of a file/directory > given the username? > For example: I would like to know if C:\my_file.ext is readable/ > writable by user 'x' or not. This is an unfortunately messy question. The easiest answer --

Re: WindowsNT user authentication

2007-02-14 Thread Tim Golden
Tim Golden wrote: > billie wrote: >> Another question, I'm sorry. >> Do you got any idea about how to get permissions of a file/directory >> given the username? >> For example: I would like to know if C:\my_file.ext is readable/ >> writable by user 'x&#

Re: How to ping and shutdown a remote computer?

2007-02-14 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Here is my current setup: > > [... BSD ...] > - Windows XP machine with folder share (What packet is sent over the > network to remotely shutdown a Windows XP machine?) > > My hope is to have a script then when you start it will list all your > remote computers/servers

Re: how do "real" python programmers work?

2007-02-15 Thread Tim Golden
Youth work in Ealing). Tim Golden -- http://mail.python.org/mailman/listinfo/python-list

Re: Command line prompt broken on XP with Python 2.5 - help!

2007-02-16 Thread Tim Golden
Endless Story wrote: > On Feb 16, 9:56 am, "Jim" <[EMAIL PROTECTED]> wrote: >> On Feb 16, 5:52 am, "Endless Story" <[EMAIL PROTECTED]> wrote: >> Are you talking about the Environment Variables-->System Variable-->path? >> You may want to right click on My Computer-->System Properties-->Advanced-->

Re: Group Membership in Active Directory Query

2007-02-16 Thread Tim Golden
Kooch54 wrote: >> Thanks for your response and Uwe I apologize if I misunderstood >> and misinterpreted your comments. I am sorry. >> I have tried Tim's module called active_directory and it works really >> well. But I can't figure out how to connect to a specific group is I >> know the comm

Re: How can I track/monitor an application and system resources.

2007-02-22 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hello All, > > I'm a newbie to Python! > > I am trying to develop a program that monitors the performance of an > application. The kind of information I am interested in is the CPU/ > Process/Thread and memory performance. Specifically, I would like to > track the foll

Re: How can I track/monitor an application and system resources.

2007-02-23 Thread Tim Golden
[EMAIL PROTECTED] wrote: > The phone reference is actually because the target device is WM 5.0. > I've found a python port Pyce that will run on this platform. We have > a target application that runs on this platform which we would like to > develop some automated tests for. The application is w

Re: CSV(???)

2007-02-23 Thread Tim Golden
Philipp Pagel wrote: > David C. Ullrich <[EMAIL PROTECTED]> wrote: >> Is there a csvlib out there somewhere? > > How about csv in the standard library? > >> (Um: Believe it or not I'm _still_ using >> python 1.5.7. > > I have no idea if csv was part of the standard library backin those > days...

Re: ez_setup.py

2007-02-26 Thread Tim Golden
Nader Emami wrote: > L.S., > > I have installed locally Python-2.4.4 without any problem. Then I would > install the "ez_setup.py" to be able using of "easy_install" tool, but I > get the next error: > > %python ez_setup.py > Traceback (most recent call last): >File "ez_setup.py", line 223,

Re: ez_setup.py

2007-02-26 Thread Tim Golden
Nader Emami wrote: > Tim Golden wrote: >> Nader Emami wrote: >>> L.S., >>> >>> I have installed locally Python-2.4.4 without any problem. Then I >>> would install the "ez_setup.py" to be able using of "easy_install" >>>

Re: ez_setup.py

2007-02-26 Thread Tim Golden
Nader Emami wrote: >>> How can do the second solution, (take off the home from Python path)? >> >> Depends on your setup. Since you're on *nix, I can't >> test whether $HOME is automatically on sys.path (it >> isn't on Win32). Are you running *in* /usr/people/emami? >> If so, go somewhere else bef

Re: ez_setup.py

2007-02-26 Thread Tim Golden
Nader Emami wrote: > Tim Golden wrote: >> Nader Emami wrote: >> >>>>> How can do the second solution, (take off the home from Python path)? >>>> >>>> Depends on your setup. Since you're on *nix, I can't >>>> test whether

Re: ez_setup.py

2007-02-26 Thread Tim Golden
Nader Emami wrote: > Tim Golden wrote: >> Nader Emami wrote: >>> Tim Golden wrote: >>>> Nader Emami wrote: >>>> >>>>>>> How can do the second solution, (take off the home from Python >>>>>>> path)? >>>

[Fwd: Re: ez_setup.py]

2007-02-26 Thread Tim Golden
OK. He's solved it. For the historical record... Tim Golden wrote: > Nader Emami wrote: >> Tim Golden wrote: >>> Nader Emami wrote: >>>> Tim Golden wrote: >>>>> Nader Emami wrote: >>>>> >>>>>&

Re: How can I disable a device in windows using python

2007-02-26 Thread Tim Golden
Phoe6 wrote: > Hi all, > I am trying to disable the NIC card (and other cards) enabled in my > machine to test diagnostics on that card. > I am trying to disable it programmatic using python. I checked python > wmi and i could not find ways to disable/enable, (listing is however, > possible). Sinc

Re: Importing WMI in a child Thread throws an error

2007-02-27 Thread Tim Golden
[EMAIL PROTECTED] wrote: > The problem I have is that since I import WMI, it takes a long time > and we have users complaining about it. So I stuck the import > statement into a separate thread and set it to a daemon so it could do > its thing in the background and the rest of the script would fin

Re: Importing WMI in a child Thread throws an error

2007-02-28 Thread Tim Golden
[EMAIL PROTECTED] wrote: > On Feb 27, 3:32 pm, Tim Golden <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> The problem I have is that since I import WMI, it takes a long time >>> and we have users complaining about it. So I stuck the import >>> s

Re: How to check for remaining hard drive space in Windows?

2007-02-28 Thread Tim Golden
[... re getting free disk space ...] Sick Monkey wrote: > Here you are: > > >>> from win32com.client import GetObject wmiObj = GetObject("winmgmts:MGW01641\\root\\cimv2") diskinfo = wmiObj.ExecQuery("Select * from Win32_LogicalDisk") for disk in diskinfo: > ...print disk.N

Re: How to check for remaining hard drive space in Windows?

2007-02-28 Thread Tim Golden
kevinliu23 wrote: > Thanks so much for the help guys. I got the code Sick Monkey provided > to work on my computer. Now I"m more confused than ever though. :) I > thought the only standard modules provided by Python are listed here: > > http://docs.python.org/modindex.html > > But it appears that

Re: How to check for remaining hard drive space in Windows?

2007-03-01 Thread Tim Golden
kevinliu23 wrote: > Just tried your solution Tim, worked like a charm. :) > > It's great because I don't even have to worry about the computer name. > A question regarding the rootPath parameter...how would I be passing > it? Would I be passing it as... > >tuple = win32api.GetDiskFreeSpace(r'

Re: How to check for remaining hard drive space in Windows?

2007-03-01 Thread Tim Golden
[EMAIL PROTECTED] wrote: > HI, > > I am new to Python and wanted to know how to check for the remaining > disk space on my Windows machine using Python? I was thinking of using > the command line "dir" and trying to extract the output from there. > But I'm not sure how to extract command line stri

Re: Reading csv files using SQL

2007-03-01 Thread Tim Golden
Pablo was Paolo wrote: > [EMAIL PROTECTED] ha scritto: >> If you want to work directly with the files why not just use Python's csv >> module? > > Now, with Java, I use the same class to read several databases and csv > files (with SQL instructions). > I'd like to find a library for using the sam

Re: Python win32 tools

2007-03-02 Thread Tim Golden
Sick Monkey wrote: > I am trying to build a python program that will reset a user's account > (password) on a windows machine. I have been working with win32 > objects and was wondering if this functionality was already built in. I'm going to assume that "win32 objects" is the stuff in the pywin32

Re: Python Extension Building Network

2007-11-09 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi, > > I am trying to get a small group of volunteers together to create > Windows binaries for any Python extension developer that needs them, > much like the package/extension builders who volunteer their time to > create Linux RPMs. > > The main thing I need are peo

Re: Python Extension Building Network

2007-11-09 Thread Tim Golden
[EMAIL PROTECTED] wrote: > The hardest part was finding accurate information. Most people on the > user groups have been unhelpful or sarcastic. That's a shame to hear. Because you were building on Windows? Or for some other reason? (I ask because, even here on the Python lists, reactions like "G

Re: Volume id

2007-11-15 Thread Tim Golden
Gabor Urban wrote: > OK, you are right... Problem was not precise enough. I need to process CDs > to create a list. Does it ring a bell for you? On Windows, at least, you can do this with WMI: import win32com.client wmi = win32com.client.GetObject ("winmgmts:") for result in wmi.ExecQuery (

Re: Finding out what other tasks are running

2007-11-23 Thread Tim Golden
Jeremy C B Nicoll wrote: > Is there a cross-platform of determining what other processes (or in Windows > terms, other applications) are running? > > Is it possible in a cross-platform way to ask some other application to shut > down, wait a while, and then test to see if it did shut? > > Failing

Re: Finding out what other tasks are running

2007-11-23 Thread Tim Golden
Jeremy C B Nicoll wrote: > Is there a cross-platform of determining what other processes (or in Windows > terms, other applications) are running? > > Is it possible in a cross-platform way to ask some other application to shut > down, wait a while, and then test to see if it did shut? > >

Re: Finding out what other tasks are running

2007-11-23 Thread Tim Golden
Tim Golden wrote: > Jeremy C B Nicoll wrote: >> Is there a cross-platform of determining what other processes (or in Windows >> terms, other applications) are running? >> >> Is it possible in a cross-platform way to ask some other application to shut >> down, wait

Re: count pages in a pdf

2007-11-27 Thread Tim Golden
[EMAIL PROTECTED] wrote: > is it possible to parse a pdf file in python? for starters, i would > like to count the number of pages in a pdf file. i see there is a > project called ReportLab, but it seems to be a pdf generator... i > can't tell if i would be able to parse a pdf file programmically

Re: looking for ocbc example

2007-11-28 Thread Tim Golden
Carl K wrote: > jay graves wrote: >> On Sep 21, 2:43 am, Tim Golden <[EMAIL PROTECTED]> wrote: >>> Carl K wrote: >>>> It seems there are 2 odbc modules - pyOdbc and mxOdbc - anyone know the >>>> difference? >>> In short, pyodbc is open sour

Re: "Python" is not a good name, should rename to "Athon"

2007-11-30 Thread Tim Golden
Tim Couper wrote: > but it would mean that a version for large duration projects would be > "MarAthon" ... Can't decide whether you were deliberately avoiding "long-running" there, Tim, or just missed the opportunity :) TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: PIL + show() + Vista

2007-11-30 Thread Tim Golden
Méta-MCI (MVP) wrote: > Hi, Tim! > > You are right, for shimgvw.dll (on XP / 2000, or some Vista). But > others Vista (ou users practice) had associate images with > WindowsPhotoGallery.exe. > > But shimgvw.dll already exist. > > I found that this line: > > command = 'start "%s"

Re: PIL + show() + Vista

2007-11-30 Thread Tim Golden
Méta-MCI (MVP) wrote: > Re! > > I have found the problem. On Vista, the Windows-Photo-Galery (soft > default displayer) don't wait. Even with START /WAIT (in Image.py & > _showxv), it don't wait. > > Then, like the preview don't wait, the (next) "DEL" run prior the end of > the launch of th

Re: PIL + show() + Vista

2007-11-30 Thread Tim Golden
Méta-MCI (MVP) wrote: [Excuse my execrable French below] > Sorry, I don't understand english. But, with Babelfish-translation, I > recovered essence... > (you should learn French ; yes! yes! yes!) Vraiment! > I have just try on another CPU, with a very new Vista-premium > (configuration of

Re: "Show this file in explorer"

2007-12-01 Thread Tim Golden
farsheed wrote: > I have a big problem. I have a list of files that my script find and > list them in a little gui. > I need this function: > > when i d-click on each item, I want explorer opens and selects that > item inside windows explorer. > like that beautiful buttom in iTunes. Experiment wi

Re: "Show this file in explorer"

2007-12-01 Thread Tim Golden
farsheed wrote: > That was great. Thanks so so much. > can you tell me where can I find that kind of trips? (assuming "kind of tips") I stuck "explorer command line options" into Google and... Bingo! (All right, I'm cheating a bit: I knew that explorer *had* comman

Re: os.access() under windows

2007-12-03 Thread Tim Golden
Yann Leboulanger wrote: > Martin v. Löwis a écrit : >>> I create a folder test under e: >>> >>> then os.access('e:\\test', os.W_OK) returns True. Everything's ok. >>> >>> Now I move My Documents to this e:\test folder >>> >>> Then os.access('e:\\test', os.W_OK) returns False !! >> This description

Re: os.access() under windows

2007-12-03 Thread Tim Golden
Tim Golden wrote: > Yann Leboulanger wrote: >> Martin v. Löwis a écrit : >>>> I create a folder test under e: >>>> >>>> then os.access('e:\\test', os.W_OK) returns True. Everything's ok. >>>> >>>> Now I move My Do

Re: os.access() under windows

2007-12-03 Thread Tim Golden
Yann Leboulanger wrote: > Tim Golden a écrit : >> >> I'm happy to contribute a doc patch if I can imagine what >> exactly to write. >> > > "Don't use it under windows, always consider it's True"? Well, that's not the case for

Re: Process Id

2007-12-03 Thread Tim Golden
Navid Parvini wrote: > Dear All, > > Would you please help me to find a way to get the list of all processes id > on the machine along with their parent processes. > > Thank you in advance. Deja vu? http://groups.google.com/group/comp.lang.python/search?q=list+process TJG -- http:/

Re: os.access() under windows

2007-12-03 Thread Tim Golden
Yann Leboulanger wrote: > Ok thanks for all those information, I'll remove the call to os.access() > on folders for windows in my application. > FWIW, I think it's worth bearing in mind what was said earlier in this thread: it's easier to ask forgiveness than permission. Technically, even if os.

Re: os.access() under windows

2007-12-04 Thread Tim Golden
Martin v. Löwis wrote: > It would be possible to fix this specific case, by always > returning True for directories; and perhaps I'll do that for > 2.5.2. Martin. Could you confirm that the outline below correctly describes the behaviour of the os.access function under Windows, please? If you conf

Re: os.access() under windows

2007-12-04 Thread Tim Golden
Martin v. Löwis wrote: >> Martin. Could you confirm that the outline below correctly >> describes the behaviour of the os.access function under >> Windows, please? > > It's correct for Python 2.5.2 and 2.6; for 2.5.1 (as discussed) > the test "if directory:return True" was not implemented. Thanks

Re: os.access() under windows

2007-12-04 Thread Tim Golden
Martin v. Löwis wrote: >> Now, ironically, I'm confused by your recap :) What I meant to say was >> that the os.access function as implemented under Windows returns False >> if the path in question (say, "x:\someones-private-docs\diary.doc") was >> inaccessible to the process invoking os.access by

Re: os.access() under windows

2007-12-05 Thread Tim Golden
[apologies if this double-posts; my email server's playing up] 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 acce

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