Re: ConfigParser - add a stop sentinel?

2005-01-12 Thread Larry Bates
, Larry Bates rzed wrote: I am working with PythonCard in one of my apps. For its purposes, it uses an .ini file that is passed to ConfigParser. For my app, I also need configuration information, but for various reasons, I'd rather use a syntax that ConfigParser can't handle. I know I can maintain

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread Larry Bates
). It provides you with Python SQL-like database and may be better solution if data is basically static and you do lots of processing. All depends on how you use the data. Regards, Larry Bates Syscon, Inc. Chris Lasher wrote: Hello, I have a rather large (100+ MB) FASTA file from which I need

Re: newbie ?s

2005-01-13 Thread Larry Bates
You should probably take a look at: http://www.amk.ca/python/code/medusa Larry Bates Syscon, Inc. Venkat B wrote: Hi folks, I'm looking build a CGI-capable SSL-enabled web-server around Python 2.4 on Linux. It is to handle ~25 hits possibly arriving at once. Content is non-static and built

Re: Has apparent 2.4b1 bug been fixed? flatten in Lib\compiler\ast.py overloads 'list' name

2005-01-19 Thread Larry Bates
You have name clashing between Python's built in list function and the variable called list that you pass into the function. Change the passed in variable name to something else. Larry Bates Try something like (not tested): def flatten(seq): l = [] for elt in seq: if isinstance(elt

Re: Help with saving and restoring program state

2005-01-24 Thread Larry Bates
/adytumsolutions/HowToLoveZODB_PartII/HowToLoveZODB_PartI http://zope.org Hope information helps. Larry Bates Jacob H wrote: Hello list... I'm developing an adventure game in Python (which of course is lots of fun). One of the features is the ability to save games and restore the saves later. I'm

Re: exclude binary files from os.walk

