Re: Refresh Problem

2010-04-11 Thread Tim Chase
On 04/11/2010 02:53 PM, MRAB wrote: Victor Subervi wrote: Hi; I send variables to a script. The script adds appropriate lines into a database of an order to my shopping cart. When I refresh the screen, as no doubt some customers will do, it re-ads those orders. Now, I can delete them, but that's

Re: Tempering Client Expectations (OT)

2010-04-12 Thread Tim Chase
On 04/12/2010 06:37 AM, Victor Subervi wrote: On Sat, Apr 10, 2010 at 3:14 PM, Tim Chase wrote: 1) Preeminently, address second-order ignorance. [elided kvetch] "second-order ignorance" is a technical term (not intended so much as a slur) for "not knowing what you don&#

Re: Code dojo on Thursday?

2010-04-13 Thread Tim Golden
On 13/04/2010 14:50, John Maclean wrote: Is there a code Dojo in London on Thurs? I've requested two places but have not heard a reply yet. It's usually the first Thursday in the month. I've not heard about one this Thursday. (Doesn't mean I'm right, of course). TJG -- http://mail.python.org

Re: Python, CGI and Sqlite3

2010-04-13 Thread Tim Chase
On 04/13/2010 12:41 PM, Majdi Sawalha wrote: import sqlite3 statement? and it gives the following error ImportError: No module named sqlite3, i tried it on python shell and all statements are work well. A couple possible things are happening but here are a few that pop to mind: 1) you're r

Re: mailbox multipart

2010-04-13 Thread Tim Roberts
roof get the "date", "from" and "to" of of a multipart mail >using python? Perhaps you should post your code. There's no particular reason why you should see this. The mailbox iterator should return the outer multipart container, which has the headers. --

Re: regular expressions

2010-04-15 Thread Tim Chase
On 04/15/2010 11:05 AM, Terry Reedy wrote: On 4/15/2010 2:57 AM, chaaana wrote: hi.. im parsing the text file containing the details of the testcases failed.From the file i wanted to obtain only the testcase names and enter them in the excel sheet. the pattern of the text file is: FILE : NW_PT

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-16 Thread Tim Roberts
-debug runtimes with any applications built with Visual Studio. They are evil, but not arbitrarily malicious. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get elements of a com object (wmi log events)

2010-04-16 Thread Tim Golden
On 16/04/2010 01:39, News123 wrote: Just having a short question: I found a code snippet, that fetches windows event logs via a wmi query. import win32com.client strComputer = "." objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator") objSWbemServices = objWMIService.ConnectSe

Re: Updated License Term Agreement for VC Redistributable in VS 2008 SP1

2010-04-18 Thread Tim Roberts
CM wrote: > >On Apr 16, 3:31 am, Tim Roberts wrote: >> >> Microsoft's intent is that you be able to distribute the non-debug runtimes >> with any applications built with Visual Studio.  They are evil, but not >> arbitrarily malicious. > >Just to be clea

Building a GUI Toolkit

2010-04-18 Thread Tim Diels
Hi I was thinking of writing a GUI toolkit from scratch using a basic '2D library'. I have already come across the Widget Construction Kit. My main question is: Could I build a GUI toolkit of reasonable performance with the Widget Construction Kit, would it still feel more or less lightweigh

Re: copy some files from IE temporary internet files

2010-04-19 Thread Tim Golden
On 19/04/2010 10:49, CHEN Guang wrote: Hi friends, I want to program Python to copy some video files (.flv) from the IE folder "temporary internet files", but os.listdir('C:\\Documents and Settings\\Administrator\\Local Settings\\Temporary Internet Files') seemed unable to find any video file

Re: Usable street address parser in Python?

2010-04-19 Thread Tim Roberts
be happy. This is a very tricky problem. Consider Salem, Oregon, which puts the direction after the street: 3340 Astoria Way NE Salem, OR 97303 Consider northern Los Angeles County, which use directions both before and after. I used to live at: 44720 N 2nd St E Lancaster,

Re: Write web apps in Python?

2010-04-21 Thread Tim Chase
On 04/21/2010 08:46 AM, Bruno Desthuilliers wrote: Bryan a écrit : Bruno Desthuilliers wrote: Many large, sopĥisticated etc applications are written in C. Does that make C a practical application programming language ? It's at least a strong clue. Oh, yes ? Then why don't you use C for web

