Re: Quickest way to make py script Web accessible

2006-01-05 Thread [EMAIL PROTECTED]
Thank you all for the advice and suggestions. I appreciate the time you took to help! -- http://mail.python.org/mailman/listinfo/python-list

getting a KeyError:'href' any ideas?

2006-01-05 Thread [EMAIL PROTECTED]
i have an href which looks like this: http://www.cnn.com";> here is my code for incident in row('td', {'class':'all'}): n = incident.findNextSibling('a', {'class': 'btn'}) link = incident.findNextSibling['href'] + "','" and the full error is thi

Re: Wingide is a beautiful application

2006-01-05 Thread [EMAIL PROTECTED]
Tony Nelson wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > My goal is to make my conf files into a decent drop-in so you just put > > them in your .vim directory and go, and post them next week. > > OK, thank you. > FYI, I am still wo

Re: subprocess problem in cygwin with Tkinter

2006-01-05 Thread [EMAIL PROTECTED]
that's it! Thanks, that sorted me out. The readme at the following location was very helpful: http://www.tishler.net/jason/software/rebase/rebase-2.2.README I couldn't get rebaseall to work until I installed all of the packages mentioned in the readme. Now I have a different problem, regarding

Re: multiple clients updating same file in ftp

2006-01-05 Thread [EMAIL PROTECTED]
here's a simple-minded suggestion: have the first client create a text file on the remote server, and delete it when it is finished updating. The second client can check for existence of this file before trying to update. cheers, S -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple clients updating same file in ftp

2006-01-05 Thread [EMAIL PROTECTED]
why, that's the nicest thing anyone's said about me today - and probably true, since I started coding on punch-cards... s -- http://mail.python.org/mailman/listinfo/python-list

Re: psexec and os.popen help

2006-01-06 Thread [EMAIL PROTECTED]
popen3 did the trick. Thanks Jeff Gercken -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python allow access to some of the implementation details?

2006-01-06 Thread [EMAIL PROTECTED]
Claudio Grondi wrote: > Martin v. Löwis wrote: > > You can get somewhat faster in Python than your code if you avoid > > producing new long objects all the time, and do the task in chunks of 30 > > bits. > It would be nice if you could explain why you consider chunks of 30 bits > to be superior e.g

os.environ['PATH'] missing

2006-01-07 Thread [EMAIL PROTECTED]
This is a hard question to ask because I can't reproduce the problem other than restarting several times over until it happens again. I'm using Zope and Plone for a website on this debian linux vserver and when I restart it it runs some /etc/init.d/zope restart scripts and things fail in zope beca

Re: config errors on Freebsd and python 2.3

2006-01-07 Thread [EMAIL PROTECTED]
David Bear wrote: > I need python 2.3. I have freebsd 4.10-releng. when configuring python I > received the following: > > ./configure --prefix=/home/webenv > config-results >... > > I don't plan on using curses -- so I'd like to ignore this. But, I'm just > wondering if there is an 'easy' fix...

Re: error rising while connecting oracle 9i

