Re: Extract contents of html cells

2006-02-04 Thread Larry Bates
at for the screen-scraping part: http://www.crummy.com/software/BeautifulSoup/ To put them in your html page all you need to do is to have some placeholders in your html and use python to replace the placeholders with the values you get from the other screen. -Larry Bates -- http://mail.python.org

Re: Webmail with Python

2006-02-04 Thread Larry Bates
? Thomas Google turned up the following: http://bobomail.sourceforge.net/ Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: py2exe question

2006-02-03 Thread Larry Bates
. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Python on Windows

2006-02-03 Thread Larry Bates
py2exe to create distribution and then use Inno Installer to create a single setup.exe file that can easily be distributed. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows - create text file - (newb)

2006-02-02 Thread Larry Bates
Yes. To open file: fp=open(r'C:\directory\filename.txt','r') To open file to write to: fp=open(r'C:\directory\filename.txt','w') You probably need to go through the Python tutorial as these items are covered. -Larry Bates Ernesto wrote: Can Python be used to create (and/or open, read

Re: OS.MKDIR( ) Overwriting previous folder created...

2006-02-02 Thread Larry Bates
try os.path.exists(path) -Larry Bates Ernesto wrote: Ernesto wrote: I couldn't find this with a search, but isn't there a way to overwrite a previous folder (or at least not perform osmkdir( ) if your program detects it already exists). Thanks ! I suppose this also leads to the question

Re: dynamic class instantiation

2006-01-30 Thread Larry Bates
definition file (LDF), LDF to python parser is a LOT harder (and slower) than just writing the classes outright. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: winsound.MessageBeep

2006-01-30 Thread Larry Bates
winsound.MessageBeep(winsound.MB_OK) (e.g. MB_OK isn't automatically bound to anything). I tried all of the different sounds and they are different on my machine with the default sounds turned on. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: dynamic class instantiation

2006-01-30 Thread Larry Bates
Ognen Duzlevski wrote: Larry Bates [EMAIL PROTECTED] wrote: Now I want to use something like xml.dom.minidom to parse the .xml file into a set of classes defined according to the language definition file. The parse() method from the xml.dom.minidom package will return a document instance

Re: replacing \n characters in a hash

2006-01-26 Thread Larry Bates
that. Regards, Johhny You must use 'errata_topic' as index into your dictionary to get the string and then replace the \n chars. Example assumes that the dict is pointed to by d): errata_topic_text=d['errata_topic'].replace('\n',' ') Hope this helps. Larry Bates -- http://mail.python.org/mailman

Re: Changing numbers into characters using dictionaries

2006-01-26 Thread Larry Bates
tell me this? Thanks. text = '@[EMAIL PROTECTED]@[EMAIL PROTECTED]' a={'7704':'l','7002':'a','7075':'w'} u=[] for c in text.split('@')[1:]: u.append(a[c]) print ''.join(u) Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run a dos executable from python

2006-01-26 Thread Larry Bates
. Thanks Take a look at the subprocess module or on older versions of Python you can use os.spawn. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: 2-dimensional data structures

2006-01-26 Thread Larry Bates
://numeric.scipy.org/ But you can also do nested lists. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Loading a Python collection from an text-file

2006-01-24 Thread Larry Bates
Take a look at ConfigParser module. The format of the file would be something like: [members] peter=16 anton=21 People are accustomed to this format file (windows .ini format). -Larry Ilias Lazaridis wrote: within a python script, I like to create a collection which I fill with values from

Re: Pulling numbers from ASCII filename not working

2006-01-24 Thread Larry Bates
= [filename.lower() \ for filename in filenames \ if (filename[-4:].lower() == .asc and filename[0] != - )] is better rewritten as (not tested): import glob filenames=glob.glob(os.path.join(gp.workspace, '*.asc')) filenames = [f.lower() for f in filenames if not f.startswith('-')] Larry Bates IamIan wrote

Re: problem of types:

2006-01-17 Thread Larry Bates
-ins from your program. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser: writes a list but reads a string?

2006-01-17 Thread Larry Bates
following: listvalues=INI.get(section, option).split(',') where INI is an instance of ConfigParser There is the problem of if list items contain commas. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: batch tiff to jpeg conversion script

2006-01-11 Thread Larry Bates
) simplifies things by eliminating the splitext methods and slicing operations. 3) eliminates else branch -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple clients updating same file in ftp