2005-01-26 Thread Larry Bates
could be of more help, if you would take the time to explain a little about what you are trying to do. Larry Bates rbt wrote: Grant Edwards wrote: On 2005-01-26, rbt [EMAIL PROTECTED] wrote: Is there an easy way to exclude binary files (I'm working on Windows XP) from the file list returned by os.walk

Re: HTML Tree View with ol and a href

2005-01-28 Thread Larry Bates
-javascript so it is very fast. Larry Bates Gregor Horvath wrote: Hi, Before I reinvent the wheel I`d like to ask if someone has done this before since I did not find an advice at Google. The goal is to create a dynamic Tree View in HTML. Say I have a data strucure like this: structList = {'Sun':{'Sun

Re: Help with web dashboard

2005-01-28 Thread Larry Bates
page. Larry Bates Chris wrote: I've written some python scripts to handle different tasks on my Windows network. I would like for them to be accessible via a single web page (kind of like a dashboard) but have the scripts run on the web server (also a Windows box). Can anyone recommend a way (web

Re: is extending an object considered acceptable usage?

2005-01-28 Thread Larry Bates
raise StopIteration # # Increment the index pointer for the next call # self.next_index+=1 return CATEGORY I had one project where these were nested 5-6 deep and the resultant code reads beautifully. Larry Bates mike wrote: i have an Item which

Re: some kind of LFU dict...

2005-01-28 Thread Larry Bates
Sounds like you want a database (e.g. on disk storage of keys and values that get accessed via the key). Take a look at one of the databases for storing your key/value pairs. Larry Bates Joh wrote: Hello, (first i'm sorry for my bad english...) for a program, i need to have some kind of dictionary

Re: Description Field in WinXP Services

2005-01-31 Thread Larry Bates
to PythonService.exe so that EventLog messages can be properly decoded. ''' win32evtlogutil.AddSourceToRegistry(self._svc_name_, sourcepath, 'Application') return Hope it helps, Larry Bates rbt wrote: rbt wrote: Roger Upole wrote

Re: CONTEST - What is the (best) solution?

2005-02-02 Thread Larry Bates
(firstdictstr) lastdict=eval(lastdictstr) print firstdict=, firstdict print lastdict=, lastdict firstdict=eval(firstdictstr) lastdict=eval(lastdictstr) Larry Bates [EMAIL PROTECTED] wrote: In a file there can be several dictionaries like this {Key11: Value11 Key12: Value12 Key13: Value13

Re: Prepending to traceback

2005-02-02 Thread Larry Bates
=excepthook Larry Bates Stefan Behnel wrote: Hi! I'm writing a parser using pyparsing and I would like to augment the ParserException tracebacks with information about the actual error line *in the parsed text*. Pyparsing provides me with everything I need (parsed line and column), but is there a way

Re: global variables

2005-02-02 Thread Larry Bates
, 'global3':3, 'global4':4} C=c(1, 2, **globals) you will have global1, global2, global3, and global4 attributs in all classes. If you don't want the attributes, just access to the values, delete the self.__dict__.update(kwargs) lines. Larry Bates alex wrote: Hi, is it possible to create 'global

Re: CONTEST - What is the (best) solution?

2005-02-03 Thread Larry Bates
The data contains only references to variables in the local namespace an not literal values. Since local variable names cannot include '{' or '}' characters, my solution does in fact meet the criteria outlined. Larry Bates Fuzzyman wrote: Doesn't work if '{' or '}' can appear in the values

Re: remove duplicates from list *preserving order*

2005-02-03 Thread Larry Bates
Take a look at this recipe on ASPN: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/204297 I think it might help. Larry Bates Steven Bethard wrote: I'm sorry, I assume this has been discussed somewhere already, but I found only a few hits in Google Groups... If you know where there's

Re: mounting a filesystem?

2005-02-04 Thread Larry Bates
There is smbmount, but I don't know what type of filesystem you are looking for. http://redclay.altervista.org/ Larry Bates Dan Stromberg wrote: Is there a python module that can mount a filesystem? More specifically, a loopback filesystem with a particular offset, under linux? Thanks! -- http

Re: Performance Issues of MySQL with Python

2005-02-09 Thread Larry Bates
random thoughts are helpful. Larry Bates sandy wrote: Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to know how will the speed be, what is the memory overhead

Re: Datatype of non-negative values

2005-02-09 Thread Larry Bates
What exactly do you want to happen when result would be negative? I'll guess be zero: pseudocode: x=value x=max(x-something, 0) That way if it goes negative, it sticks to zero. Larry Bates Dirk Hagemann wrote: Hi, Is there a datatype in python which allows no negative values? I subtract several

Re: two questions - no common theme

2005-02-09 Thread Larry Bates
. Larry Bates Sean McIlroy wrote: And now for a pair of questions that are completely different: 1) I'd like to be able to bind callbacks to presses of the arrow buttons on the keyboard. How do you say that in Tkinter? 2) The function 'listdir' in os.path returns a list of all the files in the given

Re: Newbie: SWIG or SIP?

2005-02-09 Thread Larry Bates
with .DLLs from many different manufacturers. Tricky part is having a full definition of API to dll (e.g. argument types) and using struct module to communicate between Python and the .DLL. Larry Bates Brent W. Hughes wrote: I have a third-party DLL and it's associated .h file. The DLL was written

Re: dos box appears when clicking .pyc

2005-02-12 Thread Larry Bates
Change the association for .pyc files to pythonw.exe from python.exe. Larry Bates Philippe C. Martin wrote: Hi, For a few months now, I have been used .pyc script under XP without getting the DOS box. I just re-installed the scripts on another XP box and am now getting the DOS box ! Something

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Python 2.3.5 ?

2004-12-07 Thread Larry Bates
Just because 2.4 arrives doesn't mean that ALL work is stopped on 2.3. It is quite common to have releases overlap. The very newest release is put out (2.4) , but bugs are still being fixed in older (2.3). Larry Bates Luis M. Gonzalez wrote: I'm confussed... Python 2.4 (final) hs been released

Re: Clarification of two concepts (or maybe one?)

2004-12-11 Thread Larry Bates
necessary python .dlls. 2) Something to create a distribution. On Windows a popular choice seems to be Inno Installer. It creates a single setup.exe file that can be distributed and is very flexible. Hope info helps. Larry Bates Syscon, Inc. Fredrik Lundh wrote: Eddie Parker wrote: What Im

Re: Fun with Outlook and MAPI

2004-12-11 Thread Larry Bates
the messages. http://motion.technolust.cx/related/send_jpg.py Here is a link to a class that wraps everything up very nicely. You should be able to be sending SMTP emails with it in 10-15 minutes. It supports binary attachments as well. FYI, Larry Bates Chris wrote: I'm trying to send an e-mail through

Re: Accessing DB2 with Python

2004-12-16 Thread Larry Bates
I just tried the link at it works from here. Site has source and Windows binary versions of software. Looks loke it is being maintained. Windows binary for Python 2.3 was added in September 2004. No 2.4 binary. Larry Bates Syscon, Inc. Shawn Milo wrote: Is anyone doing this? I would like

Re: Permission

2004-12-17 Thread Larry Bates
. Permisssion denied means that you don't have permission to rename this file. Normally this is a rights issue. BTW-os.rename works on XP. Larry Bates Syscon, Inc. -g00t©- wrote: --( oo )-- I don't know if there's a beginner board, just tell me if it's the place; I tried Python

Re: how to pass globals across modules (wxPython)

2004-12-20 Thread Larry Bates
() self.SetTopWindow(self.mainFrame) return True This might not be the best way, but seems to work and models what wxWindows appears to do internally. Larry Bates Syscon, Inc. Martin Drautzburg wrote: My wxPython program starts execution in mainFrame.py like this [...] class MainApp(wxApp

Re: PIL and ReportsLab error

2005-01-05 Thread Larry Bates
PIL doesn't support compressed TIF files. You must uncompress them prior to trying to place them. I use tiffcp utility via os.system call to uncompress TIF files, then place them into my .PDF file. Larry Bates Syscon, Inc. Jason Koch wrote: Hello, I am trying to produce pdf files from tiffs

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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Cleaning strings with Regular Expressions

2005-09-06 Thread Larry Bates
May not be what you are looking for, but this works: import os s='setAttr .ftn -type string ' \ '/assets/chars/boya/geo/textures/lod1/ppbhat.tga;' fname=os.path.basename(s.split()[-1]) BTW-It does depend on the file/path being the last item on the line. Larry Bates sheffdog wrote: Hello

Re: job scheduling framework?

2005-09-08 Thread Larry Bates
Google turned up these links that might be of interest: http://www.foretec.com/python/workshops/1998-11/demosession/hoegl/ http://www.webwareforpython.org/Webware/TaskKit/Docs/QuickStart.html http://www.slac.stanford.edu/BFROOT/www/Computing/Distributed/Bookkeeping/SJM/SJMMain.htm Larry Bates

Re: Help! Python either hangs or core dumps when calling C malloc

2005-09-08 Thread Larry Bates
Question: Why not just use Python to read the file? f=open(filename, 'rb') fcontents=f.read() If you need to manipulate what is in fcontents you can use struct module and/or slicing. Larry Bates Lil wrote: Hi Everyone! I've been trying to figure out this weird bug in my program. I have

Re: python script under windows

2005-09-09 Thread Larry Bates
Making a Python program into a service isn't all that tedious. Get a copy of Mark Hammonds Python Programming on Win32 which contains excellent examples on how to do this. I've written several and after the first one, it is quite easy to do. -Larry Bates Harlin Seritt wrote: Hi Jan

Re: simple problem with os.rename() parameters - path with spaces

2005-09-09 Thread Larry Bates
Are you sure the source directory exists and you have rights to rename it? Because the rename works for me. But you may want to look at shutil.move and/or use forward slashes (they work under Windows) -Larry Bates Tom wrote: I'm having a problem using a path with spaces as a parameter

Re: nested tuples

2005-09-09 Thread Larry Bates
The first question is why do you need tuples? But this works: import csv filename=r'C:\test.txt' fp=open(filename,'r') reader=csv.reader(fp) tlines=tuple([tuple(x) for x in reader]) fp.close() Larry Bates Luis P. Mendes wrote: Hi, I'm trying to solve this problem: suppose I'm reading

Re: How to handle very large MIME Messages with the email package?

2005-09-12 Thread Larry Bates
to send 100Mb files. Larry Bates [EMAIL PROTECTED] wrote: Looking at the email package, it seems all the MIMExxx classes takes string but not file object as the payload. I need to handle very large MIME messages say up to 100M. And possibly many of them. Is email package sufficient

Re: OCR librarys

2005-09-12 Thread Larry Bates
You need to specify a platform you will be running on. I've had good experience with ExperVision's RTK toolkit on Windows. It is not free, but it is very, very good. Sometimes software is actually worth paying for ;-). Larry Bates Timothy Smith wrote: i'm looking for ocr librarys

Re: Python and SMB, again...

2005-09-13 Thread Larry Bates
You might want to take a look at Webdrive (www.webdrive.com). It does what I think you are describing for ftp, http, https, and WebDAV. -Larry Bates Atila Olah wrote: On 1997/06/05 Peter Henning wrote: SMB, ldap, imap4rev1 Is there an SMB library? I want to be able to access SMB shares

  1   2   3   4   5   6   7   8   9   10   >