2006-01-07 Thread [EMAIL PROTECTED]
Check: 1. Whta is the Python version your running, with py> import sys py> print sys.version 2.4.2 (#2, Sep 30 2005, 21:19:01) [GCC 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu8)] 2. Download the correct version of cx_Oracle see http://www.cxtools.net/default.aspx?nav=cxorlb then execute the c

Re: Viewing Binary Data

2006-01-08 Thread [EMAIL PROTECTED]
This recipe is a good place to start: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440528 Cheers Rich. -- http://mail.python.org/mailman/listinfo/python-list

Re: Renaming files in ftplib

2006-01-09 Thread [EMAIL PROTECTED]
Do for instance: Step 1. Move the file to another directory from the remote computer - see http://docs.python.org/lib/ftp-objects.html Step 2. Rename the file here. See http://docs.python.org/lib/os-file-dir.html, function rename Step 3. Move the file to the desired directory, use the same functio

Re: config errors on Freebsd and python 2.3

2006-01-09 Thread [EMAIL PROTECTED]
Safeer Tabassum wrote: > why you are not installing it from ports? > The port distribution doesn't build to support Tkinter. That's why I started building python from source. And since I'm building from source I can be more up-to-date then the ports distribution, and include pil, pmw, etc in the

Re: Renaming files in ftplib

2006-01-09 Thread [EMAIL PROTECTED]
how to get files: http://docs.python.org/lib/ftp-objects.html, see function retrlines for a textfile how to rename files: mhttp://docs.python.org/lib/os-file-dir.htmlv, function rename -- http://mail.python.org/mailman/listinfo/python-list

Re: config errors on Freebsd and python 2.3

2006-01-09 Thread [EMAIL PROTECTED]
Safeer Tabassum wrote: > why you are not installing it from ports? > The port distribution doesn't build to support Tkinter. That's why I started building python from source. And since I'm building from source I can be more up-to-date then the ports distribution, and include pil, pmw, etc in the

Re: config errors on Freebsd and python 2.3

2006-01-09 Thread [EMAIL PROTECTED]
Safeer Tabassum wrote: > why you are not installing it from ports? > The port distribution doesn't build to support Tkinter. That's why I started building python from source. And since I'm building from source I can be more up-to-date then the ports distribution, and include pil, pmw, etc in the b

CGI errror in (only in) IIS 6.0 server 2003

2006-01-09 Thread [EMAIL PROTECTED]
Hi, I've been using ActivePython 2.3 (cgi) on IIS on win xp, 2000 and they work fine. Until I upgrade the system the server 2003. The ASP script engine is ok but not the CGIs. I got these errors: HTTP Error 403.1 - Forbidden: Execute access is denied. I already have execute access on the direc

CGI errror in (only in) IIS 6.0 server 2003

2006-01-09 Thread [EMAIL PROTECTED]
Hi, I've been using ActivePython 2.3 (cgi) on IIS on win xp, 2000 and they work fine. Until I upgrade the system the server 2003. The ASP script engine is ok but not the CGIs. I got these errors: HTTP Error 403.1 - Forbidden: Execute access is denied. I already have execute access on the direc

Re: config errors on Freebsd and python 2.3

2006-01-09 Thread [EMAIL PROTECTED]
Safeer Tabassum wrote: > why you are not installing it from ports? > Python as installed from ports doesn't support Tkinter. Curtis -- http://mail.python.org/mailman/listinfo/python-list

Re: config errors on Freebsd and python 2.3

2006-01-09 Thread [EMAIL PROTECTED]
Safeer Tabassum wrote: > why you are not installing it from ports? > Python as installed from ports doesn't support Tkinter. Curtis -- http://mail.python.org/mailman/listinfo/python-list

CGI errror in (only in) IIS 6.0 server 2003

2006-01-09 Thread [EMAIL PROTECTED]
Hi, I've been using ActivePython 2.3 (cgi) on IIS on win xp, 2000 and they work fine. Until I upgrade the system the server 2003. The ASP script engine is ok but not the CGIs. I got these errors: HTTP Error 403.1 - Forbidden: Execute access is denied. I already have execute access on the direc

How login & download file from remote web site? Passwords a problem?

2006-01-09 Thread [EMAIL PROTECTED]
How make a Python script 1. login 2. type password & 3. download file all from a **remote web site**? I'm not comfortable with *MY* software handling the password part. It just seems like trouble if users must tell *my* software their password. Is there a wise way to solve this or avoid this c

Help with dbm TypeError

2006-01-09 Thread [EMAIL PROTECTED]
I am writing a web application for mod_python that catalogs my home (book) library. For now, I am using the Python dbm module to store string representations of mod_python's req.form (using the mod_python.publisher handler) using unique IDs as keys. In the .db file, there is a key 'next' that holds

Re: How login & download file from remote web site? Passwords a problem?

2006-01-09 Thread [EMAIL PROTECTED]
Gene Thanks for links but I'm not sure what to do with them! The links were about testing frameworks. I just want to write a script to grab stuff from a remote site (kinda like automatic ftp). Perhaps those tests you were referring to have code to do what I'm looking for?\ chris -- http://ma

Re: How to create a script that list itself ?

2006-01-09 Thread [EMAIL PROTECTED]
import sys path = os.path.dirname(sys.argv[0]) print "Path:%s" % (path) ## If you ran this as a script, This would print the location of where the script itself is running. Hope it helps! Rob -- http://mail.pyt

Re: CGI errror in (only in) IIS 6.0 server 2003

2006-01-09 Thread [EMAIL PROTECTED]
Thanks yes, it is. I have checked everything already, but still couldn't get it working on server2003 -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI errror in (only in) IIS 6.0 server 2003

2006-01-09 Thread [EMAIL PROTECTED]
Yes, I checked it. It was really "Scripts and Executables" not None -- http://mail.python.org/mailman/listinfo/python-list

Re: How login & download file from remote web site? Passwords a problem?

2006-01-09 Thread [EMAIL PROTECTED]
Is it possible for users to just authenticate in another browser first? i.e. If I authenticate from browswer X.does EVERY web transaction from SAME hostname have access **after**? How about just from same user? same browswer? same process? Chris Steve Holden wrote: > [EMAIL PROTECTED] wr

Re: urllib.urlopen and https question

2006-01-10 Thread [EMAIL PROTECTED]
>From the docs for urllib: When performing basic authentication, a FancyURLopener instance calls its prompt_user_passwd() method. The default implementation asks the users for the required information on the controlling terminal. A subclass may override this method to support more appropriate beha

Re: CGI errror in (only in) IIS 6.0 server 2003

2006-01-10 Thread [EMAIL PROTECTED]
also, the IDE pythonwin crash everythin time I run it -- http://mail.python.org/mailman/listinfo/python-list

Cross Compile Mips / Linux

2006-01-10 Thread [EMAIL PROTECTED]
Hi Everyone, I trying to get a build of Python together to run on an Embedded Linux / Mips machine. I run the ./configure --host= XXXmips(my mips proc) --build=XXX x86(my pc). and the configure runs perfectly. I then run "make" and it fails . I have also tried appling some patches, and running a

Re: Optimal Control Algorithms in Python

2006-01-11 Thread [EMAIL PROTECTED]
Not exactly but I am aware of Python code for nonlinear optimization algorithms. Check the nlpy project at http://nlpy.sf.net It is specifically targeted at finite-dimensional problems. However the current trend in optimal control algorithms is to use grid-refinement and iteratively solve finite-di

How do initial login/password before can download web file with urllib?

2006-01-11 Thread [EMAIL PROTECTED]
I finally figured out how to use the wonderful module urllib to download files. What if web page requires you to fill out a form with login and password first? Is this just like any other FORM? Can login/password from a GET method form be handled by appending something like "?login=foo,password=

batch tiff to jpeg conversion script

2006-01-11 Thread [EMAIL PROTECTED]
Hope it's not inappropriate to post this here. Could someone critique my code? I have no Python programmers in my office to show this to. The script works OK, but should I do it differently? I especially don't like how I check to see if jpegs exist. The style may not be acceptable to some, but I'

Re: batch tiff to jpeg conversion script

2006-01-11 Thread [EMAIL PROTECTED]
Hi Peter. The guy who takes the pictures uses Photoshop to convert tiffs to jpegs one by one. When he does a 'Maxium Quality' conversion in Photoshop and I do a 100% quality conversion with Python and PIL, the two converted files are almost identical and this is what he wants... that's the only rea

Re: batch tiff to jpeg conversion script

2006-01-11 Thread [EMAIL PROTECTED]
Thanks for the example code Larry. It _is_ easier for me to read. I like the way you split the file on '.' I may use that. Thanks again! -- http://mail.python.org/mailman/listinfo/python-list

Re: exec a string in an embedded environment

2006-01-11 Thread [EMAIL PROTECTED]
Greg Copeland wrote: > On Wed, 11 Jan 2006 04:29:32 -0800, Tommy R wrote: > > > I work on a safety critical embedded application that runs on VxWorks. > > I have successfully ported the interpreter to VW. In my solution I have > > Sure wish you would of asked...I ported Python to VxWorks > some tim

can't import module in ASP

2006-01-11 Thread [EMAIL PROTECTED]
Hi all, I have found that I can't import modules in ASP (python) and those modules are in the same directory. I can surely do that with a .py file but not in ASP. I have noticed the currently working directory when python used in ASP is somewhere else rather than where the asp file is. I remember

Re: Python on WinXP Embedded

2006-01-11 Thread [EMAIL PROTECTED]
Do you mean Windows PE (Pre-Install Environment)? Here are a few screen shots of Python on Windows PE. If you want more details, I can post the steps I took to get it working. http://www.bandaheart.com/bartpe/ Also note that WinPE 2.0 will come out when Vista ships in 2006. -- http://mail.pyth

Re: Python on WinXP Embedded

2006-01-12 Thread [EMAIL PROTECTED]
work under WinXPE... Whoops. Sorry... there are too many Windows acronyms around ;). I've never used Python in this type of environment, but I'm sure someone out there has. I found this from a 2001 archive: Grant Edwards wrote: > > In article <[EMAIL PROTECTED]>, Peter

