Re: Invoking CutePDF from within Python

2009-02-13 Thread Tim Golden
pyt...@bdurham.com wrote: Tim, FWIW, I usually generate PDFs by printing to a Postscript printer (some random Apple Laserthingy) and then using Ghostscript to do the conversion. I'm happy to post if you're interested. If its not too much bother, I would be interested in learning how you're

Re: GetKeyboardLayoutName Win32API

2009-02-15 Thread Tim Golden
Tsolakos Stavros wrote: Hi all. I was trying to find a way to read the currently selected input layout from an app written in python. I am aware that if the app were written in C, I would have to call the GetKeyboardLayoutName() function. How can this be done in Python? I want to avoid writing a

Re: Pythonic way to determine if a string is a number

2009-02-15 Thread Tim Golden
pyt...@bdurham.com wrote: # str_to_num.py def isnumber( input ): try: num = float( input ) return True except ValueError: return False Just for the info, Malcolm, you don't actually need to assign the result of float (input) to anything if you don't need to u

Re: How to enum all the users from a windows domain via python win32net module?

2009-02-16 Thread Tim Golden
vimuser wrote: I tried the command "net user /DOMAIN" in windows console(cmd.exe), and it showed me all the usernames in my domain without any problems. But when I tried it in python with these commands : info=win32net.NetUserEnum("DOMAIN_NAME",1), info=win32net.NetUserEnum(r"\\DOMAIN_NAME",1),an

[Fwd: Re: Pythonic way to determine if a string is a number]

2009-02-16 Thread Tim Golden
[Resending after a bounce from mailing list] pyt...@bdurham.com wrote: try: float (input) except ValueError: return False else: return True I follow the semantics, but I don't know why I would prefer the try/else technique over the simpler: try: float( input ) return True exc

Re: Is there something easier than ORM?

2009-02-17 Thread Tim Golden
Philip Semanchuk wrote: [... snip comments on SqlAlchemy which could likewise apply to other similar offerings ...] I don't intend this as a criticism of SqlAlchemy. On the contrary I am impressed by what it does. But I often see people promoting ORM as the solution to all database access prob

Re: Metaclass conflict TypeError exception: problem demonstration script

2009-02-23 Thread Tim Golden
$ cat -n metaclass_test01.py | head 1 #!/usr/bin/env python 2 3 import sys 4 import wx 5 import CopyAndPaste 6 7 class ListControl(wx.Frame, CopyAndPaste): 8 #class ListControl(wx.Frame): 9 def __init__(self, parent, id, title, list, max_list

Re: 11001, 'getaddrinfo failed' : Error in httplib but not in urllib2

2008-12-01 Thread Tim Golden
RajNewbie wrote: Hi all, I am trying to connect to localhost via httplib, but it fails. To check whether it is a firewall problem etc, I tried to connect via urllib2, but it went through fine. Could some one help me out on this? I cannot use urllib2 in the program because I have to

Re: UnicodeDecodeError quick question

