Re: How to force a thread to stop

2006-07-27 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > "Paul Boddie" <[EMAIL PROTECTED]> writes: > > Whether this solves the questioner's problems remains to be seen, but > > issues of handling SSH-based communications streams do seem to be > > addressed. > > Actually I don't

can anybody explain this range() speedup (with psyco)

2006-07-27 Thread [EMAIL PROTECTED]
i am doing the problems at http://www.mathschallenge.net/index.php?section=project one problem involved finding factors, i used def divisors(n): divisors = set([1]) for i in range(1, math.ceil(n ** 0.5)+1): if n % i == 0: divisors.add(i) divisors.add(n/i)

Re: Threads vs Processes

2006-07-28 Thread [EMAIL PROTECTED]
sturlamolden wrote: > Chance Ginger wrote: > > > Not quite that simple. In most modern OS's today there is something > > called COW - copy on write. What happens is when you fork a process > > it will make an identical copy. Whenever the forked process does > > write will it make a copy of the memo

Re: Threads vs Processes

2006-07-28 Thread [EMAIL PROTECTED]
mark wrote: > On Wed, 26 Jul 2006 10:54:48 -0700, Carl J. Van Arsdall wrote: > > Alright, based a on discussion on this mailing list, I've started to > > wonder, why use threads vs processes. > > The debate should not be about "threads vs processes", it should be > about "threads vs events". Event

Html character entity conversion