Re: Building a GUI Toolkit

2010-04-22 Thread Tim Diels
On 20/04/2010 20:53, Lie Ryan wrote: On 04/19/10 03:06, Martin P. Hellwig wrote: On 04/18/10 12:49, Tim Diels wrote: Hi I was thinking of writing a GUI toolkit from scratch using a basic '2D library'. I have already come across the Widget Construction Kit. My main question is: Cou

Re: Hi, friends. I wanna ask if there is a function which is able to take a list as argument and then return its top-k maximums?

2010-04-22 Thread Tim Golden
On 22/04/2010 14:57, Jo Chan wrote: > Hi,friends. > > I wanna ask if there is a function which is able to take a list as argument > and then return its top-k maximums? > I only know about max which is poorly a top-1 maximum function, now I want > more yet I am lazy enough that don't want to writ

Re: Linux servers, network and file names

2010-04-22 Thread Tim Golden
On 22/04/2010 15:13, Infinity77 wrote: [I] choose this file myself, the FileDialog (a window representing a file selector dialog) will return something like this (let's ignore the back/forward slashes, this is not an issue): Y:/Folder/FileName.txt If my colleague does it, he will get: Z:/Folde

Re: WIN32 - get the GUID of a Network Device

2010-04-26 Thread Tim Golden
On 26/04/2010 09:06, Richard Lamboj wrote: is there a way to get the GUID from a Network Device? Are you talking about the MAC address? If so, here's one way: import wmi for nic in wmi.WMI ().Win32_NetworkAdapterConfiguration (): print nic.caption, "=>", nic.MACAddress If you're not, th

Re: WIN32 - get the GUID of a Network Device

2010-04-26 Thread Tim Golden
be there is another way? OK; I'm going to hope that Tim Roberts or someone equally knowledgeable can kick in here as devices really isn't my area. However this looks like it *might* be doing what you want: import wmi for nic in c.Win32_NetworkAdapter (MACAddress=i.MACAddr

Re: WIN32 - get the GUID of a Network Device

2010-04-26 Thread Tim Golden
On 26/04/2010 11:47, Tim Golden wrote: OK; I'm going to hope that Tim Roberts or someone equally knowledgeable can kick in here as devices really isn't my area. However this looks like it *might* be doing what you want: import wmi for nic in c.Win32_NetworkAdapter (MACAddress=i.

[ANN]: 'tren' Cross-Platform Batch Renaming Tool, Version 1.217 Released

2010-04-26 Thread Tim Daneliuk
'tren' Version 1.217 is now released and available for download at: http://www.tundraware.com/Software/tren - What's New In This Release? --- This is the initial public release. What Is 'tren'?

Re: WIN32 - get the GUID of a Network Device

2010-04-26 Thread Tim Roberts
Tim Golden wrote: > On 26/04/2010 09:49, Richard Lamboj wrote: >> thanks for your response. No, i don't mean the MAC Address. I mean >> the GUID -> >> Sample: {1E2428C1-9F2C-48D7-AB53-3229DFB7E217} >> >> I want to change TcpAckFrequency and TcpDelTicks of a

Re: WIN32 - get the GUID of a Network Device

2010-04-27 Thread Tim Golden
On 26/04/2010 22:07, Tim Roberts wrote: Tim Golden wrote: On 26/04/2010 09:49, Richard Lamboj wrote: thanks for your response. No, i don't mean the MAC Address. I mean the GUID -> Sample: {1E2428C1-9F2C-48D7-AB53-3229DFB7E217} I want to change TcpAckFrequency and TcpDelTicks of a

Re: Detect OS shutdown or user logout across different operating systems

2010-04-27 Thread Tim Golden
On 27/04/2010 03:09, [email protected] wrote: Is there a OS portable way to have a Python script detect when its operating system is shutting down or a user is logging out? If not, any Windows specific tips on how to detect these events? Thank you, Malcolm Doubt v. much if there's anything

Re: Python 2.5.x _winreg - rename a subkey

2010-04-27 Thread Tim Golden
On 27/04/2010 12:23, Richard Lamboj wrote: is there a way to rename a subkey? This is essentially a Windows question, since the _winreg module is a lightweight wrapper around (some of) the MS Reg functions: http://msdn.microsoft.com/en-us/library/ms724875%28v=VS.85%29.aspx And: no, there is

Re: function name

2010-04-28 Thread Tim Chase
On 04/28/2010 01:50 PM, Emile van Sebille wrote: On 4/28/2010 11:44 AM Richard Lamboj said... is there any way to get the name from the actual called function, so that the function knows its own name? >>> def test():pass ... >>> dir(test) ['__call__', '__class__', '__closure__', '__code_

Re: Python's regular expression help

2010-04-29 Thread Tim Chase
On 04/29/2010 01:00 PM, goldtech wrote: Trying to start out with simple things but apparently there's some basics I need help with. This works OK: import re p = re.compile('(ab*)(sss)') m = p.match( 'absss' ) f=r'abss' f 'abss' m = p.match( f ) m.group(0) Traceback (most recent call last):

Re: Possible to import from an in-memory zipfile stored in a cString?

2010-04-30 Thread Tim Chase
On 04/30/2010 08:55 AM, [email protected] wrote: Any ideas on whether or not it is possible to import from an in-memory zipfile stored in a cString vs. an on disk zipfile? Based on the source-code to zipfile.py on my Debian machine, it looks like the zipfile.ZipFile constructor takes a "file"

Re: External Hashing [was Re: matching strings in a large set of strings]

2010-04-30 Thread Tim Chase
On 04/30/2010 12:51 PM, Helmut Jarausch wrote: I think one could apply an external hashing technique which would require only very few disk accesses per lookup. Unfortunately, I'm now aware of an implementation in Python. Does anybody know about a Python implementation of external hashing? Whil

Re: Need direction on mass find/replacement in HTML files

2010-04-30 Thread Tim Chase
On 04/30/2010 02:54 PM, KevinUT wrote: I want to globally change the following: into: Normally I'd just do this with sed on a *nix-like OS: find . -iname '*.html' -exec sed -i.BAK 's...@href="http://www.mysite.org/?page=\([^"]*\)@href="pages/\1@g' {} \; This finds all the HTML file

Re: winreg - access mask

2010-04-30 Thread Tim Roberts
e constants are straight from the Windows API. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dot-equals (syntax proposal)

2010-05-01 Thread Tim Chase
On 05/01/2010 12:08 AM, Patrick Maupin wrote: +=, -=, /=, *=, etc. conceptually (and, if lhs object supports in- place operator methods, actually) *modify* the lhs object. Your proposed .= syntax conceptually *replaces* the lhs object (actually, rebinds the lhs symbol to the new object). The

Re: Fast Efficient way to transfer an object to another list

2010-05-01 Thread Tim Chase
On 04/30/2010 10:35 PM, Steven D'Aprano wrote: If you know there is one, and only one, item with that stock code: def transfer_stock(stock_code, old_list, new_list): """ Transfer a stock from one list to another """ i = old_list.index(stock_code) # search new_list.append(old_list

design question

2010-05-03 Thread Tim Arnold
27;t feel like the right thing to me. thanks, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: win32 - catch events(wmi?)

2010-05-03 Thread Tim Golden
On 03/05/2010 12:02 PM, Richard Lamboj wrote: i want catch the following events: - registry has chanced - file has chanced - outgoing network connection - programm start and i want to be able to allow, or deny this "requests". Wow. That's quite a list. To do what you want in general te

Re: win32 - catch events(wmi?)

2010-05-04 Thread Tim Golden
On 03/05/2010 23:53, Giampaolo Rodolà wrote: Just out of curiosity, is WMI able to list the TCP and UDP connections opened by a process or by the OS? We'll have to do this for psutil (http://code.google.com/p/psutil) and we guess it's not gonna be easy. Not as far as I know. WMI doesn't tend to

Re: design question

2010-05-04 Thread Tim Arnold
ng a build, so it looks like I was just worrying about something that doesn't need worry. Now on to the things that do! thanks again, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Encrypt password within source code.

2010-05-05 Thread Tim Chase
On 05/05/2010 08:12 PM, Vincent Davis wrote: I can't think of a way to do this, not sure it is possible but I feel as though I might not know what I don't know. I want to share and example of a python script, to run it needs a google username and password. Is there a way for me to encrypt my use

Re: Windows7 run python script / sub process with elevated privileges

2010-05-06 Thread Tim Golden
On 01/05/2010 15:44, News123 wrote: Hi, I have a small python script, which has been started as normal non privileged user. At a later point in time it would like to start another python script with elevated privileges. How can I write my code such, that I will get the privilege elevation prom

Re: fast regex

2010-05-06 Thread Tim Chase
On 05/06/2010 09:11 PM, james_027 wrote: for key, value in words_list.items(): compile = re.compile(r"""\b%s\b""" % key, re.IGNORECASE) search = compile.sub(value, content) where the content is a large text about 500,000 characters and the word list is about 5,000 You don't specify w

Re: Classes: nested functions vs. private methodes

2010-05-06 Thread Tim Roberts
arch order is well-defined, so super() is still meaningful. However, in that case, you are rapidly getting into a design that is too complicated to understand at a glance. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: fast regex

2010-05-07 Thread Tim Chase
[your reply appears to have come only to me instead of the mailing list; CC'ing c.l.p in reply] On 05/06/2010 10:12 PM, James Cai wrote: When you say "This does a replacement for every word in the input corpus (possibly with itself), but only takes one pass through the source text. " It sounds

ConfigParser.get() defaults?

2010-05-07 Thread Tim Chase
With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: d = {} print d.get(42, 'Some default goes here') However, with the ConfigParser object, there doesn't seem to be any way to do a similar cp = ConfigParser(...) # ... print

Re: ConfigParser.get() defaults?

2010-05-07 Thread Tim Chase
On 05/07/2010 07:56 PM, Steven D'Aprano wrote: On Fri, 07 May 2010 15:05:53 -0500, Tim Chase wrote: With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: [...] However, with the ConfigParser object, there doesn't seem t

[PATCH] Re: ConfigParser.get() defaults?

2010-05-08 Thread Tim Chase
On 05/07/2010 07:56 PM, Steven D'Aprano wrote: On Fri, 07 May 2010 15:05:53 -0500, Tim Chase wrote: With a normal dictionary, I can specify a default fallback value in the event the requested key isn't present: [...] However, with the ConfigParser object, there doesn't seem t

Re: ConfigParser.get() defaults?

2010-05-08 Thread Tim Chase
On 05/08/2010 01:58 PM, Steven D'Aprano wrote: If your patch doesn't attract the interest of a Python-Dev developer, you might need to give them a prod occasionally. Their time for reviewing bugs and patches is always in short supply. - where (or to whom) to I submit the patch (and possibly tes

Re: Cross-platform file paths

2010-05-08 Thread Tim Roberts
Windows network protocol to access a Linux file system from another Linux machine. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: A more general solution

2010-05-09 Thread Tim Chase
On 05/08/2010 10:33 PM, 3Jane wrote: You could interpret [[1,2,3,4],[5,6,7,8]] as a tree and your task as traversal of its leaves. All solutions before would not work with trees with bigger height. Here is how to traverse such trees recursively: def eventualPrint(x): for v in x: i

Re: Limitation of os.walk

2010-05-11 Thread Tim Chase
On 05/11/2010 02:49 PM, kj wrote: I want implement a function that walks through a directory tree and performs an analsysis of all the subdirectories found. The task has two essential requirements that, AFAICT, make it impossible to use os.walk for this: 1. I need to be able to prune certain di

Re: Limitation of os.walk

2010-05-11 Thread Tim Chase
05/11/2010 09:07 PM, Terry Reedy wrote: PS: I never understood why os.walk does not support hooks for key events during such a tree traversal. Either 1) it is intentionally simple, with the expectation that people would write there own code for more complicated uses or 2) no one has submitted

Re: win32com sql update problem

2010-05-12 Thread Tim Roberts
'April 2010' AND InvJobCode = '2169'") Well, that's not the EXACT code, because that's clearly not line 64 in the script above. Do you actually have the file path hardcoded, as in your example? Or are you building it up from strings? Does the net share exist a

Re: indexing lists/arrays question

2010-05-13 Thread Tim Chase
On 05/13/2010 09:36 AM, a wrote: this must be easy but its taken me a couple of hours already i have a=[2,3,3,4,5,6] i want to know the indices where a==3 (ie 1 and 2) indexes = [i for (i, v) in enumerate(a) where v==3] then i want to reference these in a In a _what_? You can then do th

Re: indexing lists/arrays question

2010-05-13 Thread Tim Chase
On 05/13/2010 10:45 AM, a wrote: a=[2,3,3,4,5,6] i want to know the indices where a==3 (ie 1 and 2) indexes = [i for (i, v) in enumerate(a) where v==3] then i want to reference these in a In a _what_? You can then do things like for i in indexes: print a[i] (but you already

Re: indexing lists/arrays question

2010-05-13 Thread Tim Chase
On 05/13/2010 12:51 PM, a wrote: If your two arrays are of the same length, you can do things like a = [2,3,3,4,5,6] b = ['a', 'b', 'c', 'd', 'e', 'f'] print [m for (n,m) in zip(a,b) if n == 3] and skip the indexes altogether. mmm, that's clever, thanks. although i don't know wh

Re: walk directory & ignore all files/directories begin with '.'

2010-05-13 Thread Tim Chase
On 05/13/2010 12:58 PM, albert kao wrote: I want to walk a directory and ignore all the files or directories which names begin in '.' (e.g. '.svn'). Then I will process all the files. My test program walknodot.py does not do the job yet. Python version is 3.1 on windows XP. Please help. [code] #

Re: Data store solution need help

2010-05-14 Thread Tim Chase
On 05/14/2010 08:18 AM, Haulyn Jason wrote: I am a Java programmer, now I am working on a Python program. At the moment, I need to store some data from user's input, no database, no xml, no txt(we can not make users open the data file by vim or other text editor). You don't mention what type of

Re: joining two column

2010-05-14 Thread Tim Chase
On 05/14/2010 12:55 PM, James Mills wrote: file1: a1 a2 a3 a4 a5 a6 a7 a8 file2: b1 b2 b3 b4 b5 b6 b7 b8 and I want to join them so the output should look like this: a1 a2 b1 b2 a3 a4 b3 b4 a5 a6 b5 b6 a7 a8 b7 b8 This is completely untested, but this "should" (tm) work: from itertools impo

Re: help need to write a python spell checker

2010-05-15 Thread Tim Chase
2) Python-list doesn't like to do other people's homework. This could be fun... :) For this problem, all you have to do is a big "if/elif/else" statement for every possible mis-spelling. If you want to get really fancy, you could put all the mis-spellings in a set() and then test the incomi

Re: joining two column

2010-05-15 Thread Tim Chase
On 05/15/2010 09:20 AM, mannu jha wrote: BTW: your mailer makes an absolute mess of plain-text emails, putting multiple spaces between every single line which makes it very hard to read. Please fix it, use a real mailer, or risk getting ignored (or worse, plonked). For

Re: cmd with three arguments

2010-05-17 Thread Tim Chase
On 05/17/2010 07:11 AM, [email protected] wrote: While playing with the Python Standard Library, i came across "cmd". So I'm trying to make a console application. Everything works fine, i created many function with do_(self, line) prefix, but when i tried to create a function with more argumen

Re: Access to comp.lang.python

2010-05-18 Thread Tim Chase
On 05/15/2010 05:34 PM, cjw wrote: It seems that messages are coming from a number of sources, such as gmane and google groups. The problem is that many messages seem to get unlinked from their threads. I use Thunderbird 3.0.5 and wonder whether the problem lies with the merge process, the serv

Re: Pointers on packaging python programs for installation on multiple platforms?

2010-05-19 Thread Tim Golden
On 19/05/2010 03:05, gobnat wrote: I am trying to release my first python program. I would like to be able to create a download which will automatically do stuff like add menu items (eg for KDE, GNOME and Windows). Is there anywhere which explains how to do this? Speaking from the Windows per

Re: Another Strange MySQL Problem

2010-05-21 Thread Tim Chase
On 05/21/2010 12:31 PM, Victor Subervi wrote: cursor.execute('insert into Baggage values (Null, %s, %s, %s, %s)', (flight_id, customer_id, weight, ticket_no)) You're trying to insert stuff... OperationalError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`sea

Re: where are the program that are written in python?

2010-05-21 Thread Tim Chase
On 05/21/2010 01:40 PM, geremy condra wrote: See http://www.python.org/about/success/ thankx for reply. from that list i have a feeling that python is acting only as "quick and dirty work" nothing more ! Yeah, there's not really a lot of industry support. If only we could get a huge search e

Re: where are the program that are written in python?

2010-05-22 Thread Tim Chase
On 05/22/2010 02:43 AM, sturlamolden wrote: That only applies to CPU bound program code (most program code is I/O bound), and only to computational bottlenecks (usually less than 5% of the code) in the CPU bound programs. Today, most programs are I/O bound: You don't get a faster network connecti

Re: python command line manual

2010-05-26 Thread Tim Golden
On 26/05/2010 14:50, Aahz wrote: In article, Chris Rebert wrote: On Mon, May 24, 2010 at 3:52 PM, Peng Yu wrote: I mainly check online python manual. But I feel that it would be nice if there is command line manual available (just like perl command line manual). Could you please let me know

multiprocessing and accessing server's stdout

2010-05-26 Thread Tim Arnold
ine to see the stdout of the process running on the server. Not sure this is doable--I've been unable to google anything useful on this one. thanks, --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation

2010-05-26 Thread Tim Chase
On 05/26/2010 03:13 PM, William Miner wrote: I have a script which I would now put inside a loop. Is there any way to ³automatically² indent the old script so it can be put inside the new loop. Doing it by hand seems so inelegant and time consuming. It's usually a function of your editor -- mos

Re: Another Little MySQL Problem

2010-05-27 Thread Tim Golden
On 26/05/2010 23:24, Christian Heimes wrote: Actually, no. The names of tables are not quoted in SQL. One writes SELECT ID FROM mytable; not SELECT ID FROM "mytable"; nit picking mode: Some RDBMS support case sensitive table names. You have to quote the table name if you using the feature

Re: if, continuation and indentation

2010-05-27 Thread Tim Chase
On 05/27/2010 07:22 AM, HH wrote: When I write an if statement with many conditions, I prefer to use a parenthesis around the whole block and get the implicit continuation, rather than ending each line with an escape character. Thus, using the example from the style guide (http://www.python.org/

Re: multiprocessing and accessing server's stdout

2010-05-27 Thread Tim Arnold
On May 26, 4:52 pm, Adam Tauno Williams wrote: > On Wed, 2010-05-26 at 11:47 -0700, Tim Arnold wrote: > > Hi, > > I'm using multiprocessing's BaseManager to create a server on one > > machine and a client on another. The client fires a request and the > >

Re: Yet Another MySQL Problem

2010-05-27 Thread Tim Chase
On 05/27/2010 11:56 AM, MRAB wrote: Kushal Kumaran wrote: ', '.join('%s' * len(values))) That should be: ', '.join(['%s'] * len(values))) Or as I've done in the past: ', '.join('%s' for _ in values) -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet Another MySQL Problem