2008-12-04 Thread Tim Golden
[EMAIL PROTECTED] wrote: Hi Everyone, I am using Python 2.4 and I am converting an excel spreadsheet to a pipe delimited text file and some of the cells contain utf-8 characters. I solved this problem in a very unintuitive way and I wanted to ask why. If I do, csvfile.write(cell.encode("utf-8

Re: Can I load a python program at the interactive >>> prompt?

2008-12-05 Thread Tim Golden
walterbyrd wrote: I am running cygwin on xp. Much to my annoyance, I can not cut-and-paste from a windows app to the python prompt. I think I could do this with putty, but I do not have the permissions to install putty on my xp box. I do this all the time. The key (altho' not strictly essentia

Re: Can I load a python program at the interactive >>> prompt?

2008-12-05 Thread Tim Golden
walterbyrd wrote: I am running cygwin on xp. and I just noticed this vital bit. So not sure how much of my other post applies. Sorry. Maybe it'll help anyway. :) TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Transferring a file over sockets

2008-12-17 Thread Tim Golden
Ferdinand Sousa wrote: I am using sockets to transfer a file over LAN. There are 2 scripts, the server opens a listens for connection and the client is run on another machine. I always make sure the server is run first. The strange thing is that if the the server script is double-clicked and exec

Re: join a samba domain

2008-12-22 Thread Tim Golden
Toff wrote: hi, I 'm trying to write a script to make my computer join a samba. domeone have any idea ?? Ummm. It's not clear if you're saying that your code doesn't work, or asking for general advice, or what? I'm not in a position to have my machine join a domain or workgroup, but you seem

Re: join a samba domain

2008-12-22 Thread Tim Golden
Toff wrote: On 22 déc, 17:02, Tim Golden wrote: Toff wrote: hi, I 'm trying to write a script to make my computer join a samba. domeone have any idea ?? Ummm. It's not clear if you're saying that your code doesn't work, or asking for general advice, or what? I'm not

Re: join a samba domain

2008-12-23 Thread Tim Golden
Toff wrote: On 22 déc, 19:37, Toff wrote: On 22 déc, 18:59, Jens Henrik Leonhard Jensen wrote: Toff wrote: d = c.Win32_ComputerSystem d.JoinDomainOrWorkGroup(None, 3, "mydom", "mydompw", r"admin\\mydom") Shouldn't r"admin\\mydom" be "admin\\mydom" or r"admin\mydom". Or maybe just "

Re: Problem while reading an outlook in box using python.

2008-10-08 Thread Tim Golden
[EMAIL PROTECTED] wrote: Hello, I was getting an error in Cocreate instance while trying to access "Outlook" using python script. The python script looks like: from win32com.client import Dispatch session = Dispatch("MAPI.session") session.Logon('OUTLOOK') # MAPI profile name inbox =

Re: Problem while reading an outlook in box using python.

2008-10-08 Thread Tim Golden
[EMAIL PROTECTED] wrote: May I know how to check whether my Outlook is installed with CDO components? There is no entry in my Registry Database with the name MAPI.Session. Well, that pretty much *is* the check. Get hold of your Office install disk and do a reinstall and look out for suboption

Re: Getting windows error while making a backup

2008-10-17 Thread Tim Golden
[EMAIL PROTECTED] wrote: Hi, I've this backup script that having some problems. Please some one suggest what is that I'm missing in it. This backup script deletes the previous backups and then create a new backup by simply renaming the original folder to backup folder and creates a new folder.

Re: pymssql - execute loads all results into memory!

2008-10-20 Thread Tim Golden
Eric Wertman wrote: I am trying to use pymssql, and have an issue where by the execute (not the fetch) is appearing to load all records into memory. if I execute con = pymssql.connect(...) cur = con.cursor() cur.execute(sql) rec = cur.fetchone() if I put in a query which returns a lot of reco

Re: Abnormal Interpreter Shutdown

2008-10-20 Thread Tim Golden
k3xji wrote: Hi all, Is there anyway to detect abnormal interpreter shutdown like (closing from task manager, power shutdown of the PC..etc)? "Task Manager" suggests you're using Windows, on which basis you've got a few options open to you, but fundamentally if someone pulls the plug on the PC

Re: pymssql - execute loads all results into memory!

2008-10-21 Thread Tim Golden
Aspersieman wrote: However, pyODBC doesn't support return variables(parameters) in stored procedures (at least with MS SQL). pymssql is the only db api for python that I've found that can reliably do this. I've tried adodbapi, pyodbc and one or two others (can't think of the names now... :-/).

Re: pymssql - execute loads all results into memory!

2008-10-21 Thread Tim Golden
Aspersieman wrote: [... re output params in pymssql / pyodbc ...] Oh, trust me - I've tried a *LOT*. I aggree, submitting a feature request is a good idea. I think I'll do that. :) Looks like someone already has: http://sourceforge.net/tracker/index.php?func=detail&aid=1985956&group_id=162557

Re: Exclude Directories from os.walk

2008-10-21 Thread Tim Golden
D wrote: Hello, How can one exclude a directory (and all its subdirectories) when running os.walk()? Just remove it from the dirnames yielded: import os for dirpath, dirnames, filenames in os.walk ("c:/temp"): print dirpath if "archive" in dirnames: dirnames.remove ("archive") TJG -

Re: Dummy explanation to win32com needed

2008-10-23 Thread Tim Golden
korean_dave wrote: Hi. I need a dummy's explanation to utilizing the win32com component to access Microsoft Excel. So far, I have this code. import win32com.client xl = win32com.client.Dispatch("Excel.Application") xl.Visible = 1 workbook = xl.Workbooks.Open("C:\test.xls") We

Re: open a new terminal window from another terminal window in linux/unix system

2008-10-31 Thread Tim Golden
gaurav kashyap wrote: I am using Microsoft Windows XP.Using putty.exe,I connected to LINUX server and a terminal window gets opened.Here i logeed in as root. What i want to do is open another terminal window from already opened terminal window. Can this be achieved.If yes,please provide a teste

Re: Windows DOS box redirection

2008-10-31 Thread Tim Golden
Bill McClain wrote: On 2008-10-31, Glenn Linderman <[EMAIL PROTECTED]> wrote: The problem with stdin/stdout is on Windows 2000 (and maybe the earlier NT?). But not on XP or AFAIK Vista. It only occurs when a program is executed indirectly using the file associations instead of directly via

Re: Windows DOS box redirection

2008-10-31 Thread Tim Golden
Bill McClain wrote: On 2008-10-31, Stef Mientki <[EMAIL PROTECTED]> wrote: Well I don't know any Windows users that still use DOS-boxes ;-) cheers, What do they do when they want to run a cross-platform command-line script with parameters and redirection? I think it's a slight dig at the no

Re: Extract frame from wmv

2008-11-05 Thread Tim Golden
Martin wrote: I need to extract a frame from a wmv file and save it as a jpg. In fact I need to extract a frame from each one of a collection of several thousand wmv files, but that's beside the point. I've actually written a script that does exactly this using the pyglet module. But while it

Re: Extract frame from wmv

2008-11-05 Thread Tim Golden
Martin wrote: I've looked at Pymedia but I have to admit I couldn't work it out. Commandline might be good, but I'm really hoping someone can point me in the right direction, as this is not my area of expertise. Nor mine :) Just so people can help you out, can you be more precise in your req

Re: (Windows) "Dropping" stuff onto a Python script

2008-11-06 Thread Tim Golden
[EMAIL PROTECTED] wrote: Hello people, I'd like to have the functionality known from "real" executables that if I drag-drop a file icon on top of the app, the app starts and has the file's path as command-line argument. However, this doesn't seem to work with Python scripts because Windows sees

Re: Extract frame from wmv

2008-11-06 Thread Tim Golden
Martin wrote: Lawrence D'Oliveiro wrote: In message <[EMAIL PROTECTED]>, Tim Golden wrote: Alternatively, you might be able to commandline control mencoder or ffmpeg itself to do this. Not sure, but there must be *something* among those millions of command-line options!

Re: More __init__ methods

2008-11-06 Thread Tim Golden
Mr.SpOOn wrote: Hi, I know there can be only one __init__ method (at least, I think). Often I need an object to be created in different ways, for example passing a string as argument, or an integer, or another object. To achieve this I put the default value of the arguments to None and then I so

Re: More __init__ methods

2008-11-06 Thread Tim Golden
Mr.SpOOn wrote: On Thu, Nov 6, 2008 at 4:59 PM, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: class A(object): def __init__(self, a, b, c): self.a = a # ... @classmethod def from_string(cls, s): # ... return cls(a, b, c) Thanks. I think it's time to

Re: Does Python have Multiple Inheritance ?

2008-11-07 Thread Tim Golden
Aaron Gray wrote: "Roy Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] In article <[EMAIL PROTECTED]>, Tim Golden <[EMAIL PROTECTED]> wrote: Aaron Gray wrote: Wikipedia says Python has Multiple Inheritance, is this true ?

Re: Does Python have Multiple Inheritance ?

2008-11-07 Thread Tim Golden
Aaron Gray wrote: Wikipedia says Python has Multiple Inheritance, is this true ? http://en.wikipedia.org/wiki/Multiple_inheritance Thanks, Aaron Good grief. You can use Wikipedia but you can't use Google? http://www.google.co.uk/search?q=python+multiple+inheritance TJG -- http://mail.p

Re: Python COM: Automatic wrap/unwrap?

2008-11-10 Thread Tim Golden
greg wrote: Larry Bates wrote: You should post this on comp.python.windows as Mark and the other Windows/COM gurus hang around there a lot. I can't find any such newsgroup -- are you sure that's what it's called? I think that's what it's called on gmane (or some other newsgroup gateway). Fr

Re: Problems Writing £ (pound sterling) To MS SQL Server using pymssql

2008-11-17 Thread Tim Golden
Darren Mansell wrote: Hi. I'm relatively new to python so please be gentle :) I'm trying to write a £ symbol to an MS SQL server using pymsssql . This works but when selecting the data back (e.g. using SQL management studio) the £ symbol is replaced with £ (latin capital letter A with circumf

Re: sorting list of complex numbers

2008-11-21 Thread Tim Golden
Steven D'Aprano wrote: On Wed, 19 Nov 2008 18:39:27 -0800, Paul Rubin wrote: Terry Reedy <[EMAIL PROTECTED]> writes: Do your tuple destructuring in the first statement in your body and nothing will break. Why get rid of a useful feature that unclutters code? Unfortunately, the people who fi

Re: Need help converting text to csv format

2008-11-21 Thread Tim Golden
it's so easy to use the stdlib csv module that I'd always recommend that, especially as it covers all those annoying corner cases with embedded commas and quotes and stuff. And it's tested to hell and back. In general, for a list of field tuples: import csv fields = [ ("Ti

Re: Need help converting text to csv format

2008-11-21 Thread Tim Golden
Joe Strout wrote: A follow-up question here... is it really necessary to close things like files in Python? I've been slumming it in the REALbasic community for the last decade, where you generally don't worry about such things, as any object that represents something "open" will automatically

Re: Need help converting text to csv format

2008-11-21 Thread Tim Golden
Tim Chase wrote: yes, the CSV module has some wonderful stuff in it, and I regularly use it for *reading* CSV files. But for writing them, it's often just as fast (for my purposes) to simply code my 1st post's quickie as it is to scrounge in the docs/docstrings to remember how to let the CSV d

Re: Solved: Metaclass conflict TypeError exception: problem demonstration script

2009-02-23 Thread Tim Golden
Barak, Ron wrote: That's it. Once I changed my class header to: $ cat -n metaclass_test01.py 1 #!/usr/bin/env python 2 3 import sys 4 import wx 5 import CopyAndPaste 6 7 class ListControl(wx.Frame, CopyAndPaste.CopyAndPaste): I'm getting no more Metaclas

Re: How do I decode unicode characters in the subject using email.message_from_string()?

2009-02-25 Thread Tim Golden
Thorsten Kampe wrote: * Gabriel Genellina (Wed, 25 Feb 2009 14:00:16 -0200) En Wed, 25 Feb 2009 13:40:31 -0200, Thorsten Kampe escribió: * Roy H. Han (Wed, 25 Feb 2009 10:17:22 -0500) Thanks, RDM, for stating the right approach. Thanks, Steve, for teaching by example. I wonder why the email

Re: OT: handling multiple software repositories

2009-02-26 Thread Tim Golden
Thomas Guettler wrote: Hi, this is a bit off topic. In our company we have several SVN repositories. According to [1] Trac by default only handles one repository. Of course Trac links like changeset [1234] would not work anymore. You would need [repro/1234] or something like this. I think ma

Re: OT: handling multiple software repositories

2009-02-27 Thread Tim Golden
Loretta SALINO wrote: Tim Golden wrote: Thomas Guettler wrote: Hi, this is a bit off topic. In our company we have several SVN repositories. According to [1] Trac by default only handles one repository. Of course Trac links like changeset [1234] would not work anymore. You would need

Re: How can I know when a sub-process is effectively initialized?

2009-02-27 Thread Tim Golden
Giampaolo Rodola' wrote: It seems to work fine on posix but we still got problems on Windows where it seems that waiting for pid to show up in the system process list is not enough for considering the process effectively initialized. Anyway, I think it's a problem in our code. Thanks for your hel

Re: c.Win32_OperatingSystem question.

2009-02-28 Thread Tim Golden
bryan rasmussen wrote: Maybe there's a more specific list I should ask this question on but I don't know what it is. I'm using Tim Golden's wmi stuff, and putting my output into an XML document. I have the following bit of code [.. snip ...] At the end of that thhe only text node thaht comes

Re: Python and Windows Services Question

2009-03-04 Thread Tim Golden
Phoe6 wrote: This is a windows services question. The following script which is a windows service was supposed to something ( download wallpaper and set the desktopwallpaper) at 16:45 my time here. The service is running, but the supposed action did not take place. Does anyone who is aware of win

Re: Problem in accessing long paths.

2009-03-06 Thread Tim Golden
venutaurus...@gmail.com wrote: > Hello All, > I have a requirement where I've to access folders with > path lengths >255 ( Windows only supports 255). To do this I've > created junction points for the folders whose length is > 255. The problem is my python script is unable to recognize

Re: Windows install to custom location after building from source

2009-03-08 Thread Tim Golden
Gabriel Genellina wrote: En Fri, 06 Mar 2009 06:52:00 -0200, escribió: I have succeeded in building Python 2.6.1 from source under Windows XP by running Visual C++ 2008 Express on the PCbuild/pcbuild.sln file both from the Visual C++ application as well as from the commandline [...] I would li

Re: Set & Frozenset?

2009-03-08 Thread Tim Golden
Diez B. Roggisch wrote: Hans Larsen schrieb: Could you help me ? How could I "take" an elemment from a set or a frozenset .-) ? From a string (unicode? Python<3), or from a tuple,or from a list: Element by index or slice. From a dict: by k

Re: Set & Frozenset?

2009-03-08 Thread Tim Golden
Tim Golden wrote: Diez B. Roggisch wrote: Hans Larsen schrieb: Could you help me ? How could I "take" an elemment from a set or a frozenset .-) ? From a string (unicode? Python<3), or from a tuple,or from a list: Element by i