2006-01-10 Thread Larry Bates
Preface the update with a rename. If the rename fails, someone else is updating the file, if it succeeds update the file and rename back when finished. Suggestion: ftp is not the best way to handle such a task. Use a database, XMLRPC or sockets is probably a better way. -Larry Bates [EMAIL

Re: Python as a Server vs Running Under Apache

2005-12-30 Thread Larry Bates
to implement from scratch. It may not be for you, but you owe it to yourself to take a look. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: query on python list

2005-12-30 Thread Larry Bates
as: if list2 in list1: # # Do something here # if you want to know if any member of list2 is found in any list in list 1 then you can just do: Found=max([y in x for y in list2 for x in list1]) works and you should have some fun picking this one-liner apart grin. -Larry Bates Mike Meyer wrote

Re: oop in python

2005-12-30 Thread Larry Bates
in a dictionary and make the key 'new' instancedict={} instancedict['new']=Point() then you can call methods by: instancedict['new'].somemethod() -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Indentation/whitespace

2005-12-23 Thread Larry Bates
Joe wrote: Is Python going to support s syntax the does not use it's infamous whitespace rules? I recall reading that Python might include such a feature. Or, maybe just a brace-to-indentation preprocessor would be sufficient. Many people think Python's syntax makes sense. There are strong

Re: A simple list question.

2005-12-22 Thread Larry Bates
where self.currentSlice comes from. You also need a condition on your elif. Perhaps more explanation is needed (at least for me to help). -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: adding string values to a list?

2005-12-21 Thread Larry Bates
letters. result.append(name) -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: RasAdminUserGetInfo

2005-12-20 Thread Larry Bates
on where the road goes from here..MW. Sorry, I misread your initial post. You should be able to use ctypes to call the function or perhaps you can dispatch it manually. I'm not that familiar with the function. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: parsing engineering symbols

2005-12-20 Thread Larry Bates
Something like: def cvt(input): if input.lower().endswith('k'): return float(input[:-1])*1000 . . add your other special symbols here . return None # didn't find a match Larry Bates Suresh Jeevanandam wrote: Hi, I want to convert a string to float value

Re: checking if a string contains a number

2005-12-20 Thread Larry Bates
You should probably work through the tutorials. Use a try block: try: x=float(s) except ValueError: print 'Non-numeric value %s found' % s -Larry Bates Suresh Jeevanandam wrote: Hi, I have a string like, s1 = '12e3' s2 = 'junk' Now before converting these values

Re: attach a pdf file to an email

2005-12-19 Thread Larry Bates
somebody help me about that? Thank You, kychan Here is a great helper class that I have used for several years. I didn't write it, but it has worked fine. Even if you want to write your own, it should help as a guide. http://motion.sourceforge.net/related/send_jpg.py Larry Bates -- http

Re: Problem with exec

2005-12-16 Thread Larry Bates
(): config = Cfg() assign(config) print config.Start foo() You should probably post what you are trying to do. Maybe we can make a suggestion about the best approach. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Browse type function

2005-12-16 Thread Larry Bates
Google is your friend: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/438123 -Larry Bates Tuvas wrote: I am building a GUI interface with Tkinter. I need to have a way to open and save files. Is there a nice GUI that can do that for me, ei, show what files are avaliable, a choose

Re: Worthwhile to reverse a dictionary

2005-12-15 Thread Larry Bates
with chr(x). Not completely sure about what you want to accomplish, but this eliminates the need for the dictionaries. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about tuple lengths

2005-12-15 Thread Larry Bates
a tuple a variable name of tuple, it masks the built-in tuple() function. This also goes for str, or other built-ins. This will bite you at some point if it hasn't already. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuples

2005-12-15 Thread Larry Bates
. Suggestion: You should ALWAYS post your traceback instead of just saying Why won't this work?. Your subject says Tuples then your example is on lists. Were you trying something like this on tuples? That would not work because tuples are immutable. Larry Bates -- http://mail.python.org/mailman

Re: Help: how to run python applications as NT service?

2005-12-12 Thread Larry Bates
the one you have that would help you a lot. Hope this helps. Larry Bates import win32serviceutil import win32service import win32event import win32evtlogutil class Yourservice(win32serviceutil.ServiceFramework): # Indent all code below 4 spaces def SvcDoRun(self): import servicemanager

Re: IsString

2005-12-12 Thread Larry Bates
isinstance is the new preferred method. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Executing a python script with arguments from a python script

2005-12-12 Thread Larry Bates
You can pass arguments into a python script, see getopt module. Then to call an external script you would use subsystem module (or os.system if you are on earlier version of python). If you can, just make the other python program into a function and import it as James Stroud suggests in a

Re: IsString

2005-12-12 Thread Larry Bates
answered. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: binascii.crc32 results not matching

2005-12-11 Thread Larry Bates
Thanks so much for the offer, I had a friend do this for me and it works great. Regards, Larry Bates Heiko Wundram wrote: Larry Bates wrote: snip lots of code The algorithm looks very much like the source code for binascii.crc32 (but I'm not a C programmer). Well... As you have access

Re: binascii.crc32 results not matching

2005-12-10 Thread Larry Bates
Peter Hansen wrote: Larry Bates wrote: I'm trying to get the results of binascii.crc32 to match the results of another utility that produces 32 bit unsigned CRCs. What other utility? As Tim says, there are many CRC32s... the background notes on this one happen to stumble out

Re: installer question

2005-12-09 Thread Larry Bates
Take a look at Inno Installer. You should be able to do everything you list. You may also want to consider using py2exe to package up your python program into .exe prior to creating installer file. That way you eliminate the requirement of having python, pythonwin32 installed and you don't have

Re: Catching error text like that shown in console?

2005-12-09 Thread Larry Bates
Peter A. Schott wrote: I know there's got to be an easy way to do this - I want a way to catch the error text that would normally be shown in an interactive session and put that value into a string I can use later. I've tried just using a catch statement and trying to convert the output to

binascii.crc32 results not matching

2005-12-09 Thread Larry Bates
binascii.crc32? Output snip from test on three files: binascii.crc32=-1412119273, oldcrc32= 2221277246 binascii.crc32=-647246320, oldcrc32=73793598 binascii.crc32=-1391482316, oldcrc32=79075810 Thanks in advance, Regards, Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic Link Library

2005-12-06 Thread Larry Bates
I think py2exe can do this (most recent version), but you would be much better off creating a COM object and calling that from your other application. I KNOW that works quite well. -Larry Bates Ervin J. Obando wrote: Hi everyone, Apologies if my question is a bit novice-ish. I was wondering

Re: getting data off a CDrom

2005-12-05 Thread Larry Bates
) first. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: How to ping in Python?

2005-12-05 Thread Larry Bates
else: myChecksum = socket.htons(myChecksum) You also must import the following modules: import socket import os import sys import struct import time import select -Larry Bates dwelch wrote: Nico Grubert wrote: Hi there, I could not find any ping Class or Handler in python (2.3.5

Re: how to run an external program...

2005-12-01 Thread Larry Bates
In addition to what Philippe suggested, take a look at the subprocess module as well (if you are on Python 2.4 or greater). -Larry Bates ash wrote: hi, i want to know is there a way to run/control an external program form within a python program? thanks in advance for any support. -- http

Re: import Excel csv - files

2005-11-30 Thread Larry Bates
You should actually explain what you mean by export. Excel has a Save As HTML that would save everything out to HTML or you can do Save As .CSV. Hard to tell what you want. I suspect that to get to the cell comments you will need to go through COM interface to Excel. -Larry Bates Micah

Re: Web functions idea

2005-11-29 Thread Larry Bates
The client software can be written in JavaScript that makes xmlrpc calls to the server (AJAX). That way there is no installation required. But there are loads of free, debugged mailing list programs out there that use email as the interface. You should take a look there first. -Larry Bates

Re: Stretching a bitmap

2005-11-17 Thread Larry Bates
Python Imaging Library (PIL) can size bitmaps. I use it to create thumbnails or to size bitmaps quite often. There may be a wxPython built-in for this also, but I don't know what it would be. -Larry Bates David Poundall wrote: Is it possible to import a bitmap and stretch it to fit a defined

Re: Where can I find an example that uses FTP standard library?

2005-11-15 Thread Larry Bates
entered python ftplib example and turned up several examples like: http://postneo.com/stories/2003/01/01/beyondTheBasicPythonFtplibExample.html -Larry Bates QuadriKev wrote: I am fairly new to programming in Python. There are a number of cases where I would like to see examples of programs

Re: AJAX = APAX? Or: is there support for python in browsers?

2005-11-15 Thread Larry Bates
insights to be shared? Cheers, Roger Take a look at this kit: http://www.mochikit.com/ It seems that this is a python programmer that has created JavaScript functions that feel a lot like Python. May just be a transitional way to go, but I thought it was interesting anyway. -Larry Bates

Re: Python Book

2005-11-14 Thread Larry Bates
The ones that were best for me: -Python 2.1 Bible (Dave Brueck and Stephen Tanner) (dated but good to learn) -Python Cookbook (Alex Martelli, Anna Martelli Ravenscroft David Ascher) If you write for Windows: Python Programming on Win32 (Mark Hammond Andy Robinson) Larry Bates David

Re: output buffering

2005-11-11 Thread Larry Bates
This is something I wrote that might help. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/299207 -Larry Bates JD wrote: Hello, When reading a large datafile, I want to print a '.' to show the progress. This fails, I get the series of '.'s after the data has been read

Re: Internal Variables

2005-11-11 Thread Larry Bates
What you want are attributes of sys object. import sys print sys.version -Larry Bates James Colannino wrote: Hey everyone. I hope I have my terminology right, because I'm not quite sure what to call them. I was just wondering how I can find information in internal variables (for example

Re: mod_python web-dav management system

2005-11-11 Thread Larry Bates
Zope has WebDAV support and is written in Python. You could use Zope or perhaps use parts of it (since it is open source). -Larry Bates Damjan wrote: Apache2 comes with builtin Web-dav support, but authorization is limited to Apache's methods, which are not very flexible. Now I've been

Re: Script to export MySQL tables to csv

2005-11-10 Thread Larry Bates
nicely. http://www.apexsql.com/sql_tools_diff.asp Sometimes I find it better to buy than to write ;-). Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: help make it faster please

2005-11-10 Thread Larry Bates
, countDict[word]) print Elapsed time in create_words function=%.2f seconds % elapsed_time I ran this against a 551K text file and it runs in 0.11 seconds on my machine (3.0Ghz P4). Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: not able to HTTPS page from python

2005-11-09 Thread Larry Bates
a thought since you have spent days on this. -Larry Bates [EMAIL PROTECTED] wrote: Hi all, Am trying to read a email ids which will be in the form of links ( on which if we click, they will redirect to outlook with their respective email ids). And these links are in the HTTPS page

Re: parse data

2005-11-09 Thread Larry Bates
doing data.index(name)...over and over? thanks! Something like this works if line spacing can be depended on. Also a good way to hide the actual format of the string from your main program. Larry Bates class personClass: def __init__(self, nameline, ageline): self.name

Re: plugin interface / list

2005-11-08 Thread Larry Bates
(audioBase): def __init__(self, **kwargs): audioBase.__init__(self, **kwargs) return # # Define mp3player specific methods # # Main program # obj=mp3Player(file='abc.mp3', add other keyword arguments) -Larry Bates -- http://mail.python.org/mailman/listinfo/python

Re: struct.calcsize problem

2005-11-07 Thread Larry Bates
fmt='B', calcsize=1, sumofcalcsize=461, calcsize=464 fmt='B', calcsize=1, sumofcalcsize=462, calcsize=465 fmt='64s', calcsize=64, sumofcalcsize=526, calcsize=529 fmt='64s', calcsize=64, sumofcalcsize=590, calcsize=593 Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: reading a config file

2005-11-04 Thread Larry Bates
like this: import ConfigParser INI=ConfigParser.ConfigParser() INI.read(inifilename) serversections=[x for x in INI.sections if x.startswith('server_')] for serversection in serversections: servername=serversection.split('_')[1] # # Code to operate on the servers here # Larry

Re: how to open a windows folder?

2005-11-04 Thread Larry Bates
Not elegant but this works: import os os.system(r'start explorer.exe C:\temp') -Larry Bates Bell, Kevin wrote: I'd love to be able to open up a windows folder, like c:\temp, so that it pops up visually. I know how to drill down into a directory, but I can't figure out how to open one up

Re: How to read all files in a directory

2005-11-03 Thread Larry Bates
Not tested: import glob import os path=r'C:\datafiles\' for fileName in glob.glob(os.path.join(path,'*.DAT')): dataFile=open(fileName, 'r').readlines() . . Continue yur code here . -Larry Bates hungbichvo wrote: Dear All, My python application is small. It reads data from

Re: An FAQ Please Respond

2005-11-02 Thread Larry Bates
You can certainly have more than one version loaded. You may find it easier to fall back to Python 2.3. Unless you are using 2.4 specific features, it won't cost you much. You have to mess with path, associations, etc. in Windows registry to switch between the two. -Larry Bates clinton Brandt

Re: array of Tkinter variables?

2005-11-01 Thread Larry Bates
=[] for i in range(32): sv=StringVar() sv.set('000') self.dllAdjust.append(sv) (not tested) Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: SNMP

2005-10-28 Thread Larry Bates
the following: Yet Another Python SNMP module - http://yapsnmp.sourceforge.net/intro.html Python SNMP framework - http://pysnmp.sourceforge.net/ Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: 64 bit python binaries (or builds) for Xeon and Opteron architectures on Windows platforms

2005-10-26 Thread Larry Bates
We are running 64 bit compiled python on Red Hat Fedora Core 3. Hardware is 64 bit on Dual Opteron HP servers running SMP. FYI, Larry [EMAIL PROTECTED] wrote: Does anyone have any information about 64 bit python support for Xeon and Opteron architectures on Windows platforms? If anyone has

Re: Newbie question: string replace

2005-10-25 Thread Larry Bates
() INI.read(r'C:\program.ini') INI.set('service_A','username','newusername') fp=open(r'c:\program.ini','w') INI.write(fp) fp.close() Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Log rolling question

2005-10-25 Thread Larry Bates
import time # # 120 days, 24 hours, 60 monutes, 60 seconds # fourmonthsago=time.time()-(120*24*60*60) Compare fourmonthsago value to modified date of files. Delete those that are less. Larry Bates elake wrote: I have an application that creates a lot of large log files. I only want to keep

Re: pushing python to multiple windows machines

2005-10-21 Thread Larry Bates
with lots of tools. Larry Bates [EMAIL PROTECTED] wrote: hey tim - Thanks for you input. I'm looking at it from the Windows perspective of needing to push a python interpreter out to multiple machines. I'll check out Moveable Python as you suggested. thanks -shawn -- http

Re: HELP! py2exe error - No module named decimal

2005-10-21 Thread Larry Bates
about dynamic imports which happen at runtime. -Larry Bates Chris wrote: I've just completed a project using the following (Windows XP, python 2.4.1, wxpython 2.6, and pymssql 0.7.3). The program runs great, but after I convert it to an exe (required for this project), it gives me

Re: Help with language, dev tool selection

2005-10-21 Thread Larry Bates
pages to your webserver as to write this entire application. -Larry Bates [EMAIL PROTECTED] wrote: I have a problem that I have to solve programmatically and since HTML is pretty much the only code I have been exposed to I need an advice on how to develop the programmatic solution

Re: Converting 2bit hex representation to integer ?

2005-10-20 Thread Larry Bates
: import struct s='\x64' values=struct.unpack('b',s) print values=,values value=(100,) Note: struct.unpack returns a tuple of values. Just get values[0] to get the first one. Larry Madhusudan Singh wrote: Larry Bates wrote: Can you give us an example. I don't know what two bit hex means

Re: Accessing a dll from Python

2005-10-20 Thread Larry Bates
If you want you can also take a look at something I wrote a while ago (before ctypes was really well known). It has worked for me with .DLLS form Castelle and Expervision that both have extensive APIs. It is located here: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146847 Larry

Re: best way to replace first word in string?

2005-10-20 Thread Larry Bates
% (firstword, restwords) I'm sure the regular expression gurus here can come up with something if it can be followed by other than a space. -Larry Bates [EMAIL PROTECTED] wrote: I am looking for the best and efficient way to replace the first word in a str, like this: aa to become - /aa

Re: Modules and Namespaces

2005-10-20 Thread Larry Bates
): self.id = 'self.id srfBase' self.RS=RS return def isBrep(self): return self.RS.IsBrep(self.id) def isPointInSurface(self, coord): return self.RS.IsPointInSurface(self.id, coord) This is how most of wxWindows seems to do things. -Larry Bates Jelle

