Re: Config parser module

2005-09-23 Thread Larry Bates
ConfigParser is for parsing configuration files of the format: [section1] option1= option2= . . . optionN= [section2] option1= option2= . . . optionN= Your data doesn't fit that format. Looks to me like you should write a small class object for each different type of record that can be found in

Re: CRC16

2005-09-23 Thread Larry Bates
The first URL back from Google is: http://www.onembedding.com/tools/python/code/crc16.htm Site is Russian, but crc16.py that is listed there has English comments. Maybe you can use some/all of it. -Larry Bates Tuvas wrote: > Anyone know a module that does CRC16 for Python? I have

Re: parsing a date

2005-09-23 Thread Larry Bates
Better than a single line of code? What is it that you are looking for? If you dates are consistent you can do: year, month, day=map(int, d.split('-')) but I'm not sure it is "better". I guess it depends on what you want to do with them after parsing. -Larry Bates K

Re: Python batching on XP

2005-09-27 Thread Larry Bates
You should take a look at the subprocess module http://www.python.org/dev/doc/devel/lib/module-subprocess.html -Larry Bates [EMAIL PROTECTED] wrote: > Hi ! > > I want to write a program that backup some databases in the night. > > Pseudo like this: > > try: > if

Re: Overhead of individual python apps

2005-09-27 Thread Larry Bates
Several apps using 4Mb each shouldn't be very much memory (maybe 20Mb at most). You didn't say how much memory was in your machine, but 256Mb of memory will cost you no more than $50. Not really worth a lot of effort. -Larry Qopit wrote: > I'm setting up a system that consists of several small

Re: Writing EXIF data

2005-09-29 Thread Larry Bates
I've used jhead and wrapped it with os.system call. http://www.sentex.net/~mwandel/jhead/ -Larry Bates Roel Schroeven wrote: > Hi, > > I'm looking into processing images with EXIF data. I've been looking > around and I've found a number of Python modules that

Re: Overloading __init__ & Function overloading

2005-09-30 Thread Larry Bates
method would replace method1 in the baseclass # in this instance of the class. # myObj=myclass(arg) I could be way off base, but maybe it will help. -Larry Bates Iyer, Prasad C wrote: > I am new to python. > > I have few questions > a. Is there something l

Re: Sybase Python WinXP

2005-09-30 Thread Larry Bates
You can use ODBC interface to the database. Sybase should ship with ODBC drivers. Just create a DSN and use odbc and dbi modules. Larry Bates len wrote: > Before posting I did search through the newsgroup and saw several > references to people requesting the binaries to the Sybase

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 o

Re: Python TNEF (winmail.dat attachment access) library?

2005-10-03 Thread Larry Bates
Why not write Python class that uses CTypes and make it available as a recipe? From a performance standpoint it is unlikely you can do better than to call the .dll and have it do the work for you. Just a suggestion. -Larry Bates Petri Savolainen wrote: > Hello, > > has anyone se

Re: Convert hex to string

2005-10-03 Thread Larry Bates
range are shown properly. Example: There is no printable ASCII character for the first character which is \x01. My ASCII table shows that this character represents an ASCII SOH (start of heading) character. -Larry Bates Java and Swing wrote: > I have some output stored in a string that lo

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 \) 3) Type python myscript.py myarg -Larry Bates k8 wrote: > Hello- > > I'm stuck on a Windows machine today and would love to fully p

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

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

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

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 Pytho

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

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

Re: convert char to byte representation

2005-10-10 Thread Larry Bates
ing else), I believe 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 wro

Re: how to execute .exe file ?

2005-10-11 Thread Larry Bates
indow size, 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~ &

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 mor

Re: Listen for directory events

2005-10-12 Thread Larry Bates
lp you out. 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

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

Re: File compare