2010-05-27 Thread Tim Chase
On 05/27/2010 03:32 PM, Victor Subervi wrote: On Thu, May 27, 2010 at 1:15 PM, Tim Chase wrote: That should be: ', '.join(['%s'] * len(values))) Or as I've done in the past: ', '.join('%s' for _ in values) Huh? Can you descr

Re: parsing question

2010-05-31 Thread Tim Chase
On 05/31/2010 08:42 AM, Mag Gam wrote: I have a file with bunch of nfsstat -c (on AIX) which has all the hostnames, for example ... Is there a an easy way to parse this file according to each host? So, r1svr.Connectionless.calls=6553 r1svr.Connectionless.badcalls=0 and so on... I am current

Re: writing numbers in binary file

2010-05-31 Thread Tim Chase
On 05/31/2010 10:56 AM, eskandari wrote: But when I try to write offset (number) in binary file, it raise exception below in line "offsetfile.write(offset)" "TypeError: argument 1 must be string or read-only buffer, not int" I search the internet, find that all suggest converting number to stri

Re: passing external data to web forms

2010-05-31 Thread Tim Chase
On 05/31/2010 12:16 PM, M L wrote: Specifically, I'm needing to login to a particular website, and which username I use varies based on it being specified in the email. Are you in control of this email generation (that is, can you generate an email with an HTML form within, or is this email c