2006-07-30 Thread [EMAIL PROTECTED]
Here is my script: from mechanize import * from BeautifulSoup import * import StringIO b = Browser() f = b.open("http://www.translate.ru/text.asp?lang=ru";) b.select_form(nr=0) b["source"] = "hello python" html = b.submit().get_data() soup = BeautifulSoup(html) print soup.find("span", id = "r_tex

Re: Html character entity conversion

2006-07-30 Thread [EMAIL PROTECTED]
Claudio Grondi wrote: > [EMAIL PROTECTED] wrote: > > Here is my script: > > > > from mechanize import * > > from BeautifulSoup import * > > import StringIO > > b = Browser() > > f = b.open("http://www.translate.ru/text.asp?lang=ru";)

Re: Html character entity conversion

2006-07-30 Thread [EMAIL PROTECTED]
danielx wrote: > [EMAIL PROTECTED] wrote: > > Here is my script: > > > > from mechanize import * > > from BeautifulSoup import * > > import StringIO > > b = Browser() > > f = b.open("http://www.translate.ru/text.asp?lang=ru";) > >

Small problem with print and comma

2006-07-30 Thread [EMAIL PROTECTED]
Hi, I have a small problem with my function: printList. I use print with a ',' . Somehow the last digit of the last number isn't printed. I wonder why. import random def createRandomList(param): length = param a = [] creating random list""" for i in range(0,length):

Re: Jumping over in the class hierarchy

2006-08-01 Thread [EMAIL PROTECTED]
Pupeno wrote: > Hello, > I want to jump over a method in the class hierarchy, that is: If I have > class A(object), clas B(A), class C(B) and in C, I want a method to do > exactly what A does but not what B does in its reimplementation, would it > be correct to do: super(A, super(B, self)).method(

opposite of import

2006-08-03 Thread [EMAIL PROTECTED]
Hi I am new to python. I wanted to know if there is an opposite of "import" -- http://mail.python.org/mailman/listinfo/python-list

threads, file access and stuff

2006-08-03 Thread [EMAIL PROTECTED]
Hi, i'm trying to make a download manager (getright, flashget, etc..) for linux (pygtk), i'm using pyCurl, so the thing is.. the app need to be able to use mirrors, like : i download the first 400 kb from X, and the second 200 kb from Y and the rest from Z. i've plan to do this with threads and usi

Re: programming is hard

2006-08-03 Thread [EMAIL PROTECTED]
placid wrote: > Alas, all good arguments. > > I rest my case. After you've just been proven wrong? I wouldn't want you for my lawyer. > > :( > > > Cheers -- http://mail.python.org/mailman/listinfo/python-list

software thuriam

2006-08-04 Thread [EMAIL PROTECTED]
ck · Regular telephone conferences (conference calls) Contact NameThuriam Website www.thuriam.net Email [EMAIL PROTECTED] [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do I require an "elif" statement here?

2006-08-04 Thread [EMAIL PROTECTED]
Jim, what you wrote should work correctly. I'm curious as to why you are doing it this way though. An easier way would be to take out all this character processing and use the builtin string processing. See this code: --- whitespace = " " old_indent = 3 new_indent = 5

Re: Web Crawling/Threading and Things That Go Bump in the Night

2006-08-04 Thread [EMAIL PROTECTED]
Rem, what OS are you trying this on? Windows XP SP2 has a limit of around 40 tcp connections per second... Remarkable wrote: > Hello all > > I am trying to write a reliable web-crawler. I tried to write my own > using recursion and found I quickly hit the "too many sockets" open > problem. So I lo

Re: Pywin32 Excel question

2006-08-04 Thread [EMAIL PROTECTED]
John Henry wrote: > I posted the following message to the Pywin32 list but if anybody here > can help, it would be appreciated very much. > > > Hi list, > > I have a need to copy 3 rows of data from the top of my Excel > spreadsheet to another location. I would have t

string.translate with unicode

2006-08-06 Thread [EMAIL PROTECTED]
This has always worked fine for me. >>> import string >>> id = "Peter! *fine*" >>> transtab = string.maketrans('/ ','_ ') >>> print string.translate(id, transtab, '?&!;<=>*#[]{}') Peter fine Now if I do it with a unicode string: >>> id = u"Peter! *fine*" >>> transtab = string.maketrans('/ ','_ ')

subprocesses and deadlocks

2006-08-06 Thread [EMAIL PROTECTED]
Hi, there are many ways of solving the problem of finite buffer sizes when talking to a subprocess. I'd usually suggest using select() but today I was looking for a more readable/understandable way of doing this. Back in 1997 Guido himself posted a very nice solution, write your input to a tempora

need an alternative to getattr()

2006-08-07 Thread [EMAIL PROTECTED]
Hi, AIM: I have a config file that contains configuration under headings like this: heading1: heading2: ... ... i parse this file to get heading1, heading2, etc and then i want to call heading1.process(), heading2.process(), etc. What i am trying to do is: (this is not the exact code, it jus

timeout calling local se

2006-08-07 Thread [EMAIL PROTECTED]
(Environment: RedHat Linux recent, Python 2.3.5) We have a batch processing script that on occasion needs to send out an email. We have a sendmail running locally. Sometimes we get a socket timeout on sending that email. Increasing the timeout to 30sec reduced but did not eliminate it. It seems

newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
I'm new at Python and I need a little advice. Part of the script I'm trying to write needs to be aware of all the files of a certain extension in the script's path and all sub-directories. Can someone set me on the right path to what modules and calls to use to do that? You'd think that it would

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
Mike Kent wrote: > What you want is os.walk(). > > http://www.python.org/doc/current/lib/os-file-dir.html I'm thinking os.walk() could definitely be a big part of my solution, but I need a little for info. If I'm reading this correctly, os.walk() just goes file by file and serves it up for your s

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
ow can I grab the directory that my script is residing in? Thanks. hiaips wrote: > > [EMAIL PROTECTED] wrote: > > > I'm new at Python and I need a little advice. Part of the script I'm > > > trying to write needs to be aware of all the files of a certain >

threading.Event usage causing intermitent exception

2006-08-08 Thread [EMAIL PROTECTED]
Admittedly this problem causes no actual functional issues aside from an occasional error message when the program exits. The error is: Unhandled exception in thread started by Error in sys.excepthook: Original exception was: Yes all that info is blank. The application is a console application

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
So far, so good. I just have a few more questions. Here's my code so far: import os top = '/home/USERNAME/' images = [] for files in os.walk(top, topdown=True): images += [file for file in files[2] if file.endswith('jpg')] print images I still need to know how I can dynamically get the

Re: New to Python-- Help

2006-08-08 Thread [EMAIL PROTECTED]
Are you refering to IDLE? or simply running python at the command line? In either case - python is just the language's name. It is not a defined name within the language. If you describe what you are trying to do, perhaps some more specific help could be had. What is happening: There currently

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
Okay. This is almost solved. I just need to know how to have each entry in my final list have the full path, not just the file name. Also, I've noticed that files are being found within hidden directories. I'd like to exclude hidden directories from the walk, or at least not add anything within

Re: how to save a screenshot in pygame?

2006-08-08 Thread [EMAIL PROTECTED]
liuliuliu wrote: > hi -- sorry if this is trivial -- but how do you make a screenshot of a > pygame display? i have a surface which is basically the entire visible > screen -- how do you write this surface as an image file during > specific events in the script execution? image format doesnt matte

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
I make sure to have lots of jpegs in the Desktop folder for the test. Can anyone figure this out? [EMAIL PROTECTED] wrote: > I'm new at Python and I need a little advice. Part of the script I'm > trying to write needs to be aware of all the files of a certain > extension i

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
t searches for jpegs. I tried os.walk('.') and it works, so I'll be using that instead. [EMAIL PROTECTED] wrote: > Here's my code: > > def getFileList(): > import os > imageList = [] > for dirpath, dirnames, filenames in os.wa

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
I've narrowed down the problem. All the problems start when I try to eliminate the hidden files and directories. Is there a better way to do this? [EMAIL PROTECTED] wrote: > I'm new at Python and I need a little advice. Part of the script I'm > trying to write needs t

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
That worked perfectly. Thank you. That was exactly what I was looking for. However, can you explain to me what the following code actually does? reversed(range(len(dirnames))) Gabriel Genellina wrote: > At Tuesday 8/8/2006 21:11, [EMAIL PROTECTED] wrote: > > > >Here's

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
versed(range(len(dirnames))): if dirnames[dirname].startswith('.'): del dirnames[dirname] return imageList print getFileList('.jpg', '.gif', '.png') The line I don't understand is: reversed(range(len(dirnames))) Just

Re: newb question: file searching

2006-08-08 Thread [EMAIL PROTECTED]
I'm sorry. I didn't mean to offend you. I never thought your way was inferior. Justin Azoff wrote: > [EMAIL PROTECTED] wrote: > > I do appreciate the advice, but I've got a 12 line function that does > > all of that. And it works! I just wish I understo

Re: do people really complain about significant whitespace?

2006-08-09 Thread [EMAIL PROTECTED]
Slawomir Nowaczyk wrote: > > I must admit I do not get this "indicate intentions twice" argument, > even though I heard it a number of times now... It's not that braces > require more work or more typing or something, after all -- at least > not if one is using a decent editor. Its not the typing,

Re: timeout calling local sendmail

2006-08-09 Thread [EMAIL PROTECTED]
that's "timeout calling local sendmail" not "timeout calling local se" [EMAIL PROTECTED] wrote: > (Environment: RedHat Linux recent, Python 2.3.5) > > We have a batch processing script that on occasion needs to send out an > email. We have a sendmail ru

Re: threading.Event usage causing intermitent exception

2006-08-09 Thread [EMAIL PROTECTED]
Tim Peters wrote: > [EMAIL PROTECTED] > > Admittedly this problem causes no actual functional issues aside from > > an occasional error message when the program exits. The error is: > > > > Unhandled exception in thread started by > > Error in sys.excep

Two Classes In Two Files

2006-08-09 Thread [EMAIL PROTECTED]
I just started working with Python and ran into an annoyance. Is there a way to avoid having to use the "from xxx import yyy" syntax from files in the same directory? I'm sure it's been asked a million times, but I can't seem to find the answer. For example, I have two classes stored in separate f

Re: Two Classes In Two Files

2006-08-09 Thread [EMAIL PROTECTED]
> It's just the way it is. Why worry about it? Wasn't so much a worry, just trying to figure out how to think the python way. Max M wrote: > [EMAIL PROTECTED] wrote: > > I just started working with Python and ran into an annoyance. Is there > > a way to avoid having

Re: Python share CPU time?

2006-08-09 Thread [EMAIL PROTECTED]
Yannick wrote: > Hi, > > I would like to program a small game in Python, kind of like robocode > (http://robocode.sourceforge.net/). > Problem is that I would have to share the CPU between all the robots, > and thus allocate a time period to each robot. However I couldn't find > any way to start a

Re: knowing when file is flushed to disk

2006-08-09 Thread [EMAIL PROTECTED]
John Pote wrote: > Is there some way from my Python script to know when the data is actually on > the disk. BTW server OS is Linux. Presumably calling flush() and close() on > the output file will initiate the disk write, but do they wait for the > actual disk write or immediately return leaving th

Easy image rendering?

2006-08-09 Thread [EMAIL PROTECTED]
Can someone tell me what's the absolute easiest way of putting an image on to the screen in Python without just opening it up in an application? What's the simplest way to just put something up on the screen? -- http://mail.python.org/mailman/listinfo/python-list

Re: Easy image rendering?

2006-08-09 Thread [EMAIL PROTECTED]
No good. No external applications. What else is there? Worst case scenario, what's the easiest way to do GUI? Pontus Ekberg wrote: > On Wed, 09 Aug 2006 16:27:50 -0700, [EMAIL PROTECTED] wrote: > > > Can someone tell me what's the absolute easiest way of putting an imag

Re: Easy image rendering?

2006-08-09 Thread [EMAIL PROTECTED]
I think that you've put me on the right track, but my eventual goal is to be able to put the pictures on the screen with a full-screen interface. Not in a visible window, with just the picture and then a black backdrop for it. [EMAIL PROTECTED] wrote: > >> If you are using PIL

Re: Make Object Oriented?

2006-08-10 Thread [EMAIL PROTECTED]
It would be ease to create such a tool if you dont care if your code is a Functional Decomposition (http://c2.com/cgi/wiki?FunctionalDecomposition) AntiPatern. But OO design is hard to do "automagically" from a bunch of functions and data structures. Methods and attributes are in the same object fo

Re: excel in unix?

2006-08-10 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > hi > is it possible to create excel files using python in Unix env? > if so, what module should i use? > thanks Depending on the complexity of your data you might find the csv module useful. It allows you to write comma separated value (.csv) files that

Re: Two Classes In Two Files

2006-08-10 Thread [EMAIL PROTECTED]
Yes, I have been ruined for the last 5 years with Java and C#. Perl was my only salvation, but now I can't read the programs I wrote. Pedro Werneck wrote: > On 9 Aug 2006 12:35:48 -0700 > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > >

Re: easy string formating question

2006-08-10 Thread [EMAIL PROTECTED]
here's a simple way numChar = 10 testText="akfldjliugflkjlsuagjlfnflgj" for c in xrange(0,len(testText),numChar): print testText[c,c+numChar] for slightly better performance you should probably do numChar = 10 testText="akfldjliugflkjlsuagjlfnflgj" lenText = len(testText) for c in xrange(0,le

Re: ALLAH

2006-08-10 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Kader; > > soru:madem,hersey bir kader defterinde yazili ve hersey ona göre > oluyor.o halde insanlar niçin cehenneme gidiyor? > cevap:evet hersey bir kader defterinde yazili ve hersey ona göre > oluyor.ama,defterde yazili oldugu için o sey olmuy

Re: timeout calling local sendmail

2006-08-11 Thread [EMAIL PROTECTED]
That seems applicable to writing an SMTP server/daemon, but is it necessary for a script client calling a local SendMail daemon? Tim Williams wrote: > > > RFC 1123 > > http://www.freesoft.org/CIE/RFC/1123/109.htm > > I find that a timeout of 120 seconds is the bare minimum. If the > timeout is

Re: having issues Installing Python 2.5b3 on Windows XP

2006-08-11 Thread [EMAIL PROTECTED]
Bucco wrote: > The python 2.4 version msi did no better. Please help. I do not > really want to go back to Active State Python. > > > Thanks:) > > SA > > > Bucco wrote: > > I > > am going to try to install python 2.4 with the msi installer and see if > > I have the same issue with that version.

Re: having issues Installing Python 2.5b3 on Windows XP

2006-08-11 Thread [EMAIL PROTECTED]
Bucco wrote: > The python 2.4 version msi did no better. Please help. I do not > really want to go back to Active State Python. > > > Thanks:) > > SA > > > Bucco wrote: > > I > > am going to try to install python 2.4 with the msi installer and see if > > I have the same issue with that version.

Re: help with c <-> python buffer transfer

2006-08-11 Thread [EMAIL PROTECTED]
John Machin wrote: > [EMAIL PROTECTED] wrote: > > How does one transfer a buffer object from python -> c and back again > > (assuming the data gets modified)? > > I can't seem to get this or anything else to work, but am clueless as > > to what I'm doing

unbound methods

2006-08-12 Thread [EMAIL PROTECTED]
I wrote a small class today at work playing with sockets in command line windows. When attempting to call the handle function, I get a TypeError. "Unbound method handle() must be called with connection instance as first argument (got nothing instead). Any suggestions would be greatly appreciated.

looking for a simple way to load a program from another python program..

2006-08-13 Thread [EMAIL PROTECTED]
I was looking for a simple way to load a simple python program from another python program. I tried os.system(cabel) The file name is cabel.py a csound instrument editor.. The error I am getting is Traceback (most recent call last): File "C:\Python24\Lib\site-packages\boa-constructor\tes

Re: looking for a simple way to load a program from another python program..

2006-08-13 Thread [EMAIL PROTECTED]
Caleb Hattingh wrote: > Hi Eric > > Check that ".py" and ".pyw" are in your PATHEXT environment variable > (are you using Windows?). Then, if the folder that cabel is in is in > your PATH environment variable, and the correct association for .py > files is set up (i.e. they get run by python.exe

Re: looking for a simple way to load a program from another python program..

2006-08-13 Thread [EMAIL PROTECTED]
Caleb Hattingh wrote: > Hi Eric > > Check that ".py" and ".pyw" are in your PATHEXT environment variable > (are you using Windows?). Then, if the folder that cabel is in is in > your PATH environment variable, and the correct association for .py > files is set up (i.e. they get run by python.exe

Nested if and expected an indent block

2006-08-13 Thread [EMAIL PROTECTED]
Greetings: I'm brand new to Python and decided to write a syllogism solver for a class I'm taking. At the start of the program, I define a function that classifies the type of each statement in the syllogism. Python tells me that it is expecting an indented block at the s in "some". I can see what

Re: yet another noob question

2006-08-13 Thread [EMAIL PROTECTED]
Sybren Stuvel wrote: > mike_wilson1333 enlightened us with: > > I would like to generate every unique combination of numbers 1-5 in a 5 > > digit number and follow each combo with a newline. So i'm looking at > > generating combinations such as: (12345) , (12235), (4) and so on. > > Count fro

Re: Nested if and expected an indent block

2006-08-13 Thread [EMAIL PROTECTED]
alisonken1 wrote: > [EMAIL PROTECTED] wrote: > > Greetings: > > > > elif q.lower() == "some"# s in some is highlighted > > > Any ideas? Thanks in advance. > > > > Keith > > Would the missing colon have something to do with i

Re: Nested if and expected an indent block

2006-08-13 Thread [EMAIL PROTECTED]
Dustan wrote: > > To see the full traceback, assuming you're using windows, you need to > run it on the Command prompt. Hi Dustan: Here's the traceback: C:\docs\Python>SylloSolver.py File "C:\docs\Python\SylloSolver.py", line """ ^ IndentationError: expected an indented block I go

Re: Nested if and expected an indent block

2006-08-13 Thread [EMAIL PROTECTED]
Simon Forman wrote: > > I got rid of the triple quote string at the start of the function, and > > that cleared up the problem, though I don't know why. > > > Ah, yes. The docstring for a function (or at least its first > triple-quote) must be indented to the same degree as its statements. > (If y

Re: Best IDE for Python

2006-08-14 Thread [EMAIL PROTECTED]
Yu-Xi Lim wrote: > Eclipse+PyDev has the advantage over emacs when it comes to big > projects, IMO. It has features like refactoring, better project > management, code coverage Emacs and vim both have good integration of BicycleRepairMan for python refactoring. I don't know what better project ma

Re: looking for a simple way to load a program from another python program..

2006-08-14 Thread [EMAIL PROTECTED]
Gabriel Genellina wrote: > At Sunday 13/8/2006 16:51, [EMAIL PROTECTED] wrote: > > > I was looking for a simple way to load a simple python program from > >another python program. > > > >I tried > > > >os.system(cabel) > > > &g

Re: Finding if Python Is Running In Console (python.exe) or Window (pythonw.exe)

2006-08-14 Thread [EMAIL PROTECTED]
Chaos wrote: > Does anyone know how to find where python is running from. I cant find > the answer to this anywahere on google or the docs. I know its there > because Ive seen ti done before. Thanks. Hopefully It is still there. In module "sys" as "executable". Juergen -- http://mail.python.o

Re: Best IDE for Python

2006-08-15 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Hi All, What do you find the best IDE for creating web applications in > Python is? Preferably FOS IDE. > > Cheers I like ActiveState's Komodo. It's heavyweight and not free ($30 for the personal edition) but it also supports Perl, Ruby, PHP and

STAF(Software Testing Automation Framework) with STAX for running python test suites/cases

2006-08-15 Thread [EMAIL PROTECTED]
Hi everyone, I am researching GUI's that I can use for running my python test sctipts which will make reports and monitor the tests ect...(bringing my application away form the comand prompt) I believe the applications STAF and STAX at http://staf.sourceforge.net/index.php provide this functional

Re: Best IDE for Python

2006-08-15 Thread [EMAIL PROTECTED]
I've had a similar experience and tried about everything. Personally - eclipse with PyDev has been the winner for me. I also still do a bunch of Java coding - so there is an added benefit of one tool across languages. The final thing I really like with eclipse is the svn plugins - making life ve

Re: Beginner Textbook

2006-08-15 Thread [EMAIL PROTECTED]
M_M wrote: > Hi, > > I am looking for a simple text book to introduce 13 to 18 year olds to > python programming. Suggestion? > > New to python. On the Python site is a list of tutorials on this page: http://wiki.python.org/moin/BeginnersGuide/NonProgrammers, towards the end of the page you'll fi

Re: Best IDE for Python

2006-08-15 Thread [EMAIL PROTECTED]
Bruce Who wrote: > Hi, sjdevnull > > I'm a vimmer too, and I wonder what plugins you are using. What you > said sounds interesting. Could you tell us more about the plugins? > "Object browser" is what I need most, but so far I've no idea what > plugin can do this for me, :-( It's like a 15 minute

Re: file object and eof

2006-08-15 Thread [EMAIL PROTECTED]
KraftDiner wrote: > how about?!: > > def eof(fileobj): >curloc = fileobj.tell() >ofloc = fileobj.seek(0,2) >fileobj.seek(curloc, 0) >if ofloc >= curloc: > return True >return False 1. At least on python 2.3, seek always returns None--did that change in 2.4? I added a tel

Re: include a python class in another python script.

2006-08-15 Thread [EMAIL PROTECTED]
KraftDiner wrote: > I have a class that is defined in a file called MyClass.py > > How do I use that class in another python script.. > import MyClass ? (Does it need to be in a specific location?) Same directory as the script that's importing it, or in the PYTHONPATH. import sys print sys.path

Re: idea on how to get/set nested python dictionary values

2006-08-15 Thread [EMAIL PROTECTED]
jojoba wrote: > hello! > > i am trying to come up with a simple way to access my values in my > nested python dictionaries > > here is what i have so far, but i wanted to run it by the geniuses out > there who might see any probems with this... > here is an example: > > +++

Re: Creating Charts in Excel with pyExcelerator.ExcelMagic

2006-08-15 Thread [EMAIL PROTECTED]
implicate_order wrote: > Greetings, > > I'm new to python and am in the process of writing a script to parse > some CSV data, spread it across multiple Excel worksheets and then > generate charts. I searched the internet to find some place where I > could look up a HOWTO doc/recipe to do that usin

Re: Why do I require an "elif" statement here?

2006-08-15 Thread [EMAIL PROTECTED]
John Savage wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > >--- > >whitespace = " " > >old_indent = 3 > >new_indent = 5 > > > >x = " starts with 3 spa

Re: what is the keyword "is" for?

2006-08-16 Thread [EMAIL PROTECTED]
Sybren Stuvel wrote: > Dan Bishop enlightened us with: > a = b = 1e1000 / 1e1000 > a is b > > True > a == b > > False > > If "a is b" then they refer to the same object, hence a == b. It > cannot be otherwise, unless Python starts to defy logic. I copied your > code and got the expec

Re: Memory usage of an 'empty' python interpreter

2006-08-16 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I was wondering what the approximate amount of memory needed to load a > Python interpreter (only, no objects, no scripts, no nothing else) in a > Linux 2.6 environment. According to ps, it appears to be 3312 bytes, > which seems absurdly low to me. Your

Re: idea on how to get/set nested python dictionary values

2006-08-16 Thread [EMAIL PROTECTED]
metaperl wrote: > [EMAIL PROTECTED] wrote: > > > | would use a recursive approach for this - given that you have a sort > > of recursive datastructure: > > > > py> def SetNewDataParam2(Data, NewData): > > ... if type(Data[Data.keys()[0]]) == type(dict())

Re: python-dev and setting up setting up f2py on Windows XP

2006-08-16 Thread [EMAIL PROTECTED]
I'm really not familiar with the package you are trying to use, nor that familiar with what you get on windows. I would guess you did a binary installation download, and you may need to get the python source tarball instead - in order to get the files you need. Barring that, I'm certain the heade

Re: Calling a python script, and getting the returned result in C

2006-08-16 Thread [EMAIL PROTECTED]
Shuaib wrote: > Hi! > > I have a python script which returns an Integer value. How do I call > this script from a C programe, and use the result returned? > > Thanks for your time. This is actually a C question, not a Python question. If all you need is the return value of the program, consider l

Re: PythonCard question

2006-08-17 Thread [EMAIL PROTECTED]
DarkBlue wrote: > Is it possible to create pythoncard textField components > dynamically during run time ? > > Something on the lines of > > pseudo code : > > def make_textfield(length,topleftposx,topleftposy): > doit > > self.make_textfield(120,20,20) > > > Thanks for any ideas. The noresour

Re: List match

2006-08-17 Thread [EMAIL PROTECTED]
OriginalBrownster wrote: > Hi there: > > I know this probably is a very easy thing to do in python, but i wanted > to compare 2 lists and generate a new list that does not copy similar > entries. An example below > > list= ["apple", "banana", "grape"] > list2=["orange","banana", "pear"] > > now I

Re: List match

2006-08-17 Thread [EMAIL PROTECTED]
OriginalBrownster wrote: > Hi there: > > I know this probably is a very easy thing to do in python, but i wanted > to compare 2 lists and generate a new list that does not copy similar > entries. An example below > > list= ["apple", "banana", "grape"] > list2=["orange","banana", "pear"] > > now I

Re: amd64

2006-08-18 Thread [EMAIL PROTECTED]
Robin Becker wrote: > Does anyone know if it's possible to run python as a 32 bit app on AMD64's? > One > of our host providers AMD Athlon 64 3000+ and we are currently using a celeron > which is real slow. The problem is that this machine would be a backup for > another which is 32 pentium 4. >

efficient memoize decorator?

2006-08-18 Thread [EMAIL PROTECTED]
im plugging away at the problems at http://www.mathschallenge.net/index.php?section=project im trying to use them as a motivator to get into advanced topics in python. one thing that Structure And Interpretation Of Computer Programs teaches is that memoisation is good. all of the memoize decorators

Re: efficient memoize decorator?

2006-08-18 Thread [EMAIL PROTECTED]
sorry memoize is http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496879 memoize2 is http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466320 > im plugging away at the problems at > http://www.mathschallenge.net/index.php?section=project > im trying to use them as a motivator to get i

Re: amd64

2006-08-18 Thread [EMAIL PROTECTED]
if the install is 64 bit, you will hit trouble i used the guide here http://www.debian-administration.org/articles/356 on my 64 bit debian system to get 32bit apps available if they have a particular distro install, usually the package management tools for it can add most python modules you will ne

Re: how do you get the name of a dictionary?

2006-08-18 Thread [EMAIL PROTECTED]
jojoba wrote: > Does anyone know how to find the name of a python data type. > > Conside a dictionary: > > Banana = {} > > Then, how do i ask python for a string representing the name of the > above dictionary (i.e. 'Banana')? The reason people are banging their heads is because the question doesn

Re: efficient memoize decorator?

2006-08-19 Thread [EMAIL PROTECTED]
: error checking and would like to make myself better) cheers, tom Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > all of the memoize decorators at the python cookbook seem to make my > > code slower. > > if you want good performance, use the following pattern: > &g

Re: efficient memoize decorator?

2006-08-19 Thread [EMAIL PROTECTED]
self.instance, *args) AttributeError: 'Memoize' object has no attribute 'instance' cheers, tom Gabriel Genellina wrote: > At Friday 18/8/2006 17:14, [EMAIL PROTECTED] wrote: > > >sorry > >memoize is > >http://aspn.activestate.com/ASPN/Cookbook/Python/Reci

Re: efficient memoize decorator?

2006-08-19 Thread [EMAIL PROTECTED]
am i correct in thinking that psyco will just not accelerate, rather than break code it cannot deal with? that has been a pretty standard import on all my programs tom Ziga Seilnacht wrote: > [EMAIL PROTECTED] wrote: > > im plugging away at the problems at > > http://www.mat

Re: efficient memoize decorator?

2006-08-19 Thread [EMAIL PROTECTED]
I suppose that lesson should not suprise me, programming is a subtle art that i need spend some time mastering thanks to all that have replied tom Fredrik Lundh wrote: > Gabriel Genellina wrote: > > > This implementation uses cPickle to generate a key from the supplied > > function arguments,

Help in using introspection to simplify repetitive code

2006-08-20 Thread [EMAIL PROTECTED]
Hello. I'm writing a proxy class, i.e: a class whose methods mostly delegate their functionality to other class object. Most of the methods (which are quite a lot) defined in the class would end up being: def thisIsTheMethodName(self): self._handlerClass.thisIsTheMethodName() The handler obje

Re: convert a long string in binary

2006-08-20 Thread [EMAIL PROTECTED]
bussiere maillist wrote: > i've got a very long string > and i wanted to convert it in binary > like > > string = """Monty Python, or The Pythons, is the collective name of > the creators of Monty Python's Flying Circus, a British television > comedy sketch show that first aired on the BBC on Octo

Re: import

2006-08-20 Thread [EMAIL PROTECTED]
If your still having trouble how are you running python? If you run cmd and THEN type python it is not operating in the python24 directory and runs in the directory cmd was in before the command. Otherwise make sure you don't have any previous python installs. -- http://mail.python.org/mailman/li

looking for help with dex tracker

2006-08-20 Thread [EMAIL PROTECTED]
I have a project on sourceforge that is going to be a tracker for csound currently it is a text editor with some external programs attached. There is no complex thing to do to join just post to http://groups.google.com/group/dexrow-software-and-programming-group the software is available at h

Re: Send to all clients using UDP in Twisted

2006-08-21 Thread [EMAIL PROTECTED]
Thanks for the responce, I am sending over the internet so I can't use that method. Thanks for the reply anyway! Martin P. Hellwig wrote: > Elliot Hughes wrote: > > Hi Everyone, I am trying to right a server that can receive a message > > and send it to all clients using UDP on twisted. I have got

Re: Help in using introspection to simplify repetitive code

2006-08-21 Thread [EMAIL PROTECTED]
As you mention, wether the methods take arguments or not is something to have into account. And they do take arguments, and a variable number of them, so AFAIK hooking with __getattr__ or __getattribute__ will not work, as you can only get the method name with that. I was thinking of some __call__

Re: text editor suggestion?

2006-08-21 Thread [EMAIL PROTECTED]
John Salerno wrote: > Sybren Stuvel wrote: > > John Salerno enlightened us with: > >> But what about customizing syntax coloring? Is this also in the same > >> file? I've noticed a separate file called python.vim (in Windows, > >> this file exists in a 'syntax' folder, and also another file of the

Re: how do you get the name of a dictionary?

2006-08-21 Thread [EMAIL PROTECTED]
jojoba wrote: > However, does it not seem reasonable to ask python: > > Given a dicitionary, Banana = {} > return one or more strings, > where each string is the name(s) of the reference(s) to Banana. No, it doesn't. It'd be like having an open file descriptor in C and then asking what filename(s

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