Re: Sharing objects between processes

2009-03-08 Thread Tim Golden
ET wrote: Using the 'with' keyword didn't work... Just an aside here for any multiprocessing maintainers watching ;) . I expect that the "didn't work" here refers to this bug: http://bugs.python.org/issue5261 Altho' if the OP cares to clarify, it might be something else. TJG -- http://mail.

Re: Windows install to custom location after building from source

2009-03-08 Thread Tim Golden
Martin v. Löwis wrote: In addition, the CVS version of pywin32 which I built in order to run the msi.py script has a small bug in genpy which prevents it from generating COM support in the way in which msi.py does it. I'm using Python 2.4 to run msi.py; that has always worked fine for me. Int

Re: Windows install to custom location after building from source

2009-03-08 Thread Tim Golden
Scott David Daniels wrote: Tim Golden wrote: ... Anyhow, at the end I have a working Python 2.7a0 running under Windows. Do you mean 3.1a0? As far as I know, 2.7a0 requires the use of the time machine, as it is expected to be 3 months out. No; 2.7a0 is the version number of the svn HEAD

Re: Windows install to custom location after building from source

2009-03-08 Thread Tim Golden
Martin v. Löwis wrote: What does the merge do? I can't find mention of it in the docs. It merges the msvcrt merge module into the installer (and then monkey patches it, to revert the msm decision of setting ALLUSERS). I tried to integrate it originally as a step after creating the msi. Unfortun