Re: multiprocessing and accessing server's stdout

2010-06-01 Thread Tim Arnold
C and now the stdout appears on the client terminal making the request. I was trying to minimize the number of packages I use, hoping I could get the same capability from multiprocessing that I get with RPyC. thanks for the comments. I'm still processing what's been written here. --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: plac, the easiest command line arguments parser in the world

2010-06-02 Thread Tim Golden
On 02/06/2010 05:37, Michele Simionato wrote: I would like to announce to the world the first public release of plac: http://pypi.python.org/pypi/plac Plac is a wrapper over argparse and works in all versions of Python starting from Python 2.3 up to Python 3.1. I like it. I'm a constant us

Re: optional optional args vs optional positional options

2010-06-02 Thread Tim Golden
On 02/06/2010 11:42, Antoine Pitrou wrote: On Wed, 2 Jun 2010 01:49:18 -0700 (PDT) Michele Simionato wrote: Notice that optparse is basically useless in the use case Tim is considering (positional arguments) since it only manages options. By the way, could you stop naming these "opt

Re: Python Forum

2010-06-03 Thread Tim Chase
On 06/03/2010 07:16 AM, Adam Tauno Williams wrote: Most people use this list via e-mail... Do you know this to be the case, or is that a guess? Scan through a bunch of threads with show-headers. Watch the User-Agent value (set by the senders client). The results become obvious pretty quickly