Re: batch tiff to jpeg conversion script

2006-01-12 Thread [EMAIL PROTECTED]
Just curious... is PhotoShop _really_ recursive? We have dozens of levels of sub-folders where the pics have been sorted and thousands of pics. That's one reason I used os.walk() -- http://mail.python.org/mailman/listinfo/python-list

Free Browser Automation tool PAMIE2b now available for download

2006-01-12 Thread [EMAIL PROTECTED]
The Free open-source Browser automation tool. cPAMIE.py The main python class that allows you to write scripts to automate the Internet Explorer browser client for function and unit testing. = PAMIE - Reference Guide - What's Ne

Re: how do "real" python programmers work?

2006-01-12 Thread [EMAIL PROTECTED]
bblais wrote: > In Python, there seems to be a couple ways of doing things. I could > write it in one window, and from a Unix shell call >python myscript.py > and be like C++, but then I lose the interactiveness which makes > prototyping easier. If I use the python sh

Python Desktop Framework?

2006-01-13 Thread [EMAIL PROTECTED]
Is there or should there be a Python Desktop Framework? It would be great to have something like Turbogears for desktop apps. I blogged a fews days ago about a Python Desktop Framework or (dare I say it) Wizard: 1. Quick to build an application - Minimal Input e.g. App Name and Type 2. Choi

