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 i

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: While we're talking about annoyances

2007-05-01 Thread Tim Roberts
f sequence.sort became much, much worse when a key function was supplied. I've tended to favor the "Schwarzian transform" (decorate-sort-undecorate) because of that. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

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: os.path.join

2007-05-03 Thread Tim Roberts
g the >> previous drive letter, if there was one) are thrown away... > >Yes, but that still doesn't answer my question as to why os.path.join >works that way. I understand that that is how it is written, but why? It's behavior is exactly the same as if you did a series of

Re: pack/unpack zero terminated string

2007-05-03 Thread Tim Roberts
ich is that case won't be hard. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacement for HTMLGen?

2007-05-03 Thread Tim Roberts
For me, templating (Cheetah is my favorite, www.cheetahtemplate.org) makes more sense than building the page bit by bit in Python code, and the separation of function and presentation makes things easier to maintain. In my opinion, of course. ;) -- Tim Roberts, [EMAIL PROTECTED] Providenza &a

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: Why stay with lisp when there are python and perl?

2007-05-04 Thread Tim Bradshaw
s "use a language with a decent compiler"[*] I think. --tim [*] No glib comments about Java not having a decent compiler: actually typical implementations do now (or did in 2004/5 and I bet they are better now). -- http://mail.python.org/mailman/listinfo/python-list

Re: Why stay with lisp when there are python and perl?

2007-05-04 Thread Tim Bradshaw
On May 4, 10:13 am, Tim Bradshaw <[EMAIL PROTECTED]> wrote: > Anyway the experience of writing in Python was kind of interesting. > [...] So one of the things I learned was "use a > language with a decent compiler"[*] I think. Bugger, I did not realise until too la

Re: How to check if a string is empty in python?

2007-05-04 Thread Tim Williams
On 4 May 2007 03:02:37 -0700, Jaswant <[EMAIL PROTECTED]> wrote: > This is a simple way to do it i think > > > s=hello > > >>> if(len(s)==0): > print "Empty" > else: > print s > > hello Not as simple as " If not s: " and nowhere near as simple as " print s or 'Emp

Re: Cannot execute Windows commands via Python in 64-bit

2007-05-05 Thread Tim Roberts
ievable but true. Although we were all smart enough to handle the transition from \windows\system in Win16 to \windows\system32 in Win32, Microsoft apparently believes programmers have all grown too stupid to handle the transition to Win64 on our own. Some registry references are also silen

Re: High resolution sleep (Linux)

2007-05-05 Thread Tim Roberts
, the timer interrupt would have to fire every 10us. The overhead of handling the timer interrupt and rescheduling that often is quite significant. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

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:

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: String parsing

2007-05-08 Thread Tim Leslie
nt(s.split("=")[-1].split('"')[1]) Out[8]: 1178658863 There's probably a hundred different ways of doing this, but this is the first that came to mind. Cheers, Tim > Thanks, > > jh > > > > > > > > > > > align="center" > > -- > http://mail.python.org/mailman/listinfo/python-list > -- 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: find out all threads?

2007-05-12 Thread Tim Williams
On 11/05/07, Sven Rech <[EMAIL PROTECTED]> wrote: > Hi, > > I have a written a C program which makes use of python embedding. > I want to find out all threads that a loaded module has started. > But I can't find anything about this in the docs. Is it possible? > Without details of your module, its

Re: Automatic login to website (newbie)

2007-05-15 Thread Tim Williams
On 15 May 2007 06:38:45 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm trying to use PAMIE to login to a website: > > import cPAMIE > > # python.org - just a test, works fine > ie = cPAMIE.PAMIE() > website = "http://www.python.org"; > ie.navigate(website) > ie.textBoxSet('q', 'pamie') >

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: Iron Python

2007-05-16 Thread Tim Roberts
IronPython will give me the opportunity to really dig into WPF without having to drink the C# kool-aid. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Quote aware split

2007-05-16 Thread Tim Arnold
I implemented a quick and dirty > function that suits my purposes. Take a look at pyparsing--you'll like it I think. esp. http://pyparsing.wikispaces.com/Examples --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

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: Anyone use PyPar (Python MPI implementation) recently?

2007-05-18 Thread Tim Churches
ill the easiest-to-use wrapper for MPI for Python. Tim C -- http://mail.python.org/mailman/listinfo/python-list