Re: Windows and My Documents

2010-06-03 Thread Tim Golden
On 03/06/2010 16:39, Bob Greschke wrote: How do I do a "listdir" (or whatever I need to use) of the Desktop on a Windows machine and have "folders" like My Documents show up in the result? I'm specifically trying to get a link to VMWare Shared Folders to show up so I can navigate to files in OSX

Re: Windows and My Documents

2010-06-04 Thread Tim Golden
On 03/06/2010 17:50, Bob Greschke wrote: On 2010-06-03 09:57:11 -0600, Tim Golden said: On 03/06/2010 16:39, Bob Greschke wrote: How do I do a "listdir" (or whatever I need to use) of the Desktop on a Windows machine and have "folders" like My Documents show up

Re: questions about how to parse a string and put it in a dictionary

2010-06-04 Thread Tim Chase
On 06/03/2010 09:21 PM, joblack wrote: I've got a string which (without any CR or LF) consists of 'attribute1=attribute_value;attribute2=attribute_value2; ...' and I want them to read in a dictionary so that the attribute name is the key and the attribute value is the data. Any ideas for an im

Re: Plotting in batch with no display

2010-06-05 Thread Tim Harig
On 2010-06-05, Hans Georg Schaathun wrote: > Raster graphics is not good enough, I will need a backend which > does vector graphics and pdf output. AFAICS from the FAQ at > sourceforge, agg only supports raster and png. Cairo supports > vector graphics and PDF, but I cannot find any information