Re: New Python.org website ?

2006-01-13 Thread [EMAIL PROTECTED]
Tim Chase wrote: > > Looks fine here on Firefox 1.5 and Konqueror 3.4.3. > > Just in case anybody is interested, I've posted screenshots of > how it comes out here (minus the ugly colors when 24-bit images > are reduced to 256-color GIF files) in both MozSuite and FF: FWIW, I'm seeing the same ove

Re: How login & download file from remote web site? Passwords a problem?

2006-01-13 Thread [EMAIL PROTECTED]
# Quick and dirty script example from win32com.client import DispatchEx import time def wait(ie): while ie.Busy: time.sleep(0.1) while ie.Document.ReadyState != 'complete': time.sleep(0.1) #instaniate a new ie object so you can call it's

Re: COM automation, Internet Explorer, DocumentComplete event

2006-01-13 Thread [EMAIL PROTECTED]
R. Bell, If you could sent me those URLS that are not working with PAMIE it would be great. It should be a quick fix. I haven't had any of the Users report this as of yet. I notice your writing an app that automates IE also, best of luck with it!! Rob -- http://mail.python.org/mailman/listinf

Re: New Python.org website ?

2006-01-13 Thread [EMAIL PROTECTED]
JW wrote: > On Fri, 13 Jan 2006 11:00:05 -0600, Tim Chase wrote: > > > http://tim.thechases.com/pythonbeta/pythonbeta.html > > > > Very strange. With FF 1.0.7, I can just get the buttons to violate the > next column if I "View>Page Style>Large Text", but I wouldn't have noticed > it unless Tim had

Re: New Python.org website ?

2006-01-17 Thread [EMAIL PROTECTED]
Tim Parkin wrote: > [EMAIL PROTECTED] wrote: > > JW wrote: > >>Very strange. With FF 1.0.7, I can just get the buttons to violate the > >>next column if I "View>Page Style>Large Text", but I wouldn't have noticed > >>it unless Tim had point

Re: Converting TIFF files to PDF and/or JPEG

2006-01-17 Thread [EMAIL PROTECTED]
The Tiff library and utilities combined with Ghostscript make this very easy. http://www.remotesensing.org/libtiff/ http://www.cs.wisc.edu/~ghost/ With the above two packages installed, you can do something like this in Python: def tiff2pdf(width, length, files): path, filename = os.pat

