Re: How to figure out if the platform is 32bit or 64bit?

2008-07-15 Thread Larry Bates
David Lees wrote: [EMAIL PROTECTED] wrote: I need to know if I'm running on 32bit or 64bit ... so far I haven't come up with how to get this info via python. sys.platform returns what python was built on ... but not what the current system is. I thought platform.uname() or just

Re: graphing lifelines

2008-07-15 Thread Larry Bates
E. J. Gold is the Hi-Tech Shaman wrote: On Jul 15, 3:38 pm, Larry Bates [EMAIL PROTECTED] wrote: Certainly a Hi-Tech Shaman can whip something up to do this, right? Yes, well E.J. Gold is the Hi-Tech Shaman. I'm Terrence Brannon, stating that fact :) So, maybe EJ could whip up such a thing

Re: logging via SocketHandler and TCPserver

2008-07-14 Thread Larry Bates
Vinay Sajip wrote: On Jul 13, 9:25 pm, Larry Bates [EMAIL PROTECTED] wrote: Every time I look at theloggingmodule (up until now) I've given up and continue to use my home-grown logger that I've been using for years. I'm not giving up this time ;-) I find that I REALLY need to be able

Re: Is it possible to create network conneciton on windows system?

2008-07-14 Thread Larry Bates
Evan wrote: Hello, one of my PC is window system, and in control panel - Network Connections, I can see some network connections such as PPPOE or VPN which I created by click create a new connection. My question is, is it possible to create a new connection by using Python script? which means

Re: Method behavior for user-created class instances

2008-07-14 Thread Larry Bates
[EMAIL PROTECTED] wrote: Greetings. I am looking for a way to achieve method behavior for a class I created. That is, it has a __call__ method, so can be called like a function. But I also want it to be treated as a method when it appears in a class body. Eg. class foo: def

Re: One step up from str.split()

2008-07-14 Thread Larry Bates
Joel Koltner wrote: I normally use str.split() for simple splitting of command line arguments, but I would like to support, e.g., long file names which-- under windows -- are typically provided as simple quoted string. E.g., myapp --dosomething --loadthis my file name.fil ...and I'd like to

Re: About wmi

2008-07-13 Thread Larry Bates
patrol wrote: I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate scrcons.exe and FNPLicensingService.exe,which are system processes. Problem2:After a while, this program will abort by error

logging via SocketHandler and TCPserver

2008-07-13 Thread Larry Bates
Every time I look at the logging module (up until now) I've given up and continue to use my home-grown logger that I've been using for years. I'm not giving up this time ;-) I find that I REALLY need to be able to monitor LOTS of running programs/processes and thought it would be nice to

Re: Dictionary bidirectional

2008-07-13 Thread Larry Bates
[EMAIL PROTECTED] wrote: bukzor: You need to use two dictionaries. Here's a class that someone's written that wraps it up into a single dict-like object for you: http://www.faqts.com/knowledge_base/view.phtml/aid/4376 It contains code like: try: del self.data[item] except KeyError:

Re: How to package a logging.config file?

2008-07-13 Thread Larry Bates
Matthew Wilson wrote: I'm working on a package that uses the standard library logging module along with a .cfg file. In my code, I use logging.config.fileConfig('/home/matt/mypackage/matt.cfg') to load in the logging config file. However, it seems really obvious to me that this won't work when

Re: About wmi

2008-07-13 Thread Larry Bates
patrol wrote: On 7月13日, 下午10时26分, Larry Bates [EMAIL PROTECTED] wrote: patrol wrote: I want to prevent some process from running. The code is in the following. I encounter some unexpected troubles. Probelm1: This program cannot terminate scrcons.exe and FNPLicensingService.exe,which

Re: Beginner Question : Iterators and zip

2008-07-12 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi group, I have a basic question on the zip built in function. I am writing a simple text file comparison script, that compares line by line and character by character. The output is the original file, with an X in place of any characters that are different. I have

Re: Determining when a file has finished copying

