Re: So what exactly is a complex number?

2007-09-01 Thread Tim Daneliuk
Wildemar Wildenburger wrote: > Lawrence D'Oliveiro wrote: >> In message <[EMAIL PROTECTED]>, >> Wildemar >> Wildenburger wrote: >> >>> Tim Daneliuk wrote: >>>> One of the most common uses for Complex Numbers is in what are >>>

Re: So what exactly is a complex number?

2007-09-01 Thread Tim Daneliuk
from, why is it 'imaginary' etc. Since we're being arses > here I'd hazard a guess you were educated in the USA where doing without > understanding has been mastered by teachers and students alike. You're I was initially educated in Europe where being rude w

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: Setting Current Dir in Python

2007-09-04 Thread Tim Couper
hat line and remove the character - or line. Tim Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com Sandipan Gangopadhyay wrote: > Hi all! > > I have utility programs in Python that do clean up, image processing tasks > on files in a folder. I just drop the program into the folder and run it.

Re: Setting Current Dir in Python

2007-09-04 Thread Tim Couper
Steve Of course it is. I'd like to think I left a test for the observant, but in reality it just shows I can't copy-type ... :-) Tim Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com Steve Holden wrote: > Tim Couper wrote: > >> "Non-ASC

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: startswith( prefix[, start[, end]]) Query

2007-09-06 Thread Tim Williams
On 06/09/07, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > You may want to try with a regexp, but I'm not sure it's worth it (hint: > the timeit module is great for quick small benchmarks). > > Else, you could as well write your own testing function: > > def str_starts_with(astring, *prefixes)

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: why should I learn python

2007-09-07 Thread Tim Williams
On 07/09/07, Tom Brown <[EMAIL PROTECTED]> wrote: > On Thursday 06 September 2007 16:01, windandwaves wrote: > > Hmmm, thank you all for your replies. I will do some research on the > > net (i did some already, but because I am really not much of a > > programmer, it is often too detailed for me).

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)

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

Re: Using a time duration to print out data where every 2 seconds is a pixel

2007-09-11 Thread Tim Roberts
;) >>finishPoint = strptime(step.fTime, "%H:%S:%M") Your conversion strings cannot be correct. Sure, there are international differences in rendering dates and times, but not even in Eastern WhereTheHeckIsStan do they encode hours, then seconds, then minutes. -- Tim Roberts

IOError - list of all Errno numbers and their meanings?

2007-09-11 Thread Tim Couper
As you know, when an IOError is raised, you get a helpful: [Errno N] Is there a list of all possible values of N which can be returned, and their meanings? -- Dr Tim Couper CTO, SciVisum Ltd www.scivisum.com -- http://mail.python.org/mailman/listinfo/python-list

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 thou

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 pro

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: anybody has py modules emulating symbian 60 on PC?

2007-09-12 Thread Tim Roberts
Steve Holden <[EMAIL PROTECTED]> wrote: > >http://archive.devx.com/wireless/vendordocs/nokia.asp might help. Or it >might not. How utterly refreshing: a completely honest Usenet posting... -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail

Re: Error in random module, bad installation?