Re: problems with CSV module

2010-06-05 Thread Tim Roberts
ween formats. It has been my experience that csv.Sniffer is NEVER worth the trouble. You know what the format is. Just embed the dialect yourself. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: save xls to csv/dbf without Excel/win32com.client

2010-06-05 Thread Tim Chase
On 06/05/2010 06:47 PM, noydb wrote: Is there a way to save a .xls file (the first worksheet) as a .dbf or .csv without opening an instance of Excel with win32com.client (been awhile, is this the best module these days for v2.5)? In case a computer does not have Excel (2007) installed. Use the

Re: save xls to csv/dbf without Excel/win32com.client

2010-06-06 Thread Tim Chase
On 06/06/2010 06:59 PM, noydb wrote: On Jun 5, 9:31 pm, Tim Chase wrote: [1]http://pypi.python.org/pypi/xlrd/ Many thanks Tim, this worked well! In the interest of learning, anyone have a XLS to DBF solution? This becomes considerably trickier unless you're willing to have all you

Re: RE - Parsing ipconfig /all output - question

2010-06-06 Thread Tim Pinkawa
;\s([0-9A-F-]{17})\s',rawtxt) print p Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Plotting in batch with no display

2010-06-07 Thread Tim Harig
On 2010-06-07, Hans Georg Schaathun wrote: > On Sat, 5 Jun 2010 16:10:01 + (UTC), Tim Harig > wrote: >: On 2010-06-05, Hans Georg Schaathun wrote: >: > Raster graphics is not good enough, I will need a backend which >: > does vector graphics and pdf output. A