Re: need some advice on x y plot

2005-10-20 Thread Larry Bates
I would try to live with time scale being fixed and insert None (or whatever value is used by charting package) for times where observations were not taken. This will mean that you have to preprocess your data by determining a time step step value that will fit your data. If you get 3

Re: Dealing with Excel

2005-10-19 Thread Larry Bates
for later re-use. If you want, you can automate this process using Python COM+ interface to Excel. Larry Bates Robert Hicks wrote: I need to pull data out of Oracle and stuff it into an Excel spreadsheet. What modules have you used to interface with Excel and would you recommend it? Robert

Re: Converting 2bit hex representation to integer ?

2005-10-19 Thread Larry Bates
Can you give us an example. I don't know what two bit hex means (takes at least 4 bits to make a hex digit). Now I'm going to try to guess: If the data is binary then all you need to do is to use the struct.unpack module to convert to integer. Larry Bates Madhusudan Singh wrote: Hi I am

Re: example of using urllib2 with https urls

2005-10-18 Thread Larry Bates
=, headers end snip This is for Basic Authentication (if your https site is using something different, method would be different). May not be what you need. Hope this helps. Larry Bates Michele Simionato wrote: Can somebody provide an example of how to retrieve a https url, given username

Re: [newbie]Is there a module for print object in a readable format?