2007-09-12 Thread Tim Roberts
cal/bin/python >$ echo $PYTHONPATH >/usr/local/bin/python PYTHONPATH is supposed to point to the directory containing modules, NOT the directory containing the executable. It should be /lib/python2.5. However, Carsten had the real cause for your immediate problem. -- Tim Roberts, [

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: extract text from log file using re

2007-09-13 Thread Tim Williams
On 13/09/2007, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: > me again... I should describe it better: > the result should be an array with just: > > 498 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04 8.3956e-04 > 3.8560e-03 4.8384e-02 11:40:01 499 > 499 1.0086e-03 2.4608e-04 9.8589e-05 1.4908e-04

Re: HL7 servers in Python?

2007-03-02 Thread Tim Churches
nd outgoing messages, and Interfaceware, whose closed-source products also embed Python for scripting purposes - see for example http://www.interfaceware.com/manual/ch-7-7-4.html There may be others. Hope this helps, Tim C > HL7 servers in Python? > > Richard Sharp > <mailto:py

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: how can I find out the value of an environment variable?

2007-03-07 Thread Tim Roberts
ot;, "credits" or "license" for more information. >>> import os >>> os.environ['PATH'] 'C:\\WINDOWS\\system32;c:\\WINDOWS;c:\\WINDOWS\\System32\\Wbem;c:\\bin;e:\\bin' >>> -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

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: merits of Lisp vs Python

2007-03-09 Thread Tim Bradshaw
On 2007-03-09 07:00:06 +, [EMAIL PROTECTED] (Alex Martelli) said: > (nee "One Laptop Per Child", OLPC, and once known as the "$100 laptop") > uses Python as its preferred (only?-) application language, and it's > slated to be the most widely distributed Python distro if it hits even > half of

Re: Signed zeros: is this a bug?

2007-03-11 Thread Tim Peters
[attribution lost] ... >>> Yup: the workaround seems to be as simple as replacing all occurrences >>> of -0.0 with -(0.0). I'm embarrassed that I didn't figure this out >>> sooner. >>> >>> >>> x, y = -(0.0), 0.0 >>> >>> x, y >>> (-0.0, 0.0) [Alex Martelli] >> Glad it works for you, but it's the

Re: Starting Python... some questions

2007-03-12 Thread Tim Roberts
payload = p.chassis_id_tlv > ether = scapy.Ether(dst="01:02:03:04:05:06") > fullpayload = ether + payload > sendp(fullpayload) Now, at the end, add: if __name__=="__main__": main() That should do it. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

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: fifo queue

2007-03-19 Thread Tim Roberts
"drochom" <[EMAIL PROTECTED]> wrote: > >how would u improve this code? I would add at least one comment... -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

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: How can I check if the listdir result a directory?

2007-03-22 Thread Tim Daneliuk
if 'f' a directory? > Try os.path.isdir() -- -------- Tim Daneliuk [EMAIL PROTECTED] PGP Key: http://www.tundraware.com/PGP/ -- http://mail.python.org/mailman/listinfo/python-list

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: Fortran vs Python - Newbie Question

2007-03-27 Thread Tim Roberts
avac) is very different from the use of "compiled" in the context of running gcc. Once upon a time, Basic enthusiasts would have used the word "tokenized" to describe .pyc files. A .pyc file is, in fact, interpreted by an intermediate language interpreter. I don't u

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)

encoding confusions

2007-03-29 Thread Tim Arnold
work and I read some more and did this: tFile.write(self.contents.encode('latin-1')) but that gives me the same error UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 48: ordinal not in range(128) this is python2.4.1 (hpux) sys.getdefaultencoding() 'ascii' thanks, --Tim Arnold -- http://mail.python.org/mailman/listinfo/python-list

Re: Sending emails to 3 addresses....

2007-03-30 Thread Tim Williams
On 30/03/07, Boudreau, Emile <[EMAIL PROTECTED]> wrote: > > sendMail('this is the subject line', 'the results: 71 fails, 229 pass, 300 > total.', '[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]') > > def sendMail(subject, body, TO, FROM="[EMAIL PROTECTED]"): > print TO > HOST = "ex

Re: Sending emails to 3 addresses....

2007-03-30 Thread Tim Williams
On 30/03/07, Tim Williams <[EMAIL PROTECTED]> wrote: Emile, (slight change to my original reply) You are passing the TO addresses as 3 addresses in a single string. [TO] results in a list containing a single string - not a list containing 3 individual addresses. You need to either pa

Re: File deletion after 72 hours of creation

2007-03-30 Thread Tim Williams
On 29 Mar 2007 13:40:58 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Mar 29, 12:02 pm, [EMAIL PROTECTED] wrote: > > Alex> I'm looking for a simple method to delete a folder after 72 > > Alex> "Business hours" (saturday/sunday doesnt count) since its > > Alex> creation. Note

Re: Is any way to split zip archive to sections?

2007-03-31 Thread Tim Williams
On 30/03/07, Durumdara <[EMAIL PROTECTED]> wrote: > Hi! > > I want to create some backup archives with python (I want to write a backup > application in Python). > Some package managers (7z, arj, winzip) can create splitted archives (1 > mega, 650, 700 mega, etc). > > Because I want to ftp these re

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

Re: Math with unicode strings?

2007-04-04 Thread Tim Roberts
I >"cast" the string into an interger? When I see a typo once, I figure it's a typo, but when I see it three times, I figure it is a misunderstanding. The word is "integer", not "interger". -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: way to extract only the message from pop3

2007-04-04 Thread Tim Roberts
ommands fetch the headers. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: bool value 'False' no memory address?

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

Re: Indentifying the LAST occurrence of an item in a list

2007-04-04 Thread Tim Williams
On 4 Apr 2007 08:58:49 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > For any list x, x.index(item) returns the index of the FIRST > occurrence of the item in x. Is there a simple way to identify the > LAST occurrence of an item in a list? My solution feels complex - > reverse the list, look

Re: way to extract only the message from pop3

2007-04-05 Thread Tim Williams
On 3 Apr 2007 12:36:10 -0700, flit <[EMAIL PROTECTED]> wrote: > Hello All, > > Using poplib in python I can extract only the headers using the .top, > there is a way to extract only the message text without the headers? for i in range( M.stat()[0] ): # M.stat returns msg-count and mbox size ms