Re: Windows install to custom location after building from source

2009-03-08 Thread Tim Golden
Martin v. Löwis wrote: merge.py attempts to import config.py but I can't find it... Just create an empty one. Won't quite work: merge tries to find full_current_version which is determined (if None) in msi.py from the rather involved current version stuff. I'm going to give up on this for to

Re: Windows install to custom location after building from source

2009-03-08 Thread Tim Golden
Martin v. Löwis wrote: Just create an empty one. Won't quite work: merge tries to find full_current_version which is determined (if None) in msi.py from the rather involved current version stuff. Only if you don't pass an msi file on the command line. So I recommend that you do that. OK.

Re: Windows install to custom location after building from source

2009-03-09 Thread Tim Golden
Tim Golden wrote: Martin v. Löwis wrote: Just create an empty one. Won't quite work: merge tries to find full_current_version which is determined (if None) in msi.py from the rather involved current version stuff. Only if you don't pass an msi file on the command line. So I reco

Re: Windows install to custom location after building from source

2009-03-09 Thread Tim Golden
Martin v. Löwis wrote: AFAICT, it only complained about errors in merging _Validation. I'm not sure whether I get the same errors (I would have to check); those errors can safely be ignored. Good. I also see that it fails to add custom actions into InstallExecuteSequence. I find that puzzling