Re: i/o prob revisited

2007-05-21 Thread Tim Roberts
nicode: need string or buffer, file found >Any solutions. I don't see how the error could possibly make it any clearer. "open" expects a file name. "output_file" is not a file NAME. It is a file OBJECT. If you want to reopen that file, then p

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: Printing dots in sequence ('...')

2007-05-22 Thread Tim Williams
ce without a space being inserted in between? > maybe this: (on Win32, don't know about *nix) for x in range(10): print '.\b', -- Tim Williams -- http://mail.python.org/mailman/listinfo/python-list

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: Lists vs tuples (newbie)

2007-05-23 Thread Tim Roberts
Neil Cerutti <[EMAIL PROTECTED]> wrote: > >I use tuples simply because of their mellifluous appellation. +1 QOTW. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: too much memory use

2007-05-24 Thread Tim Roberts
RAM +1gb virtual store n hangs >cant think of an effective way to implement tree in memory(i can >compact it on disk by writing just the index no..along with the record >from which tree in memory can be reconstructed, but i have to >implement tree as previous to implement random a

Re: 0 == False but [] != False?

2007-05-24 Thread Tim Roberts
a false value in a Boolean context, but they are not all the same. As a general rule, I've found code like "if x == False" to be a bad idea in ANY language. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

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

extra xml header with ElementTree?

2007-05-25 Thread Tim Arnold
header: newtree = ET.ElementTree(tocbody) newtree.write(fname,encoding='utf-8') but how can I get the into the tree? python2.4.1,hpux10,ElementTree1.2.6 thanks, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: extra xml header with ElementTree?

2007-05-25 Thread Tim Arnold
"Gerard Flanagan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On May 25, 3:55 pm, "Tim Arnold" <[EMAIL PROTECTED]> wrote: >> Hi, I'm using ElementTree which is wonderful. I have a need now to write >> out >> an XML file

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

Flags of the world

2007-05-28 Thread Tim Churches
http://shaheeilyas.com/flags/ Scroll to the bottom to see why this is not entirely off-topic. Are there other public examples in which Python has been used to harvest and represent public information in useful and/or interesting ways? Ideas for some more? Tim C -- http://mail.python.org

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-29 Thread Tim Roberts
Frank Swarbrick <[EMAIL PROTECTED]> wrote: > >Then you'd really love COBOL! > >:-) > >Frank >COBOL programmer for 10+ years Hey, did you hear about the object-oriented version of COBOL? They call it "ADD ONE TO COBOL". -- Tim Roberts, [EMAIL PROTECTE

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: Need Help with base64

2007-07-23 Thread Tim Roberts
} >else > { >cin[ni] = 0; >} >} >if( nlen ) > { >decodeblock( cin, cout ); > >} > memcpy(*ppcdest,cout,160); > return 0; "cout" is an array of 3 characters. Wher

encode/decode misunderstanding

2007-07-26 Thread Tim Arnold
atin1 encoded string? Is my method the right way to write such a line out to a file with utf8 encoding? If I read in the latin1 file using codecs.open(filename,encoding='latin1') and write out the utf8 file by opening with codecs.open(othername,encoding='utf8'), would I no longer

Re: From D

2007-07-26 Thread Tim Williams
t; y = z.split() > >>> x = ''.join(y) > >>> w = int(x) > >>> w > 123456 but it doesn't if you use replace !! >>> z = '123 456' >>> int( z.replace( ' ' ,'' ) ) > 123456 > Propose: > 123 456 789 => 123456789 > 123.456 789 => 123.456789 +1 for me too -- Tim Williams -- http://mail.python.org/mailman/listinfo/python-list

Re: encode/decode misunderstanding

2007-07-27 Thread Tim Arnold
h no more > worries about encoding? > > thanks, Replying to my own post, I feel so lonely! I guess that silence means I *am* thinking correctly about the encoding/decoding stuff; I'll keep heading in this direction unless someone out there sees it differently. --Tim -- http://mail.python.org/mailman/listinfo/python-list

encoding misunderstanding

2007-07-27 Thread Tim Arnold
ncoded string? Is my method the right way to write such a line out to a file with utf8 encoding? If I read in the latin1 file using codecs.open(filename,encoding='latin1') and write out the utf8 file by opening with codecs.open(othername,encoding='utf8'), would I no longer have