Re: way to extract only the message from pop3

2007-04-05 Thread Tim Williams
ent_type() in required: text_parts.append(part) print ('\r\n' + '='*76 +'\r\n').join(text_parts) # print all the text parts seperated by a line of '=' # end Whether you use the email module or not, you need to join the retrieved message i

Re: way to extract only the message from pop3

2007-04-05 Thread Tim Williams
On 06/04/07, Tim Williams <[EMAIL PROTECTED]> wrote: > Content: ['text/plain', 'text/html', 'message/delivery-status', > 'text/plain', 'text/plain', 'text/plain', 'unknown', 'message/rfc822'

Re: How to tell when a file is opened

2007-04-07 Thread Tim Golden
r so this will be on > quite a large scale. So checking a directory on a loop for accesses > won't work. > > Maybe some way to monitor the Open Files section of Computer > Management? > > I check through Tim Golden's site but nothing jumped out at me. > Any pointers wou

Re: Can't Get Email Interface Working

2007-04-07 Thread Tim Williams
On 07/04/07, Eric Price <[EMAIL PROTECTED]> wrote: > Good grief! And they call a 722-line program "simple"?! LOL! > I did what I need to do with a __one_line_shell_script__ LOL! > Naw, if I have to go through all that, I'll skip on python this time around, > thank you very much! > Eric Yup, its no

Re: How to tell when a file is opened

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

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

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

Re: Shutting down windows using win32api

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

Re: Arrays, Got Me Confused

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

Re: Arrays, Got Me Confused

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

Re: function with list argument defaulting to [] - what's going on here???

2007-04-15 Thread Tim Leslie
gt; > > > This comes up so often that I wonder whether Python should issue a warning > > when it sees [] or {} as a default argument. > > > > What do people think? A misuse or good use of warnings? > > > > -- > > Steven. > > I wonder if it is a check done by Pylint or PyChecker? It is a check done by pylint Tim > > - Paddy. > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing Log CSV (Efficiently)

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

Re: Writing Log CSV (Efficiently)

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

Re: Writing Log CSV (Efficiently)

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

subprocess confusion

2007-04-16 Thread Tim Arnold
h in the actual command instead of preexec_fn? thanks, --Tim Arnold --- if machine == socket.gethostname(): shname = None else: shname = lambda :'/bin/remsh %s ' % (machine) p = subprocess.Popen(preexec_fn = shname, shell = True, args

Re: Python Feature Request: Allow changing base of member indices to 1

2007-04-16 Thread Tim Roberts
duced in FORTRAN 77. FORTRAN 66 didn't do this. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: sql to xml

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

Re: question of easyExcel (<>)

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

Re: subprocess confusion

2007-04-17 Thread Tim Arnold
"Nick Craig-Wood" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Tim Arnold <[EMAIL PROTECTED]> wrote: >> Should I just put the remsh in the actual command instead of >> preexec_fn? > > Yes. > > The preexec_fn is run after the

Re: Deleting or Empty a File

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

Re: Screen Control in WinXP and Linux

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

Re: X root Operator help

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

Re: smtp debugging methods

2007-09-14 Thread Tim Williams
On 14/09/2007, Sean Nakasone <[EMAIL PROTECTED]> wrote: > I'm having trouble with sending smtp mail. It's hanging after the > smtplib.SMTP() line. It doesn't works from home but not from work. What's > the best way to debug this? > > # Here's my script > import smtplib > msg = "Subject: Hello\n\n

Re: smtp debugging methods

2007-09-14 Thread Tim Roberts
twork at work has a firewall blocking these ports. Many employers allow outgoing connections only on ports 25, 80, and 443. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: trim start and trailing space chars from string

2007-09-15 Thread Tim Williams
On 15/09/2007, Konstantinos Pachopoulos <[EMAIL PROTECTED]> wrote: > Hi, > is there something corresponding to the java String.trim() method, ie > trim start and trailing space/tab chars from string? > say convert " asdf " to "asdf"? >>> ' asdf '.strip() 'asdf' >>> ' asdf '.rstrip() ' asdf' >>>

Re: curses: x, y positioning

2007-09-16 Thread Tim Roberts
quot;): >break >if ch <= 255: >screen.addstr(30, 10, "*%s*" % chr(ch)) >screen.refresh() > >curses.wrapper(my_program) Don't you want mvaddstr? (And remember that y comes first.) -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

cvs module

2007-09-18 Thread Tim Arnold
Hi, I need to do some scripting that interacts with CVS. I've been just doing system calls and parsing the output to figure out what's going on, but it would be nice to deal with CVS directly. Does anyone know of a python module I can use to interface with CVS? thanks, --Tim Arnold

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