Re: Windows install to custom location after building from source

2009-03-10 Thread Tim Golden
Martin v. Löwis wrote: BTW what are your feelings on a patch to msi.py to change the names of the directories it's looking for to pick up the Tk licenses? It's a bit of a grey area since the only "canonical" reference I can find is the externals checkout from within tools\buildbot: you might as w

Re: Windows install to custom location after building from source

2009-03-10 Thread Tim Golden
Martin v. Löwis wrote: First, it relies on config.py whose existence msi.py optionally ignores. Feel free to create a patch for that. http://bugs.python.org/issue5467 TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows install to custom location after building from source

2009-03-10 Thread Tim Golden
Martin v. Löwis wrote: I also see that it fails to add custom actions into InstallExecuteSequence. I find that puzzling - apparently, it tries to merge the twice. Are you sure you didn't run it twice? It will certainly fail the second time. Just to confirm: I'm certainly only running this once

Re: Windows install to custom location after building from source

2009-03-10 Thread Tim Golden
Tim Golden wrote: However, the .msi installs (and Python runs) without issue on a virgin VirtualXP. And it passes the basic test suite ok. I lied. test_zipfile fails because the new(ish) zipdir.zip doesn't get carried across to the install. Patched in: http://bugs.python.org/issue547

Python 2.7 MSI / pywin32 snapshots [was: Windows install to custom location ...]