Re: OT: excellent book on information theory

2006-01-18 Thread [EMAIL PROTECTED]
Terry Hancock wrote: > I find that bizarre. There is no mythological > basis for a "Sourceror's Stone", but the "Philosopher's > Stone", was of course the mythical Alchemists' goal of a > catalyst for converting lead into gold (it had other > properties, IIRC). As an American, I was somewhat myst

wxPython - x-platform menu bar color changes

2006-01-19 Thread [EMAIL PROTECTED]
Anyone know a x-platform safe way to change the color of the menu bar in wxPython? menu.SetBackgroundColor has no effect. ActiveState had a win32 specific way of changing menu bar color, but I need x-platform capability. Anyone know a solution? Thanks AK -- http://mail.python.org/mailman/list

Re: list comprehention

2006-01-19 Thread [EMAIL PROTECTED]
def reference(alist1,alist2): counter = 0 for x in lis: if x in ref: ref.pop(ref.index(x)) counter += 1 return counter this works I think for your examples, but you should check it against them and other cases.

Re: list comprehention

2006-01-19 Thread [EMAIL PROTECTED]
revision of previous: def reference(reflist,alist2): counter = 0 for x in alist2: if x in reflist: reflist.pop(reflist.index(x)) counter += 1 return counter -- http://mail.python.org/mailman/listinfo/python-l

Re: list comprehention

2006-01-19 Thread [EMAIL PROTECTED]
another approach: ref = [2,2,4,1,1] lis = [2,2,5,2,4] len([ref.pop(ref.index(x)) for x in lis if x in ref]) -- http://mail.python.org/mailman/listinfo/python-list

wxPython - is it possible to determine List Box item under a right click?

2006-01-19 Thread [EMAIL PROTECTED]
I have a list box, I'd like to generate a right click menu for items in the list box. The problem is unless I left click the item first, I can't figure out which item in the list I clicked over. So it seems to me, I need to determine the which item I right clicked over, perform a setselected on t

Re: how to find not the next sibling but the 2nd sibling or find sibling "a" OR sinbling "b"

2006-01-19 Thread [EMAIL PROTECTED]
ok i found something that works. instead of using the def i did this: for incident in row('div', {'class': 'food' or 'drink' }): and it worked! only thing is that i think i am messing up the logic and here is why So when i run my script i get results, meaning it scrapes some stuff out, but the

Re: wxPython - is it possible to determine List Box item under a right click?

2006-01-19 Thread [EMAIL PROTECTED]
In case someone finds this - My own solution to this was to use a wx.ListCtrl - it's a bit more work, but the mixin's are quite handy for my purposes, also a right click causes selection for ListCtrl - so it's nice and clean -- http://mail.python.org/mailman/listinfo/python-list

Re: using arrow keys in the python shell on Mac OS X

2006-01-20 Thread [EMAIL PROTECTED]
You need libreadline to make it work. For some stupid reason OSX doesnt come with it installed. just get the gzipped one from here: http://www.pycs.net/bbum/2004/1/21/readline.so.gz then gunzip it and put the readline.so into /Library/Python/2.3/site-packages/ then fire up python again and it s

Re: accessing hardware information using python

2006-01-20 Thread [EMAIL PROTECTED]
Johhny wrote: > I am currently looking to write a utility in python that will monitor > the statis of a RAID card within linux. The card in Question is the LSI > SAS1064 as the tools provided by the vendor to monitor the software > does not suit our requirements. What are your requirements? > How

Re: Concatinating PDF files

2006-01-22 Thread [EMAIL PROTECTED]
ReportLab maybe? http://www.reportlab.org/rl_toolkit.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Editing File

2006-07-12 Thread [EMAIL PROTECTED]
D wrote: > Hi, I currently have a Python app with a Tkinter GUI frontend that I > use for system administration. Everytime it launches, it reads a text > file which contains info about each host I wish to monitor - each field > (such as IP, hostname, etc.) is delimited by !!. Now, I want to be >

Re: Editing File

2006-07-12 Thread [EMAIL PROTECTED]
ame file. You would have to do the same if you edited the text file, except you would need a couple of lines code to parse the string, etc. check here for a simple example : http://wiki.python.org/moin/UsingPickle > > [EMAIL PROTECTED] wrote: > > D wrote: > > > Hi, I