Re: Question about NNTPLib

2010-06-08 Thread Tim Wintle
On Tue, 2010-06-08 at 08:24 -0700, Anthony Papillion wrote: > resp, count, first, last, name = server.group('comp.lang.python') > resp, items = server.xover(first, last) > > for subject in items: > resp, subject = server.xhdr('subject', first, last) > print subject > > Whi

Re: why any( ) instead of firsttrue( ) ?

2010-06-08 Thread Tim Chase
On 06/08/2010 06:18 PM, MRAB wrote: danieldelay wrote: firsttrue(line.strip() for line in '\n\n \n CHEERS \n'.split('\n')) Should 'firsttrue' return None? Surely, if none are true then it should raise an exception. which can fairly elegantly be written with stock-Python as # try: resu

Re: Replace in large text file ?

2010-06-09 Thread Tim Chase
On 06/09/2010 05:27 AM, hiral wrote: On Jun 6, 7:27 am, Steve wrote: On 5 June, 08:53, Steve wrote: Remove all comma's Replace all @ with comma's Save as a new file. Many thanks for your suggestions. sed -i 's/Hello/hello/g' file Run twice on the CL..with the hello's changed for my needs

Re: Python Jobs

2010-06-09 Thread Tim Chase
On 06/09/2010 03:21 PM, Michael Chambliss wrote: - Your location - country, state or city, whatever you care to provide Outside Dallas, TX, USA - Your focus - Product Development (web sites/apps), Education, R&D/Science, IT/Sys Admin, etc split between development (web & apps) and IT/Sys ad