2005-10-12 Thread Larry Bates
1 return float(match)/float(len(keys)) if __name__=="__main__": 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 >

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

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
ry, file if os.path.exists(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

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

2005-10-17 Thread Larry Bates
ral solution 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

Re: example of using urllib2 with https urls

2005-10-18 Thread Larry Bates
ply=", reply, " msg=", msg, "headers=", headers 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

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 rec

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: &

Re: Converting 2bit hex representation to integer ?

2005-10-20 Thread Larry Bates
. Example: 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: > > >>

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
word, restwords=s.split(' ',1) newstring="/%s/ %s" % (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 eff

Re: Modules and Namespaces

2005-10-20 Thread Larry Bates
27; def __init__(self, RS): 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

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 observation

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. > &

Re: HELP! py2exe error - No module named decimal

2005-10-21 Thread Larry Bates
e it can't know 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 f

Re: Help with language, dev tool selection

2005-10-21 Thread Larry Bates
3 html 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 programma

Re: Newbie question: string replace

2005-10-25 Thread Larry Bates
rd=test Then you can do the following to change: import ConfigParser INI=ConfigParser.ConfigParser() 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 t

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 bu

Re: SNMP

2005-10-28 Thread Larry Bates
> Thanks > Google turns up 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
native approach to the idea in the code fragment above? > > Jo I think what you want is something like: self.dllAdjust=[] 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 B

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 pyt

Re: reading a config file

2005-11-04 Thread Larry Bates
rsection.split('_')[1] # # Code to operate on the servers here # Larry Bates [EMAIL PROTECTED] wrote: > hi > i used ConfigParser to read a config file. I need the config file to > have identical sections. ie : > > [server] > blah = "some server&q

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 >

Re: struct.calcsize problem

2005-11-07 Thread Larry Bates
'64s', calcsize=64, sumofcalcsize=321, calcsize=322 fmt='32s', calcsize=32, sumofcalcsize=353, calcsize=354 fmt='32s', calcsize=32, sumofcalcsize=385, calcsize=386 fmt='64s', calcsize=64, sumofcalcsize=449, calcsize=450 fmt='L', calcsize=4, sumofcalcsize=453, calcsize=456 < fmt='L', calcsize=4, sumofcalcsize=457, calcsize=460 fmt='B', calcsize=1, sumofcalcsize=458, calcsize=461 fmt='B', calcsize=1, sumofcalcsize=459, calcsize=462 fmt='B', calcsize=1, sumofcalcsize=460, calcsize=463 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
(**kwargs) return # # Define base methods # class mp3player(audioBase): def __init__(self, **kwargs): audioBase.__init__(self, **kwargs) return # # Define mp3player specific methods # # Main program # obj=mp3Player(file='abc.mp3', ) -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: not able to HTTPS page from python

2005-11-09 Thread Larry Bates
ust 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 l

Re: parse data

2005-11-09 Thread Larry Bates
ple and put them in a list or something. Any > suggestions...besides 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

Re: Script to export MySQL tables to csv

2005-11-10 Thread Larry Bates
hat you are describing and found this product to fit the bill 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
= f.readlines() start_time=time.time() countDict=create_words(lines) stop_time=time.time() elapsed_time=stop_time-start_time wordlist = countDict.keys() wordlist.sort() for word in wordlist: print "word=%s count=%i" % (word, 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 af

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 variable

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 fl

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 Bate

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

2005-11-15 Thread Larry Bates
d. I 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

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

2005-11-15 Thread Larry Bates
stead. > > Any 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 -- http://mail.python.org/mailman/listinfo/python-list

Re: os.spawnl error

2005-11-17 Thread Larry Bates
The backslashes in your path are being interpreted as escape characters (e.g. \n is a newline). Try instead: os.spawnl(os.P_NOWAIT,r'c:\windows\notepad.exe') or os.spawnl(os.P_NOWAIT,'c:\\windows\\notepad.exe') -Larry Bates Salvatore wrote: > Hello, > > Does so

Re: how to organize a module that requires a data file

2005-11-17 Thread Larry Bates
s in the same directory as the class with an entry in it that points me to where the .txt file lives. Hope this helps. -Larry Bates Steven Bethard wrote: > Ok, so I have a module that is basically a Python wrapper around a big > lookup table stored in a text file[1]. The modul

Re: Zope vs Php

2005-11-17 Thread Larry Bates
bSphere or WebLogic. You may want to take a look at: http://karrigell.sourceforge.net/ This DOES seem to do what you want, but I have not direct experience (just have seen the website). -Larry Bates Steve wrote: > We are building a web app and the our backend is currently using python > wi

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 s

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 Bat

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

Re: Cut and paste an EPS file

2005-12-02 Thread Larry Bates
There is a python iterface to imagemagik that might work. I haven't used it, just read about it. -Larry Bates John Henry wrote: > I am looking for a Python tookit that will enable me to cut section of > a picture out from an EPS file and create another EPS file. > > I am us

Re: getting data off a CDrom

2005-12-05 Thread Larry Bates
works best if the files are text files. 3) do something custom to compare the files, but I would try 1) and 2) first. Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: How to ping in Python?