Re: How to display name of elements in list?

2006-07-12 Thread [EMAIL PROTECTED]
Pretty sure he meant 1.5.1. Found the documentation for the program he's using here: http://www.hpcu.uq.edu.au/Manuals/MSC/msc/docs/marc/python/python_manual.pdf It looks like the PyTensor object *should* have .xx, .xy, etc properties, but they may be accessible through a matrix, i.e. .t(i,j) -

Re: Inheritance error: class Foo has no attribute "bar"

2006-07-12 Thread [EMAIL PROTECTED]
I checked my code today and your suggestion did fix the problem. I used your second idea of having the default class attributes with individual instance attributes. I ran into one problem where I kept getting the error " File "\\user1\jacksocl\Python_stuff\CMRPG\CharCreation.py", line 262, in __

Re: How properly manage memory of this PyObject* array?? (C extension)

2006-07-13 Thread [EMAIL PROTECTED]
> It's quite simple, really: You malloc it, you free it. John - I hope you don't mind that I really want to make sure I understand your good wisdom in this area by asking for clarification ASSUMPTIONS: 1. As long as we properly handle the reference counting of PyObjects then memory ma

Re: Newbie

2006-07-14 Thread [EMAIL PROTECTED]
Stéphane ROCHOY wrote: > Gueorgui Vaskes wrote: > > Could anyone feel me in what do you mostly use python for? > > > > > > > > ___ > > The all-new Yahoo! Mail goes wherever you go - free your email address from > > your Internet provider. ht

Re: Compiling Python using the Portland Group compiler

2006-07-14 Thread [EMAIL PROTECTED]
Konrad Hinsen wrote: > I am trying to install Python 2.4.3 on an AMD Opteron system using > the Portland Group's compiler (pgcc). Using > > I finally managed to obtain an executable that would start and work, > but it fails a couple of test cases: ... > Has anyone encountered such failures before?

PyQT installation /configuration

2006-07-15 Thread [EMAIL PROTECTED]
Hi there. I've been trying to get PyQT working on W2K, but have not yet found a sufficiently detailed walk-through for my somewhat command-line-challenged sensibilities. I did find this page: http://www.diotavelli.net/PyQtWiki/GPLPyQtWindows , but I'm not sure about installing the whole of Visual S

Re: PyQT installation /configuration

2006-07-15 Thread [EMAIL PROTECTED]
Phil Thompson wrote: > On Saturday 15 July 2006 9:25 am, [EMAIL PROTECTED] wrote: > > Hi there. I've been trying to get PyQT working on W2K, but have not yet > > found a sufficiently detailed walk-through for my somewhat > > command-line-challenged sensibilities. I di

Re: PyQT installation /configuration

2006-07-15 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Phil Thompson wrote: > > For Qt4 use the binary installer from... > > > > http://www.trolltech.com/developer/downloads/qt/windows > > > > For PyQt4 use the binary installer from... > > > > http://www.riverbankcomputing.co.u

Re: PyQT installation /configuration

2006-07-15 Thread [EMAIL PROTECTED]
David Boddie wrote: > The module structures for PyQt3 and PyQt4 are quite different: the > monolithic qt module from PyQt3 has been replaced by a number of > modules in PyQt4. Despite this, there is a similar way to "import qt" > in PyQt4: > > from PyQt4 import Qt > > However, you will have dif

Re: using logger module

2006-07-17 Thread [EMAIL PROTECTED]
Can you post exact code that you used? Raghu. David Bear wrote: > I attempted to use the logger module per the instructions in > http://docs.python.org/lib/minimal-example.html > > I tried a couple of differnet levels. Nothing appeared in any logs. Has this > module been tested with syslog-ng? T

New Project - Pythoncard Backup Program

2006-07-17 Thread [EMAIL PROTECTED]
Pythoncard powered Backup program. http://www.latedecember.com/sites/software/LDBackup/ This is a small simple project to encourage newbies to get involved in Open Source, learn more Python(card) and to give me some experience in running a project. It is also a handy tool which I have used for mo

Re: How to lock files (the easiest/best way)?