Re: 128 or 96 bit integer types?

2007-07-27 Thread Tim Roberts
universe? In nanoseconds? >> >> :-) > >Well, 2**96 would only be 2512308552583 years. Yes, but that's still roughly 100 times the estimated age of the universe. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: 128 or 96 bit integer types?

2007-07-29 Thread Tim Roberts
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > >So I never let the age of the universe intimidate me. +1 QOTW. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: 128 or 96 bit integer types?

2007-07-29 Thread Tim Roberts
bin has at least 1 marble? >> >>The answer >> >>66189415264331559482776409694993032407028709677550 >>59629130019289014193777349831417543311612293951363 >>4124491233746912456893016976209252459301489030 > >You missed that blue one in the corner... He lost that one to a talented 12-year

Re: encode/decode misunderstanding

2007-07-30 Thread Tim Arnold
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Tim Arnold schrieb: >> Hi, I'm beginning to understand the encode/decode string methods, but I'd >> like confirmation that I'm still thinking in the right direction: >

Re: beginner in python

2007-08-02 Thread Tim Williams
On 02/08/07, Beema shafreen <[EMAIL PROTECTED]> wrote: > Hi everybody , > I am a beginner in python, > I have to fetch the redundant entries from a file, > > code: > > import re > L = [] > fh = open('ARCHITECTURE_MAIN.txt', > 'r') > for line in fh.readlines(): > data =line.st

Re: MIMEText breaking the rules?

2007-08-02 Thread Tim Roberts
t;them. This behavior is documented in Message.Message, from which MIMEText eventually inherits. If you want to start over, delete the item: del Msg["To"] I would have to say that the existing behavior is more intuitive for an email object. -- Tim Roberts, [EMAIL PROTECTED] Providen

Re: Problems with headers in email.message

2007-08-04 Thread Tim Williams
ng blank line and a "From nobody" > line) are in the message body, followed by the body text. > > How do I assign values to the header? > > I'd appreciate any help anyone can give me with this. Your script (as posted) works fine for me. I did need to change one import line to: from email.Message import Message (note the capitalization), but that was all - originally it stopped the script dead, so it wasn't the cause of your problem. -- Tim Williams -- http://mail.python.org/mailman/listinfo/python-list

Re: os.listdir path error

2007-08-04 Thread Tim Roberts
instead, it works fine. Yes, but only by accident. It will fail again if you try to do os.listdir('c:\tmp'). You need to use the right quoting. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: libpq.dll for pgdb

2007-08-04 Thread Tim Roberts
d libpq. Here's one place to get it: http://www.tksql.org/dll/ -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Fast kNN from python

2007-08-14 Thread Tim Churches
hon. Orange? See http://www.ailab.si/orange/ - not sure about speed, but quite a few parts of it are written in C, and it does kNN. Tim C -- http://mail.python.org/mailman/listinfo/python-list

Re: clarification

2007-08-18 Thread Tim Williams
On 17/08/07, Beema shafreen <[EMAIL PROTECTED]> wrote: > hi everybody, > i have a file with data separated by tab > mydata: > fhl1fkh2 > dfp1chk1 > mal3alp14 > mal3moe1 > mal3spi1 > mal3bub1 > mal3bub3 > mal3mph1 > mal3mad3 > hob1nak1 > hob1wsp1 > hob1

Re: reading a line in file

2007-08-20 Thread Tim Williams
On 20/08/07, Brian McCann <[EMAIL PROTECTED]> wrote: > > Hi, > > I can read in the whole file build.number which has the following lines > how do I just capture the value of build.number and assign it to a variable > Thanks, > Brian > > contents of file build.number: > #Build Number for ANT. Do not

Re: reading a line in file

2007-08-20 Thread Tim Williams
On 20/08/07, Brian McCann <[EMAIL PROTECTED]> wrote: > > > > > From: [EMAIL PROTECTED] on behalf of Tim Williams > Sent: Mon 8/20/2007 2:59 PM > To: Brian McCann > Cc: [email protected] > Subject: Re: reading a line in file &g

Re: reading a line in file

2007-08-20 Thread Tim Williams
On 20/08/07, Shawn Milochik <[EMAIL PROTECTED]> wrote: > Hopefully this will help (using your input file) > > #!/usr/bin/env python > import re > buildinfo = "input.txt" > input = open(buildinfo, 'r') > > regex = re.compile(r"^\s*build.number=(\d+)\s*$") > > for line in input: >if re.search(reg