2009-03-10 Thread Tim Golden
Scott David Daniels wrote: Tim Golden wrote: ... Anyhow, at the end I have a working Python 2.7a0 running under Windows. Do you mean 3.1a0? As far as I know, 2.7a0 requires the use of the time machine, as it is expected to be 3 months out. If you do get an installer built, even having a

Re: Problem with os.chdir()

2009-03-10 Thread Tim Golden
venutaurus...@gmail.com wrote: Hello all, I am writing a python script which has to access deep paths then supported normally by the Windows OS (>255). So I am appending "\ \?\" to do so. But when I use the path in the above fashion with os.chdir() it is unable to recognize my folder a

Re: Problem with os.chdir()

2009-03-11 Thread Tim Golden
venutaurus...@gmail.com wrote: On Mar 11, 11:08 am, Tim Golden wrote: venutaurus...@gmail.com wrote: Hello all, I am writing a python script which has to access deep paths then supported normally by the Windows OS (>255). So I am appending "\ \?\" to do so. But when I

Re: Problem with os.chdir()

2009-03-11 Thread Tim Golden
Here is my code snippet which you will be interested in: Indeed. file = ur'\\?\C:\\TestDataSet\DeepPaths \DeepPathLevel01\DeepPathLevel02\DeepPathLevel03\DeepPathLevel04\DeepPathLevel05\DeepPathLevel06\DeepPathLevel07\DeepPathLevel08\DeepPathLevel09\DeepPathLevel10\DeepPathLevel11\DeepPathLeve

Re: Problem with os.chdir()

2009-03-11 Thread Tim Golden
venutaurus...@gmail.com wrote: On Mar 11, 5:19 pm, Tim Golden wrote: Here is my code snippet which you will be interested in: Indeed. file = ur'\\?\C:\\TestDataSet\DeepPaths \DeepPathLevel01\DeepPathLevel02\DeepPathLevel03\DeepPathLevel04\DeepPathLe vel05\DeepPathLevel06\DeepPathLe

Re: Problem with os.chdir()

2009-03-11 Thread Tim Golden
venutaurus...@gmail.com wrote: On Mar 11, 6:41 pm, Tim Golden wrote: venutaurus...@gmail.com wrote: On Mar 11, 5:19 pm, Tim Golden wrote: Here is my code snippet which you will be interested in: Indeed. file = ur'\\?\C:\\TestDataSet\DeepPaths \DeepPathLevel01\DeepPathLe

Re: Behaviour of os.rename()

2009-03-11 Thread Tim Golden
venutaurus...@gmail.com wrote: Hello all, I got a suspicion on the behaviour of os.rename (src,dst).If the src is the path of a file and dst is a new filename this os.rename() function is infact creating a new file with the dst name in the current working directory and leaving the src

Re: Problem with os.chdir()

2009-03-11 Thread Tim Golden
venutaurus...@gmail.com wrote: On Mar 11, 7:17 pm, Tim Golden wrote: venutaurus...@gmail.com wrote: On Mar 11, 6:41 pm, Tim Golden wrote: venutaurus...@gmail.com wrote: On Mar 11, 5:19 pm, Tim Golden wrote: Here is my code snippet which you will be interested in: Indeed. file = ur

Re: Problem with os.chdir()

2009-03-11 Thread Tim Golden
Hendrik van Rooyen wrote: "Tim Golden" wrote: Well, a little bit of experimentation shows that you can *create* paths this deep (say, with os.mkdir). But you can't actually set the current directory to it. So the Is this also true if you try to go there by a succession of

Re: Python 2.7 MSI / pywin32 snapshots [was: Windows install to custom location ...]

2009-03-12 Thread Tim Golden
Scott David Daniels wrote: Tim Golden wrote: Scott David Daniels wrote: Tim Golden wrote: ... Anyhow, at the end I have a working Python 2.7a0 running under Windows. Do you mean 3.1a0? As far as I know, 2.7a0 requires the use of the time machine, as it is expected to be 3 months out. If