2006-07-17 Thread [EMAIL PROTECTED]
Elmo Mäntynen wrote: > Is there something better than using fnctl? It seems a bit intimidating > with a quick look. Although fcntl is pretty opaque, it's quite easy to use if all you want is a simple exclusive lock for all your data. The thing to keep in mind is, you don't have to lock every file

Re: run a string as code?

2006-07-17 Thread [EMAIL PROTECTED]
py_genetic wrote: > How can you make python interpret a string (of py code) as code. For > example if you want a py program to modify itself as it runs. I know > this is an advantage of interpreted languages, how is this done in > python. Thanks. This might do it... >>> print eval.__doc__ eval

Re: How properly manage memory of this PyObject* array?? (C extension)

2006-07-17 Thread [EMAIL PROTECTED]
> Let's try reductio ad adsurdum on that one. Suppose that instead of > filling in a malloced chunk of memory, you had stored those gizmoids in > local variables foo0, foo1, foo2, etc. Using your reasoning: we can't > ever return from our function (which frees up the stack memory > containing foo0

Re: How properly manage memory of this PyObject* array?? (C extension)

2006-07-17 Thread [EMAIL PROTECTED]
> if you use malloc to allocate a memory block and store PyObject pointers > in it, you must > > 1) make sure that the reference count is *incremented* (Py_INCREF) when > you add the objects (unless the object is new; when you create an > object, the reference count is set to 1). this tells Pytho

Re: question about what lamda does

2006-07-18 Thread [EMAIL PROTECTED]
range(1,sides+1) ) # roll dies with 4, 6, and 20 sides print roll_die(4), roll_die(), roll_die(20) Have fun with your lambdas. greb [EMAIL PROTECTED] wrote: > Hey there, > i have been learning python for the past few months, but i can seem to > get what exactly a lamda is for. What woul

Re: How properly manage memory of this PyObject* array?? (C extension)

2006-07-18 Thread [EMAIL PROTECTED]
> *WRONG*. The object exists in and of itself. There may be one *or more* > references to it, via pointers, scattered about in memory; they are > *NOT* components of the object. A reference count is maintained inside > the object and manipulated by Py_INCREF etc. The Python garbage > collector know

Re: question about what lamda does

2006-07-18 Thread [EMAIL PROTECTED]
I stand corrected. Not sure where I got that from, improper defragmentation due to sleep depravation perhaps... K.S.Sreeram wrote: > [EMAIL PROTECTED] wrote: > > The two primary differences between using def and using lambda is that > > lambda is limited to a single expression an

Re: No need to close file?

2006-07-18 Thread [EMAIL PROTECTED]
T wrote: > Do I need to close the file in this case? Why or why not? > > for line in file('foo', 'r'): > print line I was running a program in IDLE that opened a file for reading and forgot to add the close. The program ran and terminated normally. But when I tried to open it from Windows Ex

vmware/python web dev

2006-07-18 Thread [EMAIL PROTECTED]
someone has made a "virtual appliance" specialized for python web development. it has a huge list of included software. if you're interested, see: http://www.vmware.com/vmtn/appliances/directory/289 -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial classes