Re: reading a line in file

2007-08-20 Thread Tim Williams
On 20/08/07, Brian McCann <[EMAIL PROTECTED]> wrote: > > Shawn, Tim ,Jay > > many thanks, > > It looks like there are many ways this problem can be approached > > either by using regex or a tokens > > Tim I'm not familiar with your solution, but will

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: Using Regular Expresions to change .htm to .php in files

2007-08-23 Thread Tim Williams
On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I have a bunch of files that have changed from standard htm files to > php files but all the links inside the site are now broken because > they point to the .htm files while they are now .php files. > > Does anyone have an idea ab

Re: Using Regular Expresions to change .htm to .php in files

2007-08-23 Thread Tim Williams
On 23/08/07, Tim Williams <[EMAIL PROTECTED]> wrote: > On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a bunch of files that have changed from standard htm files to > > php files but all the links inside the site are now br

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: Using Regular Expresions to change .htm to .php in files

2007-08-24 Thread Tim Williams
On 24/08/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > Tim Williams wrote: > > On 23/08/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > >> Hi, > >> > >> I have a bunch of files that have changed from standard htm files to > >

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: Image.open( "C:\test.jpg") is this wrong ?

2007-08-27 Thread Tim Williams
On 27/08/07, Simon Brunning <[EMAIL PROTECTED]> wrote: > On 8/27/07, Carnell, James E <[EMAIL PROTECTED]> wrote: > > > Image.open("C:\test.jpg") > > Try: > > Image.open(r"C:\test.jpg") > > See http://docs.python.org/ref/strings.html r"C:\test.jpg" also "C:\\test.jpg" or 'C:/test.jpg' -- http:

Re: Jython 2.2 on Ubuntu

2007-08-28 Thread Tim Couper
you need to ensure that the correct jython executable is in a directory which is on your on your path. I've just successfully test-subscribed to https://lists.sourceforge.net/lists/listinfo/jython-users. Maybe you could try again. Tim Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com

Re: Important Research Project

2007-08-30 Thread Tim Couper
Paul Excellent post .. brightens up the otherwise hum-drum life! Tim Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com Paul McGuire wrote: > On Aug 30, 8:12 am, "E.D.G." <[EMAIL PROTECTED]> wrote: > >> Important Research Project (Related to computer progra

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: So what exactly is a complex number?

2007-08-31 Thread Tim Daneliuk
nd science problems. Languages like Python that have Complex Numbers as a first class data type allow you do to *arithmetic* on them (add, subtract, etc.). This makes Python very useful when solving problems for engineering, science, navigation, and so forth. HTH, -- -

Re: So what exactly is a complex number?

2007-08-31 Thread Tim Daneliuk
Wildemar Wildenburger wrote: > Tim Daneliuk wrote: >> A number by itself is called a "scalar". For example, when I say, >> "I have 23 apples", the "23" is a scalar that just represents an >> amount in this case. >> >> One of th

Re: So what exactly is a complex number?

2007-08-31 Thread Tim Daneliuk
Wildemar Wildenburger wrote: > Tim Daneliuk wrote: >> A number by itself is called a "scalar". For example, when I say, >> "I have 23 apples", the "23" is a scalar that just represents an >> amount in this case. >> >> One of th

Re: Important Research Project

2007-09-01 Thread Tim Couper
to be well developed in, for example, python. d. If you are in academia, you should be able to readily find comp sci undergrads or graduates who might be able to help you for a comparatively small remuneration. Tim Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com E.D.G. wrote: > &qu

Re: So what exactly is a complex number?

2007-09-01 Thread Tim Couper
el are indeed identical. This could, however, be considered a special, or at least a simple, case. Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com Wildemar Wildenburger wrote: > Lawrence D'Oliveiro wrote: > >> In message <[EMAIL PROTECTED]>, Wildemar >

Re: So what exactly is a complex number?

2007-09-01 Thread Tim Couper
and students of quality in the USA. Maybe it wouldn't be so offensive in Poland, but in the world of first-language English speakers, it is. Tim "European" Couper Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com Grzegorz S?odkowicz wrote: >> Here is a simple explanati

<    36   37   38   39   40   41   42   43   44   45   >