2005-10-17 Thread Larry Bates
to this problem. -Larry Bates Steven D'Aprano wrote: On Mon, 17 Oct 2005 17:25:35 +0800, James Gan wrote: I want the object printed in a readable format. For example, x =[a, b, c, [d e]] will be printed as: x--a |_b |_c |___d |_e I think you missed an un- in your first sentence

Re: get_payload problem with large mail attachments

2005-10-14 Thread Larry Bates
While I don't intend to stir up a hornet's nest, I feel an obligation to point out that an 8Mb email attachment should set off warning bells. I don't believe that SMTP email is very efficient at moving such large files around and that there are other methods for moving them more efficiently. I've

Re: Searching files in directories

2005-10-14 Thread Larry Bates
(os.path.join(source_directory, file): shutil.copy(src, dst) -Larry Bates [EMAIL PROTECTED] wrote: can anyone help me with this... I want to search for a list for files in a given directory and if it exists copy them to destination directory so what i am looking for is : file

Re: extract PDF pages

2005-10-13 Thread Larry Bates
I've used ReportLab's PageCatcher. It isn't free, but I've gladly paid for the functionality it gives me. Larry Bates http://www.reportlab.com/pagecatcher_index.html David Isaac wrote: While pdftk is awesome http://www.accesspdf.com/pdftk/ I am looking for a Python solution. Just for PDF

Re: Converting C++ array into Python

2005-10-12 Thread Larry Bates
Like others, without more information on what you have tried we are just guessing. Many times I've used the struct.unpack() module to unpack C arrays into python objects. Don't know if this will help, but thought I'd pass it along. Post some code and we can help more. -Larry Bates Adriaan

Re: Listen for directory events

2005-10-12 Thread Larry Bates
. Google is your friend! Larry Bates Bell, Kevin wrote: Anyone have any advice on listening for directory events? I'd like to fire off my script if new files are added to a directory. Right now, I've set up my script as a scheduled task (Windows XP) and when the script is run periodically

Re: Converting C++ array into Python

2005-10-12 Thread Larry Bates
Yes, I'm normally calling .DLL function with a defined API and memory layout. May not be optimal, when you don't have the C code available and the data structure is part of the API it works just fine. -Larry Bates Jorgen Grahn wrote: On Wed, 12 Oct 2005 11:13:52 -0500, Larry Bates [EMAIL

Re: File compare

2005-10-12 Thread Larry Bates
: f1=fobject(r'f:\syscon\python\zbkup\f1.txt') f2=fobject(r'f:\syscon\python\zbkup\f2.txt') print f1.compare(f2) Larry Bates PyPK wrote: I have two files file1 in format id val1 test1 test2 'AA' 1 T T 'AB' 1 T F file2 same as file1 id val1 test1 test2 'AA' 1 T T 'AB' 1 T T

Re: how to execute .exe file ?

2005-10-11 Thread Larry Bates
, environment, etc. is the win32process.CreateProcess module which is part of the win32 extensions by Mark Hammond. This requires a bit more work, but gives you control over almost every aspect of a Windows GUI application window at startup. -Larry Bates [EMAIL PROTECTED] wrote: hi all~ i used to drive

Re: Default argument to __init__

2005-10-10 Thread Larry Bates
This comes up on the list about once a week on this list. See: http://www.nexedi.org/sections/education/python/tips_and_tricks/python_and_mutable_n/view -Larry Bates [EMAIL PROTECTED] wrote: Hi All: Here's a piece of Python code and it's output. The output that Python shows is not as per

Re: convert char to byte representation

2005-10-10 Thread Larry Bates
ord(c) gives you decimal representation of a character. -Larry Bates Philipp H. Mohr wrote: Hello, I am trying to xor the byte representation of every char in a string with its predecessor. But I don't know how to convert a char into its byte representation. This is to calculate the nmea

Re: Changing console text color

2005-10-10 Thread Larry Bates
You can use this module to control console windows background and text colors. http://www.effbot.org/zone/console-index.htm -Larry Bates Steve M wrote: Hello, I've been trying to change the text color on a windows console program I've been working on with no luck. I should mention

Re: convert char to byte representation

2005-10-10 Thread Larry Bates
that most character charts list the number that ord() returns as the decimal representation of that character (as they normally also show the octal and hex values as well). Probably an old school answer on my part. -Larry Bates Grant Edwards wrote: On 2005-10-10, Larry Bates [EMAIL PROTECTED

Re: Copy files to Linux server through ssh tunnel

2005-10-06 Thread Larry Bates
You might want to install copy of Cygwin on your Windows box. Then you can use scp or maybe rsync over ssh to do the copying. Works great for me. -Larry Bates [EMAIL PROTECTED] wrote: Hi ! I have some backup files on a server farm. I want to store these local backup files on a backup file

Re: date reformatting

2005-10-06 Thread Larry Bates
There's more than one way, but this one will work for dates prior to 2000. import time datestring='8-15-05' d=time.strptime(datestring,'%m-%d-%y') number=1*d[0]+100*d[1]+d[2] print number -Larry Bates Bell, Kevin wrote: Anyone aware of existing code to turn a date string 8-15-05

Re: interactive window vs. script: inconsistent behavior

2005-10-06 Thread Larry Bates
This also works and IMHO reads better: d=5-18-05 to 5-31-05 f,t=d.split(' to ')) Larry Bates Bell, Kevin wrote: The following works in the interactive window of PythonWin, but fails in a script. TypeError: Objects of type 'slice' can not be converted to a COM VARIANT I just need to parse

Re: Using command line args on Windows

2005-10-05 Thread Larry Bates
1) Start a command prompt window (Start-Programs-Accessories-Command Prompt) 2) Change to directory where the python program is stored (cd \path-where-script-stored) 3) Type python myscript.py myarg -Larry Bates k8 wrote: Hello- I'm stuck on a Windows machine today and would love

Re: Graphical debugger/code explorer

2005-10-03 Thread Larry Bates
Eclipse - http://www.eclipse.org/ http://wiki.python.org/moin/EclipsePythonIntegration Florian Lindner wrote: Hello, in order to understand python code from a larger project (Zope 3) I'm looking for a tool that helps me with that. It should also help What (graphical) application running on

<    4   5   6   7   8   9   10   11   >