Re: How to find "in" in the documentation

2009-03-14 Thread Tim Golden
Colin J. Williams wrote: Piet van Oostrum wrote: tinn...@isbd.co.uk (t) wrote: t> I've had this trouble before, how do I find the details of how "in" t> works in the documentation. E.g. the details of:- t> if string in bigstring: t> It gets a mention in the "if" section but not a l

Re: How to find "in" in the documentation

2009-03-14 Thread Tim Golden
jkn wrote: On Mar 14, 7:00 am, Tim Golden wrote: Well, this may not solve the OP's problem, but the current (2.7a0) .chm file has a much better index for operators and keywords. And "in" is in there. If you're interested in comparing, there's a copy here: http

Re: How to find "in" in the documentation

2009-03-14 Thread Tim Golden
Colin J. Williams wrote: Tim Golden wrote: Colin J. Williams wrote: Piet van Oostrum wrote: tinn...@isbd.co.uk (t) wrote: t> I've had this trouble before, how do I find the details of how "in" t> works in the documentation. E.g. the details of:- t> if strin

Re: PyWin32 for Python 3.x

2009-03-14 Thread Tim Golden
John Nagle wrote: Any idea when PyWin32 will be available for Python 3.x? John Nagle Release 213 is out already: http://sourceforge.net/project/showfiles.php?group_id=78018&package_id=79063&release_id=661475 I think it's still considered a little bit beta. There have been

Re: PyWin32 for Python 3.x

2009-03-15 Thread Tim Golden
John Nagle wrote: That "wizard" won't even install unless Python 3.0 is "in the registry", which apparently means "installed as the default Python". No, it just means "installed somewhere". I have 6 different versions of Python installed on this box. The choice of which is "the default" is m

Re: PyWin32 for Python 3.x

2009-03-15 Thread Tim Golden
John Nagle wrote: Well, of some other packages I use: MySQLdb: "Python versions 2.3-2.5 are supported." Ref: http://sourceforge.net/projects/mysql-python M2Crypto: Latest version is for Python 2.6. Ref: http://chandlerproject.org/bin/view/Projects/MeTooCrypto Somebody

Re: how to identify the file system type of a drive?