2006-07-19 Thread [EMAIL PROTECTED]
Sanjay wrote: > Hi All, > > Not being able to figure out how are partial classes coded in Python. > > Example: Suppose I have a code generator which generates part of a > business class, where as the custome part is to be written by me. In > ruby (or C#), I divide the code into two source files. Li

Re: Partial classes

2006-07-19 Thread [EMAIL PROTECTED]
Kay Schluehr wrote: > This definition lacks a check for disjointness of the parts. No two > partial classes shall contain a method with the same name. Yes - I mentioned at the bottom that the last one evaluated will overwrite any existing one. You're right that its probably a better idea to che

Re: questions to anyone who uses wxPython

2006-07-20 Thread [EMAIL PROTECTED]
damacy wrote: > hello. i'm using wxPython as my GUI package and whenever my program > executes a long process which takes at least 2 or 3 seconds, the user > interface gets corrupted while executing the progrocess during the > period. Hi Darnacy, I had the same issue and used wxProcess to run th

Re: How to automate user input at the command prompt?

2006-07-21 Thread [EMAIL PROTECTED]
You may want to look at pexpect: http://pexpect.sourceforge.net/ But I am not sure about its support on windows. [EMAIL PROTECTED] wrote: > I'm working on a scirpt to be used on a windows machine and I need to > automate a user's input on the command prompt. For example I

Re: How to automate user input at the command prompt?

2006-07-21 Thread [EMAIL PROTECTED]
In that case, the OP can probably use cygwin's version of python. pexpect definitely works there. Mike Kent wrote: > [EMAIL PROTECTED] wrote: > > You may want to look at pexpect: > > > > http://pexpect.sourceforge.net/ > > > > But I am not sure about its sup

Re: Track keyboard and mouse usage

2006-07-21 Thread [EMAIL PROTECTED]
Hello dfaber, I had the same problem not long ago. I tried to use the Xlib since its obvious the X server has all the events but I couldn't have the mouse events if my app was out of focus. If you have a way to do that I'm really interested. Anyway I found this to be a good introduction to Xlib:

Re: Type signature

2006-07-23 Thread [EMAIL PROTECTED]
Yacao Wang wrote: > Hi, I'm a newbie to Python. I've recently read some books about this > language and none of them have answered my question. > As a dynamically-typed language Python doesn't need any form of type > signature which makes the syntax very clean and concise. However, type > signature

Re: Generating all possible combination of elements in a list

2006-07-24 Thread [EMAIL PROTECTED]
Mir Nazim wrote: > Paul Rubin wrote: > > > 1060! / (1060 - 96)! > > > > > More than you want to think about: > > > > import math > > > > def logf(n): > > """return base-10 logarithm of (n factorial)""" > > f = 0.0 > > for x in xrange(1,n+1): > > f += mat

binding more than one attribute in a facntion

2006-07-26 Thread [EMAIL PROTECTED]
I want to have a bound method that "fixes" more than one parmeter of a funtion. LEt me post an example. def f(a, b, c): return a + b + c I can do: fplus10 = f(10) and then call f with 2 params and it works. But, how can I fix 2 params: fplus10plus20 = f(10,20) ignores the second param. fplu

File Copy Script?

2006-07-26 Thread [EMAIL PROTECTED]
Hi Folks, Just before I write a script, I want to see if anyone has beaten me to it as it seems a common scenario :-) I want a script ot copy files and folders from say C: to Z: but only copy files that are writable (i.e. Read Only flag not set). xcopy has let me down :-( Thanks, Davy Mitchell

Re: binding more than one attribute in a facntion

2006-07-26 Thread [EMAIL PROTECTED]
Peter Otten wrote: > [EMAIL PROTECTED] wrote: > Bound methods are limited to one implicit parameter. What you need is > partial function application: > > >>> def f(a, b, c): > ... return a + b + c > ... > >>> def partial(f, *args): > ... d

Re: Threads vs Processes

2006-07-27 Thread [EMAIL PROTECTED]
oftware applications around. > > Granted. Threaded program forces you to think and design your > application much more carefully (to avoid race conditions, dead-locks, > ...) but there is nothing inherently *non-robust* about threaded > applications. Indeed. Let's just get rid of

Re: Threads vs Processes

2006-07-27 Thread [EMAIL PROTECTED]
Russell Warren wrote: > This is something I have a streak of paranoia about (after discovering > that the current xmlrpclib has some thread safety issues). Is there a > list maintained anywhere of the modules that are aren't thread safe? It's much safer to work the other way: assume that librari

Re: Threads vs Processes

2006-07-27 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > John Henry wrote: > > Granted. Threaded program forces you to think and design your > > application much more carefully (to avoid race conditions, dead-locks, > > ...) but there is nothing inherently *non-robust* about threaded > > applicatio

Re: Threads vs Processes

2006-07-27 Thread [EMAIL PROTECTED]
hare things between processes, but you can't memory protect things between threads. So if you need some of each (some things shared and others protected), processes are the clear choice. Now, for a few applications threads make sense. Usually that means applications that have to share a

Re: How to force a thread to stop

2006-07-27 Thread [EMAIL PROTECTED]
Carl J. Van Arsdall wrote: > Well, I guess I'm thinking of an event driven mechanism, kinda like > setting up signal handlers. I don't necessarily know how it works under > the hood, but I don't poll for a signal. I setup a handler, when the > signal comes, if it comes, the handler gets thrown in

<    8   9   10   11   12   13   14   15   16   17   >