2005-12-05 Thread Larry Bates
ons(myChecksum) & 0x 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, >> >

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-i

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 t

binascii.crc32 results not matching

2005-12-09 Thread Larry Bates
bit result from 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 > backg

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 tiff

Re: ConfigParser - add a stop sentinel?

2005-01-12 Thread Larry Bates
y. Regards, 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

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

2005-01-12 Thread Larry Bates
e.net). 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 ne

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-stat

Re: python to mssql

2005-01-15 Thread Larry Bates
You really need to ask one/several specific questions. Python works with MSSQL. You can go through ODBC, ADO, etc. to work with data in MSSQL database. Hope info helps, Larry Bates Brane wrote: can someone please give me some info regarding subject please advice regards brane -- http

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 isinstanc

Re: Accessing MDB files on Windows

2005-01-19 Thread Larry Bates
I'm assuming the application will be run on Windows. You can use ODBC or DAO. An DAO solution that I wrote (and use) can be found at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303349 For ODBC you would just use the standard library module. Larry Bates Syscon, Inc. Jorge Luiz

Re: default value in a list

2005-01-21 Thread Larry Bates
What do you want put into the "missing" variables? I'll assume None. Something like following works: values=line.split(':') try: a=values.pop(0) except IndexError: a=None try: b=values.pop(0) except IndexError: b=None try: c=values.pop(0) except IndexError: c=None Larr

Re: Help with saving and restoring program state

2005-01-24 Thread Larry Bates
mbers/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

Re: exclude binary files from os.walk

2005-01-26 Thread Larry Bates
file with a .EXE extension. We 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 W

Re: HTML Tree View with and

2005-01-28 Thread Larry Bates
t via-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 = {'

Re: Help with web dashboard

2005-01-28 Thread Larry Bates
panel 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

Re: is extending an object considered acceptable usage?

2005-01-28 Thread Larry Bates
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 belongs to a Category, so

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 dicti

Re: Description Field in WinXP Services

2005-01-31 Thread Larry Bates
elf._svc_name_ key=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, regkey, 0, \ _winreg.KEY_SET_VALUE) _winreg.SetValueEx(key, 'Description', 0, _winreg.REG_SZ, \ self._svc_description_) return def setSERVICEeventlog

Re: barchart for webpage needed

2005-01-31 Thread Larry Bates
l for me. www.reportlab.org Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

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

2005-02-02 Thread Larry Bates
f.close() # dictlist=testdata.replace('\n','').split('{') firstdictstr='{'+dictlist[2] lastdictstr='{'+dictlist[-1] firstdict=eval(firstdictstr) lastdict=eval(lastdictstr) print "firstdict=", firstdict print "lastdict=", l

Re: Prepending to traceback

2005-02-02 Thread Larry Bates
rts # sys.excepthook=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 colum

Re: global variables

2005-02-02 Thread Larry Bates
#x27;global2':2, '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 ale

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 '{&#x

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 ther

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! --

Re: dll files

2005-06-20 Thread Larry Bates
You are most likely better off creating COM objects than trying to create old .dll files. Good treatment of COM object creation is in the book titled Python Programming on Win32. Most other languages have no problem interfacing with COM objects. -Larry Sabin wrote: > How can i create dll files

Re: import via pathname

2005-06-20 Thread Larry Bates
If it is Windows use py2exe and Inno Installer to create an installation program that does this for you. If it is another OS, you need to put your modules into a subdirectory of site-packages and then Python will be able to see your modules. If you have a lot of modules you might consider turning

Re: Photo layout

2005-06-27 Thread Larry Bates
to: http://www.reportlab.org Note: I'm assuming the photos are in .JPG, .TIF or some format that PIL can recognize. If they are in some proprietary RAW format you will need to convert them first. -Larry Bates Stephen Boulet wrote: > Is there a python solution that someone could recom

  1   2   3   4   5   6   7   8   9   10   >