Re: why any( ) instead of firsttrue( ) ?

2010-06-09 Thread Tim Roberts
danieldelay wrote: > >Does GVR prefers beauty to power ? Not in the beginning, but in recent years things are tending this way. And, frankly, I don't think that's a Bad Thing at all. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mai

Re: pyreadline: default editable input; please, help.

2010-06-13 Thread Tim Roberts
he low-level operating system interfaces are quite different. raw_input in the Windows implementation bypasses any readline hooks. You'll have to use a different method. -- Tim Roberts, [email protected] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Temporary but named file with BSDDB

2010-06-13 Thread Tim Pinkawa
se, a default directory is used. The default directory is chosen from a platform-dependent list, but the user of the application can control the directory location by setting the TMPDIR, TEMP or TMP environment variables." My guess is it would end up in /tmp by default, unless your system is configured otherwise. Hope this helps, Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: How to print via python on windows

2010-06-14 Thread Tim Golden
On 14/06/2010 16:31, loial wrote: What is the easiest way to send a text file to a networked printer from a python script running on windows? http://timgolden.me.uk/python/win32_how_do_i/print.html TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: How to print via python on windows

2010-06-14 Thread Tim Golden
On 14/06/2010 7:29 PM, rantingrick wrote: On Jun 14, 10:55 am, Tim Golden wrote: On 14/06/2010 16:31, loial wrote: What is the easiest way to send a text file to a networked printer from a python script running on windows? http://timgolden.me.uk/python/win32_how_do_i/print.html

Re: Does MS Office need to be installed to use pywin32 for editing Excel docs?

2010-06-15 Thread Tim Golden
On 15/06/2010 09:32, Astley Le Jasper wrote: Does pywin32 use elements from Windows itself, or excel when dispatching? Yes: it's simply exposing to the Python user the API provided by MS Office (or whatever other app) via the IDispatch COM mechanism. IOW, if you don't have Microsoft Excel inst

Re: Archiving emails in Gmail

2010-06-15 Thread Tim Golden
On 15/06/2010 15:10, Grant Edwards wrote: On 2010-06-15, teja wrote: I have a requirement that I want to log-in into a gmail account read all unread mails, mark them as read and then archive them. I am using libgmail (version 0.1.11) library to do so, using which I am able to log-in into a gma

Re: Archiving emails in Gmail

2010-06-15 Thread Tim Golden
On 15/06/2010 16:15, Grant Edwards wrote: On 2010-06-15, Tim Golden wrote: On 15/06/2010 15:10, Grant Edwards wrote: On 2010-06-15, teja wrote: I have a requirement that I want to log-in into a gmail account read all unread mails, mark them as read and then archive them. I am using

<    62   63   64   65   66   67   68   69   70   71   >