Re: S2K DTS and Python

2007-07-10 Thread Tim Golden
Phil Runciman wrote: > I am a Python newbie so please be gentle on me. Welcome to Python. > I have created a program that takes text files within a directory and it > successfully parses the information from them to create 3 CSV files. Good so far. > However, I now want to update some tables in

Re: odbc module for python

2007-07-19 Thread Tim Golden
Steve Holden wrote: > Sean Davis wrote: >> What are the alternatives for accessing an ODBC source from python >> (linux 64-bit, python 2.5)? It looks like mxODBC is the only one >> available? >> > There is, I understand, a pyodbc module as well. Having never used it I > can't say how good it is.

Re: PY shutil on win xp home version

2007-04-18 Thread Tim Golden
jim-on-linux wrote: > python help, > > A client is using win xp home. > > my program contains; >shutil.copyfile(n, 'prn') > > This runs fine on win xp pro but they are getting > the following traceback. > > File "LOP_PRT_10.pyc", line 170, in __init__ > File "LOP_PRT_10.pyc", line 188,

Re: Helpbook and CHM

2007-04-19 Thread Tim Golden
Teja wrote: > how to generate CHM files in Boa(Python)??? http://www.rutherfurd.net/software/rst2chm/index.html TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Byte-Array to String

2007-04-19 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I have a byte array passed to me by dbus and I'm looking to convert it into > a string? Is that possible? Sorry for seeming like a putts with these > questions, I'm not used to all these complex data types :-D > > dbus.Array([dbus.Byte(54), dbus.Byte(0), dbus.B

Re: Byte-Array to String

2007-04-19 Thread Tim Golden
Robert Rawlins - Think Blue wrote: [... snip ...] > The first method, when I print its results just gives me > dbus.Array([dbus.UInt32(65547L)], signature=dbus.Signature('u')) the method > gives me that byte array and the third doesn't appear to work at all :-D > > Unfortunately nowhere seems to

Re: PY shutil on win xp home version

2007-04-20 Thread Tim Golden
jim-on-linux wrote: > On Wednesday 18 April 2007 17:02, Tim Golden > wrote: >> jim-on-linux wrote: >>> python help, >>> >>> A client is using win xp home. >>> >>> my program contains; >>>shutil.copyfile(n, 'prn')

Re: MS SQL Server Extension?

2007-04-25 Thread Tim Golden
Jack wrote: > Hi all, in my next project, my Python code needs to talk to an MS SQL > 2000 Server. Internet search gives me http://pymssql.sourceforge.net/ > I wonder what module(s) people are using. My code runs on a Linux > box so the module has to build on Linux. Any hints/pointers are welcome.

Re: Tutorial creates confusion about slices

2007-04-25 Thread Tim Golden
Antoon Pardon wrote: > On 2007-04-24, Michael Hoffman <[EMAIL PROTECTED]> wrote: > >> Really only one person has argued that the docs do not need to be >> changed. The other two people seemed to think you were asking for help >> rather than discussing how to revise the docs. Understandable, sinc

Re: Now()

2007-04-25 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I'm using the following function 'str (now)' to place a date time stamp into > a log file, which works fine, however it writes the stamp like this. > 2007-04-25 11:06:53.873029 > But I need to expel those extra decimal places as they're causing problems > wit

Re: Accessing SQL View with Python

2007-04-27 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi All, > > I need to access a Microsoft SQL database View. Is there a way to do > this with Python? I have done a fair share of "googling" and found > nothing on accessing Views, just executing SQL, which I already know > how to do. > > I am running Windows XP, Python

Re: Dict Copy & Compare

2007-04-30 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I'm looking for a little advice on dicts, firstly I need to learn how to > copy a dict, I suppose I could just something like. > Self.newdict = self.olddict > But I fear that this only creates a reference rather than an actual copy, > this means that as soon a

Re: Reading Data From an Excel Sheet

2007-04-30 Thread Tim Golden
sagar wrote: > Hi all, >I want a python script which takes in input an EXCEL sheet > and then reads the data in it. > Any code snippets will be fine and this i want this in windows > XP . Might I humbly suggest that, instead of posting several somewhat demanding requests for help w

Re: Dict Copy & Compare

2007-04-30 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I have two dicts, one named 'this' and the other named 'that'. > > I want to get all the unique keys from 'this' and log them into a file, I > then want to take all the unique values from 'that' and log them into a > separate file. Couple of points which are c

Re: Importing a csv file

2007-04-30 Thread Tim Golden
sagar wrote: > Hi all , >I want to read data in a csv file using the python scripts. > when i gave the following code : > import csv > reader = csv.reader(open("some.csv", "rb")) > for row in reader: > print row > > it is showing : > > Traceback (most recent call last): > File

Re: Dict Copy & Compare

2007-04-30 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > Hello Tim, > > Sorry, that 'value' was a slip up on my part, we're just dealing with keys > here. > > I get that a dict stores unique keys only but we're comparing the two dicts, > so when I say 'unique keys in dict 1' I basically mean all those keys that > ar

Re: Dict Copy & Compare

2007-04-30 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > On[e] quick question, how can I order a dict by > the 'values' (not keys) before looping? Is that possible? Depends on what you want to do. You can loop on the sorted values very easily: d1 = dict (a=2, b=1) for value in sorted (d1.values): print value

Re: Importing a csv file

2007-04-30 Thread Tim Golden
John Machin wrote: > On Apr 30, 7:21 pm, Tim Golden <[EMAIL PROTECTED]> wrote: >> sagar wrote: >>> Hi all , >>>I want to read data in a csv file using the python scripts. >>> when i gave the following code : >>> import csv >>>

Re: Dynamic File Name Open()

2007-05-02 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I'm trying to open a file using open() but the name of the file is created > dynamically as a variable, but also has part of a static path. For instance, > the file may be called 'dave' and will always be in '/my/files/here/'. Well that's an absolutely normal w

Re: Killing Threads

2007-05-02 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I've got an application which I've fearfully placed a couple of threads into > however when these threads are running it seems as if I try and quite the > application from the bash prompt it just seems to freeze the SSH client. > I've also seen that if I have my

Re: Active Directory: how to delete a user from a group?

2007-05-02 Thread Tim Golden
Dirk Hagemann wrote: > Hi! > > Does anyone has experience with manipulating MS Active Directory > objects? I'd like to delete some users from a group, but so far I > couldn't find anything about this. > There is some good stuff about retrieving data out of the AD (t

Re: Active Directory: how to delete a user from a group?

2007-05-02 Thread Tim Golden
Tim Golden wrote: > Dirk Hagemann wrote: >> Hi! >> >> Does anyone has experience with manipulating MS Active Directory >> objects? I'd like to delete some users from a group, but so far I >> couldn't find anything about this. >> There is some good

Re: how to use Dispatch to open an application in win32com.client

2007-05-02 Thread Tim Golden
Peter Fischer wrote: > Hello, > > I also use the COM API via python to dispatch an application. My > problem now is that I want to dispatch a second instance of this > application (Google Earth by the way). But when I invoke dispatch > the second time, nothing happens although using another variab

Re: how to use Dispatch to open an application in win32com.client

2007-05-03 Thread Tim Golden
Peter Fischer wrote: > Thank you for your answer. I just tried, but it didn't work. The reason seems > to > be that Google Earth prevents a second instance to run on the same machine. > Maybe for licensing reasons (do you know whether it is legal to bypass this > and how to do this?). Don't know

Re: invoke user's standard mail client

2007-05-04 Thread Tim Golden
[EMAIL PROTECTED] wrote: > the simplest way to launch the user's standard mail client from a > Python program is by creating a mailto: URL and launching the > webbrowser: [... snip code ...] > But this method is limited: you cannot specify a file to be attached > to the mail. And I guess that the

Re: Can Python Parse an MS SQL Trace?

2007-05-07 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Can Python parse a trace file created with MS SQL's profiler? There > are a few thousand lines in the trace file and I need to find the > insert statements and the stored procedures. Unfortunately, I am not > an SQL guru and was hoping Python could help. > Mike Mike, C

Re: Specification for win32com.client package

2007-05-08 Thread Tim Golden
Peter Fischer wrote: > Hello, (sorry, the first message bounced; because it is urgent and I wait > since > yesterday, here it's again): > > > I am searching for documentation about the interface the win32com > package > provides, especially win32com.client. I searched the web and Mark Ham

Re: Can Python Parse an MS SQL Trace?

2007-05-08 Thread Tim Golden
[EMAIL PROTECTED] wrote: > On May 7, 8:34 am, Tim Golden <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> Can Python parse a trace file created with MS SQL's profiler? There >>> are a few thousand lines in the trace file and I need to find th

Re: Specification for win32com.client package

2007-05-08 Thread Tim Golden
Peter Fischer wrote: > Hello Tim, > > thank you for your answer and sorry for the multiple e-mails. Thank you also > for > the hint on the book. I already read into it in our local library. Its good, > but a > little outdated (Jan. 2000) as I mentioned in > > http://mail.python.org/pipermail/py

Re: CPU usage

2007-05-08 Thread Tim Golden
Navid Parvini wrote: > I want to get the CPU usage in my code. > Is there any module in Python to get it? What Operating System are you on? TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Specification for win32com.client package

2007-05-09 Thread Tim Golden
[EMAIL PROTECTED] wrote: > The wiki idea sounds like a good one. I was thinking about doing some > kind of Python site about the modules and I think the popular 3rd > party ones would be a good place to start, maybe starting with win32. > How much information do you think would need to be on a site

Re: Specification for win32com.client package

2007-05-09 Thread Tim Golden
[EMAIL PROTECTED] wrote: > On May 9, 8:25 am, Tim Golden <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> The wiki idea sounds like a good one. I was thinking about doing some >>> kind of Python site about the modules and I think the popular 3rd >&g

Re: Comparing dates problem

2007-05-10 Thread Tim Golden
[EMAIL PROTECTED] wrote: > I am writing a reminder program for our Zimbra email client. One of > the requirements I was given was to automatically increment or > decrement the display to show something like the following: > > 5 minutes until appointment > > or > > 10 minutes past your appointmen

Re: How to convert Unicode string to raw string escaped with HTML Entities

2007-05-10 Thread Tim Golden
ldng wrote: > Hi, > > I'm looking for a way to convert en unicode string encoded in UTF-8 to > a raw string escaped with HTML Entities. I can't seem to find an easy > way to do it. > > Quote from urllib will only work on ascii (which kind of defeat the > purpose imho) and escape from cgi doesn't

Re: How to convert Unicode string to raw string escaped with HTML Entities

2007-05-10 Thread Tim Golden
ldng wrote: > On 10 mai, 11:03, Tim Golden <[EMAIL PROTECTED]> wrote: >> Probably worth having a look at this: >> >>http://effbot.org/zone/unicode-convert.htm > > Great ! You made my day :-) > > Thanks. That's all right, but it's the effbo

Re: Towards faster Python implementations - theory

2007-05-10 Thread Tim Golden
sturlamolden wrote: > On May 8, 5:53 pm, John Nagle <[EMAIL PROTECTED]> wrote: > >> The point here is that we don't need language changes or declarations >> to make Python much faster. All we need are a few restrictions that >> insure that, when you're doing something unusual, the compiler ca

Re: Better way to isolate string

2007-05-11 Thread Tim Golden
HMS Surprise wrote: > I suppose a one liner would look better, but I am alway leery of these > things 'breaking'. > > t = s.split('">')[-1].split('<')[0] > s ='G132153' Only if you're competing in an obscurity competition ;) If you're really confined to built-ins (ie you can't import a single mo

Re: Spotting Crashed Application

2007-05-15 Thread Tim Golden
Steve Holden wrote: >> Robert Rawlins - Think Blue wrote: >> I’ve got an application that I’ve written, and it sits in an embedded >> system, from time to time the application will crash, I’m not quite sure >> what’s causing this, but as we test it more and more we’ll grasp a >> better underst

Re: removing common elemets in a list

2007-05-15 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi, > Suppose i have a list v which collects some numbers,how do i > remove the common elements from it ,without using the set() opeartor. Is this a test? Why don't you want to use the set operator? Anyway, you can just move things from one list into another excludi

Re: pymssql query

2007-05-16 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi, > > I'm trying to use pymssql to execute a stored procedure. Currently, I > have an Excel spreadsheet that uses VBA in this manner: > > Private Function CreateNewParrot(connDb As ADODB.Connection) As Long > Dim objCommand As ADODB.Command > Dim iParrot As Long >

Re: Installing Python in a path that contains a blank

2007-05-22 Thread Tim Golden
Hamilton, William wrote: > There's also short filename substitution. "C:\Documents and Settings\foo" > can be replaced with "C:\docume~1\foo". In general, you take the first six > non-space characters and append "~" to it. I've never run into a > situation where was anything other than 1, but

Re: Shared Memory Space - Accross Apps & Network

2007-05-23 Thread Tim Golden
Robert Rawlins - Think Blue wrote: > I've got an application that runs on an embedded system, the application > uses a whole bunch or dicts and other data types to store state and other > important information. > I'm looking to build a small network of these embedded systems, and I'd love > to hav

Re: File monitoring for all drive

2007-05-24 Thread Tim Golden
rohit wrote: > hi > i want to detect all file change operations(rename,delete,create) > on ALL THE DRIVES of the hard disk > using the method ReadDirectoryChanges API , i.e program no. 3 in the > webpage > http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html > .

Re: File monitoring for all drive

2007-05-25 Thread Tim Golden
rohit wrote: > hi > i want to detect all file change operations(rename,delete,create) > on ALL THE DRIVES of the hard disk But to go a little further than your question... are you sure you want to do this? It's going to put quite a load on your system and be not-very-scaleable. I haven't yet h

Re: File monitoring for all drive

2007-05-27 Thread Tim Golden
tch_directory_fo... >>> . >>> Please suggest some modification to the program so that i can detect >>> changes to ALL the drives >>> (to detect changes on c:\ set >>> path_to_watch = "." to "c:\\" but this works for only one dr

Re: Embedding objects( txt, doc) into excel using python

2007-05-31 Thread Tim Golden
Girish wrote: > I want to embed a txt document into an excel using python. I didn't know people still did that! Still, each to his own ;) > Here is my code, but i get an error message > === > Traceback (most recent call last): > File "C:\Documen

Re: Dispatching default application for file, cross platform.

2007-08-22 Thread Tim Golden
Hendrik van Rooyen wrote: > How do I do the equivalent of clicking (in SuSe) or double clicking (in > Windows) > on a file? > > In effect I want to tell the OS - take this file and feed it to the > application > that is registered for it. > > Not too sure what to Google for. > > - Hendrik os.

Re: Dispatching default application for file, cross platform.

2007-08-22 Thread Tim Golden
Peter Otten wrote: > Tim Golden wrote: > >> Hendrik van Rooyen wrote: >>> How do I do the equivalent of clicking (in SuSe) or double clicking (in >>> Windows) on a file? >>> >>> In effect I want to tell the OS - take this file and feed it

Re: Impersonate another user temporarily (Unix and Windows)

2007-08-23 Thread Tim Golden
billiejoex wrote: > Hi there. I'm writing a modification for a FTP server library I'm > maintaining. > Depending on the system I'd want to temporarily impersonate the logged > user to perform actions on filesystem. > Something like: > > try: > change_user('user', 'password') > os.rmdir('di

Re: Newbie: List file system roots

2007-08-24 Thread Tim Golden
Einar W. Høst wrote: > Hi, > > How would you list the file system roots in Python? That is, I'm looking > for a way to list all connected drives (C:, D: etc) on a Windows box, or > all /root, /tmp etc on a *nix box. In Java, there's a built-in API > function to do this, File.listRoots(), but I cou

Re: How would I go about making a file open. Not the way you might think.

2007-08-24 Thread Tim Golden
[... snip extended discussion on opening text files ...] Lamonte Harris wrote: > I've completed this request and I got the answer already. Yes, but discussions here never simply end when the answer is found! :) TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: Win32: Detecting when system is locked or sleeping

2007-08-27 Thread Tim Golden
[EMAIL PROTECTED] wrote: > I saw your post on the net. We are having a similar problem. Did you > ever find out how to detect system lock? I can't seem to see the original post you're referring to (reading this via the mailing list) but assuming that by "locked" you mean: Ctrl-Alt-Del locked, th

Re: list index()

2007-08-31 Thread Tim Golden
Erik Max Francis wrote: > Paddy wrote: > >> I say the 'oll' in troll like the 'ol' in frolic, and pronounce roll >> and role similarly. >> >> My accent is probably from the East Midlands of the UK, but is not >> pronounced. > > _Troll_ and _frolic_ aren't pronounced with the same "o" sound in any

OT: pronounciation [was: list index()]

2007-08-31 Thread Tim Golden
Tim Golden wrote: > Erik Max Francis wrote: >> Paddy wrote: >> >>> I say the 'oll' in troll like the 'ol' in frolic, and pronounce roll >>> and role similarly. >>> >>> My accent is probably from the East Midlands of the UK, bu

Re: win32com problem: more than one instance

2007-08-31 Thread Tim Golden
Thomas Rademacher wrote: > Hello, > > I start my script convert.py simultaneously in any dos-shells several > times. But I get every time the same solidworks instance. > I see in the proccess (task) manager only one solidworks.exe > Therefore I get for all simultaneous conversions the same output

Re: Windows Media Player Playlist

2007-09-02 Thread Tim Golden
Lamonte Harris wrote: > Is it possible to use python to get the current playlist of the current > playing songs from Windows Media Player or Windows Player Classic? I don't know what the answer is (not least because I never use Windows Media Player) but a good guideline for this sort of question

Re: Soemthing wrong w/ urllib module or something.

2007-09-03 Thread Tim Golden
Lamonte Harris wrote: > Error Message in cmd: > Traceback (most recent call last): > File "wniamp_lastest5_playlist.py", line 25, in > response = urllib2.urlopen(request) > File "C:\Python25\lib\urllib2.py", line 121, in urlopen > return _opener.open(url, data) > File "C:\Python25\li

Re: Soemthing wrong w/ urllib module or something.

2007-09-03 Thread Tim Golden
[Tim Golden] >> To do the obvious, can you open a socket connection >> to the domain you're using? >> >> >> from socket import socket >> socket ().connect (("DOMAINHERE", 80)) >> >> >> >> or does it give

Re: StringIO MySQL data blob Image problem

2007-09-05 Thread Tim Golden
dimitri pater wrote: I am trying to insert an image, which is stored as a blob in MySQL, into a table using Reportlab. [... snip stuff involving StringIO and getvalue / tostring etc. ...] This is also the string I see in the table, in stead of the actual image. [.. snip more stuff ...] th

Re: StringIO MySQL data blob Image problem

2007-09-06 Thread Tim Golden
dimitri pater wrote: > Hi, > the following code works when inserting images in reportlab tables: > > (result4 is a query result) > a=0 > for i in result4: >cfoto = StringIO() >cfoto.write(result4[a][9].tostring()) >dfoto = cfoto.getvalue() >fileFoto

Nudge needed for rst to html

2007-09-06 Thread Tim Golden
I'm a bit embarrassed about this, but I've scoured the docutils docs and I can't seem to work out how to take a block of ReStructuredText and output a raw HTML fragment, ideally without a surrounding document or embedded/linked css etc. (I'm trying to allow rst in our helpdesk system which can rend

Re: Nudge needed for rst to html

2007-09-06 Thread Tim Golden
Stefan Rank wrote: > on 06.09.2007 13:16 Tim Golden said the following: >> I'm a bit embarrassed about this, but I've scoured >> the docutils docs and I can't seem to work out how >> to take a block of ReStructuredText and output a >> raw HTML fragment,

Re: How to do python and RESTful

2007-09-06 Thread Tim Golden
[MarkyMarc] >> I have be looking at quixote, but is this uptodate? "plain" >> mod_python, can this make url to http put,get,delete and post? [Steve Holden] > Would you care to explain why quixote needs to be "uptodate"? Surely it > either does what you want or it doesn't? If it dies, then it hard

Re: startswith( prefix[, start[, end]]) Query

2007-09-06 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi > > startswith( prefix[, start[, end]]) States: > > Return True if string starts with the prefix, otherwise return False. > prefix can also be a tuple of suffixes to look for. That particular aspect of the functionality (the multiple prefixes in a tuple) was only

Re: Finding specific date ranges

2007-09-06 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi, > > I am working on a timesheet application in which I need to to find the > first pay period in a month that is entirely contained in that month > to calculate vacation time. Below are some example date ranges: > > > December 31, 2006January 13, 2007 # doesn't

Re: Finding specific date ranges

2007-09-06 Thread Tim Golden
> Thanks! I'll try it both ways and see if there's any appreciable > difference in speed, although since it will be packaged into an > executable, that may not be an issue anyway. > > Mike I honestly doubt there's any advantage to my approach, certainly not in terms of speed. It's really only if

Re: Finding specific date ranges

2007-09-06 Thread Tim Golden
[EMAIL PROTECTED] wrote: > On Sep 6, 12:41 pm, Tim Golden <[EMAIL PROTECTED]> wrote: >>> Thanks! I'll try it both ways and see if there's any appreciable >>> difference in speed, although since it will be packaged into an >>> executable, that may

Re: Using s.sort([cmp[, key[, reverse]]]) to sort a list of objects based on a attribute

2007-09-07 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi there > > I am fairly new to Python and have not really used regular expressions > before (I think this might be needed for my query) and wondered if you > could help > > I have a step class and store in a list step instances > A step instance contains variables: nam

Re: Finding specific date ranges

2007-09-07 Thread Tim Golden
Zentrader wrote: > On Sep 6, 7:56 am, [EMAIL PROTECTED] wrote: >> December 31, 2006January 13, 2007 # doesn't earn >> January 14, 2007January 27, 2007 # does earn >> January 28, 2007February 10, 2007 # doesn't >> February 11, 2007 February 24, 2007 # does > > Am I over si

Re: shared memory pointer

2007-09-10 Thread Tim Golden
Tim wrote: > Hello Everyone, > > I am getting shared memory in python using the following. > > szName = c_char_p(name) > hMapObject = windll.kernel32.CreateFileMappingA(INVALID_HANDLE_VALUE, > None, PAGE_READONLY, 0, TABLE_SHMEMSIZE, szName) > if (hMapObject == 0): > print

PyConUK 2007

2007-09-10 Thread Tim Golden
For those who don't follow the UK Python scene, we've just all come back from a *fantastic* weekend in Birmingham: the very first PyCon UK. Terrific kudos to John Pinner and the West Midlands Python team who made it all happen without any serious mishaps, including registration with badges, T-shirt

Re: Silent SaveAs when using the Excel win32com module

2007-09-10 Thread Tim Golden
Chris wrote: > I'm trying to create an excel file which will act as a log, however I > want to overwrite the file if it exists. > > Looking at the SaveAs method I can't find anything that would allow > it. I don't want the prompt to appear to ask whether to replace the > file or not. I just want t

Re: shared memory pointer

2007-09-10 Thread Tim Golden
Tim wrote: > I reviewed the mmap function and I have a question. In the example > code below, what is the connection between the data in shared memory > and the mmap function. The fileno is zero. Why is it zero? The size > makes sense because there is 256 bytes in shared memory. The tag is > MyFile

Re: shared memory pointer

2007-09-11 Thread Tim Golden
Tim wrote: > I saw the mmap function in the shared memory example. I had some > concern with my large memory size being written to the disk drive. I > though it might slow down my application. The reason I am writting > this new code is because the existing method using a file. I thought > shared m

Re: shared memory pointer

2007-09-11 Thread Tim Golden
Tim wrote: > I think I want to stay away from mmap because it uses the disk to > store my memory. My point is that, whatever mmap is doing, your own code is doing *exactly the same thing*. Passing the INVALID_HANDLE_VALUE as both your code and the mmap code are doing is documented as producing an

Re: Minor documentation bug

2007-09-11 Thread Tim Golden
Frank Millman wrote: > I spotted a minor bug in the documentation to SimpleXMLRPCServer. It > does not seem worth getting a login to the bugtracker just to enter > this, so if it is confirmed as a bug perhaps someone would be so kind > as to enter it for me. Frank, please do take the trouble to en

Re: mod_python and pysvn

2007-09-11 Thread Tim Golden
Sjoerd wrote: > Hello all, > > I have a script that uses pySVN. It gets the latest build information. > I want to create a call to that function in a PSP file but everytime I > try I get an error message: > > ClientError: Unable to open an ra_local session to URL > Unable to open repository 'file

Re: newbie: self.member syntax seems /really/ annoying

2007-09-12 Thread Tim Golden
Charles Fox wrote: > Thanks guys -- yeah these two stategies (short s.varname; and explicit > rescoping, a=self.a etc) are more or less what I was using. That's > still kind of annoying though. > > The s.varname approach still makes numerical code much harder to read. > > I had a nasty bug with

Re: Get the complete command line as-is

2007-09-13 Thread Tim Golden
wangzq wrote: > On Sep 12, 3:20 pm, Laurent Pointal <[EMAIL PROTECTED]> wrote: >> wangzq a écrit : >> >>> Hello, >>> I'm passing command line parameters to my browser, I need to pass the >>> complete command line as-is, for example: >>> test.py "abc def" xyz >>> If I use ' '.join(sys.argv[1:]), the

Re: Get the complete command line as-is

2007-09-13 Thread Tim Golden
Thomas Heller wrote: > Better would be this code: > > import ctypes > ctypes.windll.kernel32.GetCommandLineA.restype = ctypes.c_char_p > print ctypes.windll.kernel32.GetCommandLineA() Or you could use pywin32: import win32api print win32api.GetCommandLine () TJG -- http://mail.python.org/m

Re: Python+Expect+Win32 = Not Possible?

2007-09-13 Thread Tim Golden
gamename wrote: > On Sep 13, 1:42 am, [EMAIL PROTECTED] wrote: >> On Sep 12, 9:27 pm, gamename <[EMAIL PROTECTED]> wrote: >> >>> Hi, >>> Is it still the case there is no practical Expect-like module for >>> win32? I know that cygwin can support pexpect, but that isn't an >>> option here --- I have

Re: Coming from Perl

2007-09-13 Thread Tim Golden
Amer Neely wrote: > Richie Hindle wrote: >>> [Amer] >>> #!/usr/bin/python >>> [...] On my home PC [...] >>> [Thu Sep 13 04:16:03 2007] [error] [client 0.0.0.0] (OS 2)The system >>> cannot find the file specified. >> That's because on your home PC Python is somewhere like >> C:\Python25\python.exe,

Re: MS SQL Database connection

2007-03-05 Thread Tim Golden
Hitesh wrote: > Hi currently I am using DNS and ODBC to connect to MS SQL database. > Is there any other non-dns way to connect? If I want to run my script > from different server I first have to create the DNS in win2k3. Here are several ways to connect to an MSSQL database w/o having to create

Re: askstring Window to the top under Windows

2007-03-06 Thread Tim Golden
Jussi Salmela wrote: > iwl kirjoitti: >> Hi, >> >> I tryed askstring to input some text in my script, >> but some ugly empty Window appears with the >> Input-Window behind and all together behind my >> Console showing my script. So all have to brought >> to the top first by the user - very unconfor

Re: askstring Window to the top under Windows

2007-03-06 Thread Tim Golden
On Mar 6, 1:13 pm, "iwl" <[EMAIL PROTECTED]> wrote: > Hi, > > I tryed askstring to input some text in my script, > but some ugly empty Window appears with the > Input-Window behind and all together behind my > Console showing my script. So all have to brought > to the top first by the user - very u

Re: Copy geodatabase(mdb) if it is locked

2007-03-08 Thread Tim Golden
Ahmed, Shakir wrote: > I am trying to copy a geodatabase (.mdb) file from source to destination > using > > shutil.copyfile(src, dest) > > It is working fine but the main problem when the destination (.mdb) file > is locked by other users then it's bumped out and not copied over. > > Is there an

Re: os.path.isfile with *.tar.gz

2007-03-15 Thread Tim Golden
Boudreau, Emile wrote: > Hello All, > I'm new to Python and it looks like people that post here do get > a good answer back so I figured I'd try my luck. > > I'm trying to check a directory to see if there is a file that has the > name "startOfString" + some version number + "inst.tar.gz

Re: Importing WMI in a child Thread throws an error

2007-03-15 Thread Tim Golden
>> If you want to post some specific code examples, I'm >> happy to talk you through possible optimisations. >> >> TJG > > Sorry I didn't reply right away. Here's the straight WMI code I'm > using: > > c = wmi.WMI() > for i in c.Win32_ComputerSystem(): > mem = int(i.TotalPhysicalMemor

Re: screen size/resolution in win32 in python

2007-03-18 Thread Tim Golden
adri80386 wrote: > Hi: > > How I can get the current screen resolution settings (screen.width and > screen.heigth in pixels) in python. You want the GetSystemMetrics function from the pywin32 packge: from win32api import GetSystemMetrics print "width =", GetSystemMetrics (0) print "height =",Ge

Re: Python-URL! - weekly Python news and links (Mar 22)

2007-03-22 Thread Tim Golden
Bruno Desthuilliers wrote: > Cameron Laird a écrit : >> This is the first time you've received "Python-URL!" in 2007. No, >> that's not the fault of your mail server; we've just been on sabbatical. >> Now we're back. > > Great ! I was a bit worried... > Seconded; I've always looked forward to

Re: Create new processes over telnet in XP

2007-03-26 Thread Tim Golden
Laurent Pointal wrote: > Shane Geiger a écrit : >> This reminds me of something I once wanted to do: How can I install >> Python in a totally non-gui way on Windows (without the use of VNC)? I >> think I was telnetted into a computer (or something like that) and I was >> unable to run the usual P

Re: Create new processes over telnet in XP

2007-03-26 Thread Tim Golden
Tim Golden wrote: > Laurent Pointal wrote: >> Shane Geiger a écrit : >>> This reminds me of something I once wanted to do: How can I install >>> Python in a totally non-gui way on Windows (without the use of VNC)? I >>> think I was telnetted into a compute

Re: Auto execute python in USB flash disk

2007-03-27 Thread Tim Golden
Brian Erhard wrote: > Is there > a way to auto execute a python script after a user double clicks to > open a folder on the USB drive? How can you capture that double click > event on a specific folder? That would depend on what desktop / Operating System you're using. If it's Windows, you need a

Re: how to check whether a drive is a network drive or drive from attached hard-disk

2007-03-28 Thread Tim Golden
shailesh wrote: > Hi, > > Few very simple questions. > > Is there a way to detect whether a drive is a mapped network drive or > not in Windows? > > Also, how can I get a list of drive letters currently in use in the > system? http://tgolden.sc.sabren.com/python/wmi_cookbook.html#find-drive-typ

Re: Finding User Profile path

2007-03-28 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi, > > I am trying to query our domain to get a list of our users profile > locations. I thought I might be able to use WMI, but I can't get it to > work. Can you be a bit more specific: did WMI itself not work? Or the Python WMI module? What were the problems? (All t

Re: Finding User Profile path

2007-03-29 Thread Tim Golden
[EMAIL PROTECTED] wrote: > One of my co-workers thought I could do > something like this: > > c = wmi.WMI() > for i in c.Win32_UserAccount(Name=user): > # Get user paths somehow. > > I messed around with that, but I think he was mistaken. It has lots of > good info, but not what I need. > >

Re: Finding User Profile path

2007-03-29 Thread Tim Golden
[EMAIL PROTECTED] wrote: > On Mar 29, 8:23 am, Tim Golden <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> One of my co-workers thought I could do >>> something like this: >>> c = wmi.WMI() >>> for i in c.Win32_UserAccount(Name=user): &g

Re: Finding User Profile path

2007-03-29 Thread Tim Golden
[resending as the original seems to have got lost; apologies if it appears as a duplicate] At the risk of insulting your intelligence, here's a rough-and-ready non-AD solution (culled from some code I had somewhere): import win32net import win32netcon dc = win32net.NetGetAnyDCName (None, None)

Re: Mastering Python (OT)

2007-04-02 Thread Tim Golden
Steve Holden wrote: > Speaking of which, here's a limerick To read it you need to know not > only that Hampshire is colloquially know as Hants, but also that > Salisbury's ancient Roman name is Sarum. > > There once was a young man of Salisbury > Whose manners were most halisbury-scalisbury > H

Re: doing standart window icons unvisible in python

2007-04-03 Thread Tim Golden
gslm wrote: > Hi! > I want to do close-minimize icons unvisible in python.How can I do > this?I want to do this especially for printing. > And is it possible to provide .exe file for any program in python or > only we can change the file as .pyw? I *think* -- and it's a bit hard to tell from your

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