2009-03-16 Thread Tim Golden
venutaurus...@gmail.com wrote: hi all, Is there any way to identify the File system type of a drive in python in Windows? Some thing like: C:\ -- NTFS D:\ -- FAT32.. import win32api import win32file def file_system (drive_letter): return win32api.GetVolumeInformation ( win32fil

Re: Problem while copying a file from a remote filer

2009-03-17 Thread Tim Golden
Jorgen Grahn wrote: On Sun, 15 Mar 2009 22:47:54 -0700, Chris Rebert wrote: On Sun, Mar 15, 2009 at 10:24 PM, venutaurus...@gmail.com wrote: Hi all, I have to write an application which does a move and copy of a file from a remote machine to the local machine. I tried something like: fi

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tim Golden
venutaurus...@gmail.com wrote: Hello all, Is there any way to list out all the properties (name, type, size) and attributes( Accesstime, mod time, archived or readonly etc) of a folder and its contents recursively. Should I need ot go inside each and every directory to list them? This

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tim Golden
Tino Wildenhain wrote: Tim Golden wrote: ... and do the following: from winsys import fs for f in fs.flat ("c:/temp"): f.dump () ^ eeek! Was the k! for the space before the bracket (which, for some unaccountable reason disturbs some people)? Or for the idea of du

Re: Preparing teaching materials

2009-03-20 Thread Tim Golden
Michele Simionato wrote: On Mar 20, 12:58 pm, grkunt...@gmail.com wrote: I am considering teaching a beginning programming course using Python. I would like to prepare my class handouts in such a way that I can import the Python code from real ".py" files directly into the documents. This way I

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-20 Thread Tim Golden
venutaurus...@gmail.com wrote: Thank you for your suggestion but.. I'll have around 1000 such files in the whole directory and it becomes hard to manage such output because again I've to take this snapshot before backing up the data and have to do the same and compare both when the data gets rest

Re: Preparing teaching materials

2009-03-20 Thread Tim Golden
Michele Simionato wrote: The interesting thing is that Sphinx uses pygments and can highlight any code fragment, not only Python code. For instance, last week I did some experiment with Sphinx to convert my "Adventures of a Pythonista in Schemeland" (which contains Scheme code) to PDF and it work

Re: A problem with subprocess

2009-03-20 Thread Tim Golden
Colin J. Williams wrote: Below is a test script: # tSubProcess.py import subprocess import sys try: v= subprocess.Popen('ftype py=C:\Python25\Python.exe') except WindowsError: print(sys.exc_info()) I'm assuming that you've previously done something like this: assoc .py=py and are now t

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-21 Thread Tim Golden
venutaurus...@gmail.com wrote: On Mar 20, 6:58 pm, Tim Golden wrote: venutaurus...@gmail.com wrote: Thank you for your suggestion but.. I'll have around 1000 such files in the whole directory and it becomes hard to manage such output because again I've to take this snapshot before

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-21 Thread Tim Golden
venutaurus...@gmail.com wrote: Thank you Sir for your reply. It is working for me. But is failing if I have Unicode characters in my path. I tried giving a 'u' in front of the path but still it fails at f.createdat. Does it support Unicode Characters? This the traceback which I got while running

Re: Obtaining the attributes and properties of a folder recursively.

2009-03-23 Thread Tim Golden
venutaurus...@gmail.com wrote: On Mar 21, 3:05 pm, Tim Golden wrote: venutaurus...@gmail.com wrote: Thank you Sir for your reply. It is working for me. But is failing if I have Unicode characters in my path. I tried giving a 'u' in front of the path but still it fails at f.createda

Re: How to get the version of a file on WinOS?

2009-03-26 Thread Tim Golden
Hill wrote: As you know , we can see the file version from by "right click menu and click the detail tab". Now i am wondering how to get this version number using python? Thanks very much! If you're talking about a .DLL then this is probably what you're looking for: http://timgolden.me.uk/pyth

Re: dblck py file run, setuptools, easy_install don't work

2009-03-26 Thread Tim Golden
Kevin Ar18 wrote: I just installed Python 3 64bit on Vista 64bit. I am having several issues: 1. I cannot launch python by typing "python" anywhere in the command line. (I added the Python directory to my PATH variable by the way). 2. Double clicking .py files does not run the files like it u

Re: Deleteing empty directories

2009-03-30 Thread Tim Golden
CinnamonDonkey wrote: Hi All, I've been scratching my head all afternoon trying to work out the best/ quickest way is to delete empty directories within a tree (Windows). I've looked at os.walk() but it seems to traverse the directory tree in the wrong order (is it possible to reverse the order

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Tim Golden
Steven D'Aprano wrote: On Mon, 30 Mar 2009 09:46:40 +0200, Hendrik van Rooyen wrote: Its kind of sad to see unladen swallow, which is just a promise, on the list, while Shedskin, which isn't, is ignored. Does this say something about big corporations vs the small man? No, what it says is tha

Re: usb mass storage device detection

2009-03-31 Thread Tim Golden
prakash jp wrote: Hi all, I am interested in detecting usb mass storage devices, r there any scripts in python to do so. Thanks in advance. What? Detecting their presence in your pocket? :) Which operating system are you using? It tends to make a difference: these things are quite OS-specific

Re: The spam to content ratio of this group

2009-04-01 Thread Tim Golden
s...@pobox.com wrote: Eric> is getting very high. Why aren't captcha's used to prevent all of Eric> this noise? Steven> /me opens mouth to make sarcastic comment Steven> /me shuts mouth again Steven> That's like saying "There's a lot of oil slicks washing up onto Steven>

Re: Cannot find text in *.py files with Windows Explorer?

2009-04-03 Thread Tim Golden
John Doe wrote: Anybody have a solution for Windows (XP) Explorer search not finding ordinary text in *.py files? It came up a couple of months ago either on this list or on python-win32. Don't have web access at the moment, but try searching the archives for references to search, registry set

Re: Creating a session in windows to auth to remote machines

2009-04-04 Thread Tim Golden
ericwoodwo...@gmail.com wrote: Hi, I'm trying to auth to remote machines so I can plunder WMI to get logs and settings and the like. My script works for most of my machines because they're all in the same domain and I run the script as somebody who has enough access to get at this stuff but

Re: Issue with subprocess Module

2009-04-07 Thread Tim Golden
Dave Angel wrote: tarun wrote: Hello All, I've a batch file to be invoke using a python script. The batch file has pause, and the time, I need to send some command to the batch file from my scripts. I placed both, the batch file (test.bat) and the python script (test.py) in the same folder.

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