2008-07-12 Thread Larry Bates
Sean DiZazzo wrote: On Jul 9, 5:34 pm, keith [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the

Re: python scalability

2008-07-10 Thread Larry Bates
Tim Mitchell wrote: Hi All, I work on a desktop application that has been developed using python and GTK (see www.leapfrog3d.com). We have around 150k lines of python code (and 200k+ lines of C). We also have a new project manager with a C# background who has deep concerns about the

Re: Loading just in time

2008-07-10 Thread Larry Bates
D'Arcy J.M. Cain wrote: I am trying to create a utility module that only loads functions when they are first called rather than loading everything. I have a bunch of files in my utility directory with individual methods and for each I have lines like this in __init__.py: def calc_tax(*arg,

Re: Can anyone suggest a date peocedure...

2008-07-10 Thread Larry Bates
RV wrote: On Thu, 10 Jul 2008 13:39:29 -0700, Gary Herron [EMAIL PROTECTED] wrote: The datetime module has what you need. It has methods (with examples) on building a datetime object from a string, and it has a object named timedelta, and the ability to subtract a timedelta from a time.

Re: FOSS projects exhibiting clean/good OOP?

2008-07-09 Thread Larry Bates
Phillip B Oldham wrote: I'm wondering whether anyone can offer suggestions on FOSS projects/ apps which exhibit solid OO principles, clean code, good inline documentation, and sound design principles? I'm devoting some time to reviewing other people's code to advance my skills. Its good to

Re: Determining when a file has finished copying

2008-07-09 Thread Larry Bates
writeson wrote: Hi all, I'm writing some code that monitors a directory for the appearance of files from a workflow. When those files appear I write a command file to a device that tells the device how to process the file. The appearance of the command file triggers the device to grab the

Re: User-defined exception: global name 'TestRunError' is not defined

2008-07-09 Thread Larry Bates
[EMAIL PROTECTED] wrote: I'm using some legacy code that has a user-defined exception in it. The top level program includes this line from TestRunError import * It also imports several other modules. These other modules do not explicitly import TestRunError. TestRunError is raised in

Re: Determining when a file has finished copying

2008-07-09 Thread Larry Bates
writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the program that writes (pgm-W) as I'd like. Otherwise, the write to a different filename and then rename solution would work great. There's no

Re: formatting list - comma separated (slightly different)

2008-07-09 Thread Larry Bates
Michiel Overtoom wrote: Paul Robert wrote... d = [soep, reeds, ook] print ', '.join(d) soep, reeds, ook I occasionally have a need for printing lists of items too, but in the form: Butter, Cheese, Nuts and Bolts. The last separator is the word 'and' instead of the comma. The clearest I

Re: Python equivalent of call/cc?

2008-07-09 Thread Larry Bates
The Pythonista wrote: Yesterday, I was hacking around a bit, trying to figure out how to implement the semantics of call/cc in Python. Specifically, I wanted to translate this Scheme code to equivalent Python: (define theContinuation #f) (define (test) (let ((i 0)) (call/cc

Re: Terminate a python script from linux shell / bash script

2008-07-09 Thread Larry Bates
Gros Bedo wrote: Hello :-) I have a question about Python and Linux shell. I have a python program which is permanently resident in the end-user system. I'm currently producing a RPM package, and it works nicely. The problem is that when I uninstall it, my program keeps running in the

Re: Manipulating bitsets in struct

2008-07-09 Thread Larry Bates
Allen wrote: I'm using Python to do some simple network programming, and found the struct module very useful for such things, but is there a way to easily manipulate bitsets such as a 16 bit word being split into 4 parts like 2 bits, 1 bit, 4 bits, and 9 bits? Perhaps something like:

Re: Determining when a file has finished copying

2008-07-09 Thread Larry Bates
keith wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ethan Furman wrote: writeson wrote: Guys, Thanks for your replies, they are helpful. I should have included in my initial question that I don't have as much control over the program that writes (pgm-W) as I'd like. Otherwise, the

Re: plugins using cvs/distutils?

2008-07-08 Thread Larry Bates
Deacon wrote: Hi. I have an open-source application development environment that I would like to enable an automated package download system for (like downloadable plugins), using sourceforge as its repository. My software will have a menu-based popup window, that will list the packages

Re: Is there a good way to implement file updating? such as lock, update, reload...

2008-07-07 Thread Larry Bates
Evan wrote: If I get rid of the XML, I have to change my script more and more, it is not easy to do that. :( :( Thanks, It is even harder to write a multi-user XML database (which is what you are wanting). Put the data in a multi-user database and convert to XML as needed. -Larry --

Re: Memory error while saving dictionary of size 65000X50 using pickle

2008-07-07 Thread Larry Bates
Nagu wrote: I am trying to save a dictionary of size 65000X50 to a local file and I get the memory error problem. How do I go about resolving this? Is there way to partition the pickle object and combine later if this is a problem due to limited resources (memory) on the machine (it is 32 bit

Re: compatible image type

2008-07-04 Thread Larry Bates
gordon wrote: hi in my application a file selection by user returns a pathname string like F:/images/png/my.png or F:/docs/text/somedoc.txt etc. I can get the extension using extn=string.split(os.path.basename(pathname),'.' )[1] then later on i want to create a Photoimage using

Re: Instance Names

2008-07-03 Thread Larry Bates
Tim Cook wrote: Hi All, I have a need (if at all possible) to create instance names using '[' and ']', i.e. [at]=ClassA0(), [at0001]=ClassB2(), etc. Of course Python tries to unpack a sequence when I do that. Is there anyway to do this? I do have a workaround but it is an ugly, nasty URL

Re: Instance Names

2008-07-03 Thread Larry Bates
Tim Cook wrote: On Thu, 2008-07-03 at 14:20 -0500, Larry Bates wrote: I suspect there is some misunderstanding here. Why exactly do you think you need to have your instances named with [] characters in them? I often misunderstand. :-) But, I am implementing specifications in Python

Re: How to bypass Windows 'cooking' the I/O? (One more time, please)

2008-07-03 Thread Larry Bates
norseman wrote: I know I saw the answer recently, as in since February '08, but I can't re-find it. :( I tried the mail archives and such and my own collections but the piece I saw still eludes me. Problem: (sos=same old s...) Microsoft insists the world work it's way even when the

Re: Most efficient way to get pixelcolors of an image?

2008-07-02 Thread Larry Bates
defn noob wrote: i want to process a large number of images and store their respective pixels in a matrix. what is the mostt efficient way of opening and checking them? i doubt pygame is made for this purpose :) i guess i could also use tkinter? and why cant i print out matrix after getting

Re: Convert string to char array

2008-07-01 Thread Larry Bates
Brandon wrote: How do I convert a string to a char array? I am doing this so I can edit the string received from an sql query so I can remove unnecessary characters. The precise answer is: s = 'abcdefghi' l = list(s) l ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'] But quite often

Re: HTML Parsing

2008-06-30 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi everyone I am trying to build my own web crawler for an experiement and I don't know how to access HTTP protocol with python. Also, Are there any Opensource Parsing engine for HTML documents available in Python too? That would be great. Check on Mechanize. It

Re: windows installers and license agreement

2008-06-30 Thread Larry Bates
Darren Dale wrote: Is it possible to create a windows installer using distutils that includes a prompt for the user to agree to the terms of the license? Thanks, Darren If you are going to be creating windows installers, take a look at Inno Setup. It is way easier and more flexible than just

Re: List Performance

2008-06-30 Thread Larry Bates
Peter Otten wrote: Ampedesign wrote: If I happen to have a list that contains over 50,000 items, will the size of the list severely impact the performance of appending to the list? No. $ python -m timeit -n2 -sitems = [] items.append(42) 2 loops, best of 3: 0.554 usec per loop $

Re: The Yield statement

2008-06-30 Thread Larry Bates
Alex Bryan wrote: Okay, so i don't really understand the Yield thing and i know it is useful. I've read a few things about it but it is all programming jargon and so basically it is hard for me to understand. So can anyone give me a description or link me to a site that has a good definition

Re: Functions associated with a class.

2008-06-30 Thread Larry Bates
Kurda Yon wrote: Hi, I start to learn the object oriented programing in Python. As far as I understood, every class has a set of corresponding methods and variables. For me it is easy to understand a method as a one-argument function associated with a class. For example, if I call x.calc and

Re: shorten path to files

2008-06-27 Thread Larry Bates
cesco wrote: Hi, I need to retrieve the content of some files which are placed on a network drive so in order to open them I need the full path to the file. Unfortunately some times the path is longer than 256 characters and in Windows such a path is too long with the result that the file is

Re: python interface to Firefox and Thunderbird

2008-06-26 Thread Larry Bates
yardennis wrote: Hi, I need python moudles that can auto install python 2.5 (web install or a EXE file) auto download and install Firefox3 and Thunderbird 2 auto import from IE 6, 7 and OE 5,6 and Outlook read contacts and emails from Thunderbird store read Firefox 3 bookmarks, history,

Re: sending executable data over network..

2008-06-25 Thread Larry Bates
Cédric Lucantis wrote: Le Tuesday 24 June 2008 08:59:40 Piyush Anonymous, vous avez écrit : hi, i wish to change the way the function definition at run time in a running server. new function code which is to be executed is provided by a client at different location. i am getting it by reading a

Re: reading from list with paths

2008-06-25 Thread Larry Bates
antar2 wrote: Hello, Suppose this is a stupid question, but as a python beginner I encounter a lot of obstacles... so I would be very grateful with some help for following question: I would like to read files, of which the complete filepaths are mentioned in another textfile. In this textfile

Re: Communication between Python and PHP

2008-06-25 Thread Larry Bates
nicodotti2 wrote: Don't ask me why, but we have a bunch of legacy code in PHP on a server and a wee-bit of Python code for integrating GData google calendar services. We now need to build a way of sending messages between them. The general flow is: PHP Web Page(on apache) --- Python Gdata

Re: Working with the Windows Registry

2008-06-25 Thread Larry Bates
teh_sAbEr wrote: Hi everybody. I'm trying to write a script that'll change desktop wallpaper every time its run. Heres what I've gotten so far: #random wallpaper changer! import _winreg from os import walk from os.path import exists from random import randint #first grab a registry handle.

Re: Question: How do I format printing in python

2008-06-23 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi All, How do I format printed data in python? I could not find this in the Python Reference Manual: http://docs.python.org/ref/print.html Nor could I find it in Matloff's great tutorial: http://heather.cs.ucdavis.edu/~matloff/Python/PythonIntro.pdf For example, how

Re: 32-bit python memory limits?

2008-06-23 Thread Larry Bates
Gary Robinson wrote: I'm running a Python job on OS X 10.5.3 and the Python 2.5.2 that's available as a binary download at python.org for OS X. I ran a python program tonight that ended up using much more memory than anticipated. It just kept on using more and more memory. Instead of killing

Re: Storing value with limits in object

2008-06-22 Thread Larry Bates
Josip wrote: I'm trying to limit a value stored by object (either int or float): class Limited(object): def __init__(self, value, min, max): self.min, self.max = min, max self.n = value def set_n(self,value): if value self.min: # boundary check

Re: converting a text file to image

2008-06-20 Thread Larry Bates
jimgardener wrote: i am looking for python code to convert a textfile(.txt) to an image(preferrably Tiff).I believe it involves some scanning and conversion using some font table and probably compression using huffman encoding..is there an open source code doing this?can someone give a pointer?

Re: go to specific line in text file

2008-06-18 Thread Larry Bates
Patrick David wrote: Hello NG, I am searching for a way to jump to a specific line in a text file, let's say to line no. 9000. Is there any method like file.seek() which leads me to a given line instead of a given byte? Hope for help Patrick Others have given the general answer (No), but if

Re: Zipping python modules

2008-06-16 Thread Larry Bates
Brian Vanderburg II wrote: I've installed Python 2.5 on MSW and it works. I'm preparing it to run from a thumb drive so I can run applications by dropping them onto the python.exe or from command line/etc. It works but the size is quite large. I've compressed most of the executables with

Re: py2exe 0.6.8 released

2008-06-16 Thread Larry Bates
Open Source. http://sourceforge.net/services/buy/index.php Everyone, Thanks for all your hard work on py2exe, it is greatly appreciated. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: 'string'.strip(chars)-like function that removes from the middle?

2008-06-16 Thread Larry Bates
Ethan Furman wrote: Greetings. The strip() method of strings works from both ends towards the middle. Is there a simple, built-in way to remove several characters from a string no matter their location? (besides .replace() ;) For example: .strip -- 'www.example.com'.strip('cmowz.') 'example'

Re: python screen scraping/parsing

2008-06-14 Thread Larry Bates
Dan Stromberg wrote: BeautifulSoup is a pretty nice python module for screen scraping (not necessarily well formed) web pages. On Fri, 13 Jun 2008 11:10:09 -0700, bruce wrote: Hi... got a short test app that i'm playing with. the goal is to get data off the page in question. basically, i

Re: Platform independent code?

2008-06-14 Thread Larry Bates
saneman wrote: I have read that Python is a platform independent language. But on this page: http://docs.python.org/tut/node4.html#SECTION00422 it seems that making a python script executable is platform dependant: 2.2.2 Executable Python Scripts On BSD'ish Unix systems,

Re: Python + RDBM framework?

2008-06-14 Thread Larry Bates
bukzor wrote: It seems that whenever I have an application that uses a database (MySQL) I end up writing a database framework from scratch. Is there some accepted pre-existing project that has done this? I see Django, but that seems to have a lot of web-framework that I don't (necessarily)

Re: os.walk Value Error?

2008-06-14 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hi, I'm using os.walk as follows: (basedir, pathnames, files) = os.walk(results, topdown=True) and I'm getting the error: ValueError: too many values to unpack From my googling, that means: This is the standard message when Python tries to unpack a tuple into fewer

Re: Producer-consumer threading problem

2008-06-11 Thread Larry Bates
George Sakkis wrote: On Jun 10, 11:47 pm, Larry Bates [EMAIL PROTECTED] wrote: I had a little trouble understanding what exact problem it is that you are trying to solve but I'm pretty sure that you can do it with one of two methods: Ok, let me try again with a different example: I want to do

Re: Instructions on how to build py2exe 0.6.8 (or an installer would be nice, too!)

2008-06-10 Thread Larry Bates
[EMAIL PROTECTED] wrote: On Jun 10, 11:34 am, Mike Driscoll [EMAIL PROTECTED] wrote: Maybe I'm missing something, but I can rename the executables I create using py2exe 0.6.6 to anything I want after they're created. Or are you talking about a Windows installer for the py2exe module itself?

Re: can't assign to literal

2008-06-10 Thread Larry Bates
maehhheeyy wrote: On Jun 10, 1:21 pm, Matimus [EMAIL PROTECTED] wrote: On Jun 10, 12:53 pm, maehhheeyy [EMAIL PROTECTED] wrote: this is stopping my program from running properly. is there something wrong in my code when that happens? yes Post your code, or at least the full error message if

Re: Dynamic HTML from Python Script

2008-06-10 Thread Larry Bates
asdf wrote: I have a python script whose output i want to dynamically display on a webpage which will be hosted using Apache. How do I do that? thanks Take a look at Django. It may be overkill for this first project but any time you spend learning it should be paid back in future projects.

Re: Producer-consumer threading problem

2008-06-10 Thread Larry Bates
George Sakkis wrote: I'd like some feedback on a solution to a variant of the producer- consumer problem. My first few attempts turned out to deadlock occasionally; this one seems to be deadlock-free so far but I can't tell if it's provably correct, and if so, whether it can be simplified. The

Re: Getting current screen resolution

2008-06-09 Thread Larry Bates
Thomas Morton wrote: This is a thing that has been annoying me all morning: and I can't work out how to do it. I need a way to get the DPI or screen resolution of the monitor that a script is currently runnign on. I have a way in Windows but it doesnt port to Unix (which is important). Any

Re: access variables from one Python session to another on the same machine?

2008-06-09 Thread Larry Bates
Reckoner wrote: Suppose I have two different command windows going on the same machine, each running their own Python interpreters. Is it possible to access the variables in one of the interpreter- sessions from the other? It turns out I have limited control over one of the sessions (i.e.

Re: Macro like functionality for shorthand variable names

2008-06-07 Thread Larry Bates
Tilman Kispersky wrote: I have python code in a class method translated from C++ that looks sort of like this: self.dydt[1] = self.a * (self.b * self.y[0] - self.y[1]) To make this more readable in C++ I had made macros to achieve this: #define du (dydt[1]) #define u (y[1]) #define V

Re: Newbie question, list comprehension

2008-06-07 Thread Larry Bates
Johannes Bauer wrote: Hello group, I'm currently doing something like this: import time localtime = time.localtime(1234567890) fmttime = %04d-%02d-%02d %02d:%02d:%02d % (localtime[0], localtime[1], localtime[2], localtime[3], localtime[4], localtime[5]) print fmttime For the third line

Re: simple question on list manipulation from a newbie

2008-06-07 Thread Larry Bates
Sengly wrote: Dear all, I am working with wordnet and I am a python newbie. I'd like to know how can I transfer a list below In [69]: dog Out[69]: [{noun: dog, domestic_dog, Canis_familiaris}, {noun: frump, dog}, {noun: dog}, {noun: cad, bounder, blackguard, dog, hound, heel}, {noun:

Re: line continuation for lines ending in and or or

2008-06-05 Thread Larry Bates
Dennis Lee Bieber wrote: On Wed, 4 Jun 2008 21:50:19 -0700 (PDT), Russ P. [EMAIL PROTECTED] declaimed the following in comp.lang.python: Darnit! You're right. I've been reading up on Scala lately, and I guess I got confused. Well, it wouldn't be a bad idea for Python to do what I thought it

Re: ClassName.attribute vs self.__class__.attribute

2008-06-05 Thread Larry Bates
is not found it looks for a class attribute, and upwards. This behavior is used by Zope to do all sorts of neat stuff. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Larry Bates
Russ P. wrote: On Jun 2, 5:11 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: Russ P. [EMAIL PROTECTED] writes: I also realize, by the way, that Python allows a client of a class to define a new class member from completely outside the class definition. Obviously, that cannot be declared

Re: [XP] Batch-print bunch of RTF files?

2008-06-04 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hello, I have about two hundred individual RTF files to print from an XP host. Word 2000 doesn't seem to have this feature, so I'm looking for a way to print those RTF files from an ActivePython script. Would someone have some working code handy? Thank you.

Re: Unable to write output from os.path.walk to a file.

2008-06-04 Thread Larry Bates
Paul Lemelle wrote: I Am trying to output the os.path.walk to a file, but the writelines method complains Below is the code, any helpful suggestions would be appreciated. def visit(arg, dirnames, names): print dirnames dirinput = raw_input(Enter directory to read: )

Re: Cast list of objects to list of strings

2008-06-02 Thread Larry Bates
bukzor wrote: I have this function: def write_err(obj): from sys import stderr stderr.write(str(obj)+\n) and I'd like to rewrite it to take a variable number of objects. Something like this: def write_err(*objs): from sys import stderr stderr.write( .join(objs)+\n) but I

Re: Need Tutorial For the following lib

2008-06-01 Thread Larry Bates
Gandalf wrote: Hi scott, you couldn't be more wrong about my laziness. I straggle with my poor English for hours to fined what I'm looking for. I found a very simple and not comprehensive tutorial for the pyWinAuto lib in this address http://pywinauto.openqa.org/ but it only show how to do the

Re: Generating event from event

2008-05-30 Thread Larry Bates
Gandalf wrote: I have script which being triggered by pressing CTRL+Right mouse click from any place in my O.P , Now I need to generate automatically event like copy my selected item or double clicking the right mouse cursor without user interfering. how can i implement this width python?

Re: Help needed in choosing an algorithm for Cryptographic services.

2008-05-29 Thread Larry Bates
abhishek wrote: Hi group, recently my employer asked me too implement encryption/ decryption for secure data transfer over internet. Problem is that the client application is written using C# and the webserver where i need to store the information is developed using python. My situation of

Re: Python is slow

2008-05-22 Thread Larry Bates
cm_gui wrote: Python is slow.Almost all of the web applications written in Python are slow. Zope/Plone is slow, sloow, so very slooow. Even Google Apps is not faster. Neither is Youtube. Facebook and Wikipedia (Mediawiki), written in PHP, are so much faster than Python. Okay, they

Re: Using os.walk to return files in subdirectories

2008-05-22 Thread Larry Bates
=, allfiles print print subfiles=, subfiles print print len(allfiles)=, len(allfiles) print len(subfiles)=, len(subfiles) -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes help

2008-05-22 Thread Larry Bates
Since it isn't python, dir can'd do much introspection on the object to produce the type of output you desire. You have to know the functions (methods) that you want to call in your dll and call them. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: php vs python

2008-05-21 Thread Larry Bates
not completely brain dead, either, and I need something to keep my geezer brain sparking. What say ye? nb Check out the Pylons blog tutorial. You will have a simple blog up and running in less than 30 minutes and have a platform to extend it with as much functionality as you want later on. Larry

Re: backport of 'set' to python 2.3?

2008-05-21 Thread Larry Bates
Daniel Fetchinson wrote: Does anyone have a pure python implementation of the builtin 'set' object so that I could use that in python 2.3? If this would be the case that would be really great as I wouldn't have to change my code that runs happily on 2.5 and makes use of 'set'. Speed and

Re: persistent deque

2008-05-20 Thread Larry Bates
inhahe wrote: def __init__(self, filename, initial): should be def __init__(self, filename, initial=[]): (that was the whole reason i put the filename first.) sorry. Defaulting initial to empty list this way is asking for trouble. You should default it to None and check for None and

Re: Misuse of list comprehensions?

2008-05-20 Thread Larry Bates
John Salerno wrote: I posted this code last night in response to another thread, and after I posted it I got to wondering if I had misused the list comprehension. Here's the two examples: Example 1: def compress(s): new = [] for c in s: if c not in new:

Re: Problem creating a shorcut

2008-05-16 Thread Larry Bates
Mike Driscoll wrote: On May 15, 2:03 pm, Larry Bates [EMAIL PROTECTED] wrote: Mike Driscoll wrote: Hi, I've had this niggling issue from time to time. I want to create a shortcut on the user's desktop to a website that specifically loads Firefox even if Firefox is not the default browser. I

Re: Dbase / foxpro files

2008-05-16 Thread Larry Bates
[EMAIL PROTECTED] wrote: look at http://pypi.python.org/pypi?%3Aaction=searchterm=dbfsubmit=search i use dbfpy That's another option. The caveat is that dbfpy specifically states that it only works on simple files. I'm pretty sure ODBC is universal. The nice thing about using ODBC is

Re: class problem, NoneType obj has no attribute

2008-05-16 Thread Larry Bates
globalrev wrote: On 16 Maj, 14:19, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: globalrev a écrit : wassup here? 7 Traceback (most recent call last): File C:\Python25\myPrograms\netflix\netflix.py, line 22, in module print cust1.getID() AttributeError: 'NoneType' object has no

Cookies and CookieJar

2008-05-16 Thread Larry Bates
I'm struggling with a project using mechanize and cookies to screen scape a website. The site requires a client created cookie for authentication. Below is the code I'm attempting to use with the traceback I'm getting: import Cookie c=Cookie.SimpleCookie() c[Manageopen]=cards

Re: Dbase / foxpro files

2008-05-15 Thread Larry Bates
Johny wrote: Is there a module for reading/modifing db files from Python? Thanks for help B. Just create a ODBC DataSource (Control Panel/Administrative Tools/ DataSources) and use ODBC to read/write. -Larry -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem creating a shorcut

2008-05-15 Thread Larry Bates
Mike Driscoll wrote: Hi, I've had this niggling issue from time to time. I want to create a shortcut on the user's desktop to a website that specifically loads Firefox even if Firefox is not the default browser. I usually use COM as it allows very specific settings of the shortcut, such as the

Re: downloading a link with javascript in it..

2008-05-13 Thread Larry Bates
Jetus wrote: I am able to download this page (enclosed code), but I then want to download a pdf file that I can view in a regular browser by clicking on the view link. I don't know how to automate this next part of my script. It seems like it uses Javascript. The line in the page source says

Re: wxpython dialog - do something after ShowModal()?

2008-05-13 Thread Larry Bates
Iain King wrote: Hi. I have a modal dialog whcih has a Browse... button which pops up a file selector. This all works fine, but the first thing the user has to do when they open the dialog is select a file, so I would like the dialog to automatically call the onBrowse function as soon as the

Re: Is using range() in for loops really Pythonic?

2008-05-13 Thread Larry Bates
John Salerno wrote: I know it's popular and very handy, but I'm curious if there are purists out there who think that using something like: for x in range(10): #do something 10 times is unPythonic. The reason I ask is because the structure of the for loop seems to be for iterating through

Re: firefox add-on to grab python code handily?

2008-05-10 Thread Larry Bates
CM wrote: I encounter a fair number of small Python scripts online, and usually try them out by copying them to the clipboard, pasting into Notepad, saving them, and either running them directly or opening them in IDLE. And so I was wondering if anyone knew of an extension/add-on/script for

Re: Web Framework suggestions for a RIA type application for managing lab specimens

2008-05-09 Thread Larry Bates
the final choice of development architecture, languages, database, UI toolkits, etc. Hope this helps. -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: Property in derived class

2008-05-09 Thread Larry Bates
Joseph Turian wrote: If I have a property in a derived class, it is difficult to override the get and set functions: the property's function object had early binding, whereas the overriden method was bound late. This was previously discussed:

Re: read line

2008-05-06 Thread Larry Bates
[EMAIL PROTECTED] wrote: hi every body, I'm a new python user and I'm making a program to run useing Abaqus and there is something I can't do, if i have a text file that has a line like this 10 20 30 40 50 and I wana do the coding to put every number of these like 10 or 20 in a

Re: Am I missing something with Python not having interfaces?

2008-05-06 Thread Larry Bates
jmDesktop wrote: Studying OOP and noticed that Python does not have Interfaces. Is that correct? Is my schooling for nought on these OOP concepts if I use Python. Am I losing something if I don't use the typical oop constructs found in other languages (Java, C# come to mind.) I'm afraid that

Re: Searching and replacing text ?

2008-05-02 Thread Larry Bates
Oltmans wrote: Hi, I'm new to Python (and admittedly not a very good programmer) and I've come across a scenario where I've to search and replace text in a file. For the sake of an example, I'm searching for every occurence of the text [[http://www.hotmail.com - Hotmail]] I've to replace it

Re: list.index crashes when the element is not found

2008-05-02 Thread Larry Bates
TkNeo wrote: On May 2, 1:58 pm, Nick J Chackowsky [EMAIL PROTECTED] wrote: TkNeo wrote: WHAT ? This is crazy Crazy like a fox? a = [1, 2, 3] try: a.index(99) except: a.append(99) finally: print a.index(99) MY question: which exception should I actually be catching there? **

Re: Need help: Compiling Python-Code In-Reply-To=

2008-05-02 Thread Larry Bates
CRAIG DALTON wrote: Hi, I'm looking to append several text files in one director and out put the combined files into another director. I'm new to Python and just can't get it to work. So far I've been able to create a file in the desired directory but it isn't pulling any of the data in the

<    1   2   3   4   5   6   7   8   9   10   >