Can any one help with solving this program it just doesnt take probability of the second team

2006-10-26 Thread Arun Nair
''' Can anyone help me with this program it just takes probability of the first team and runs the program doesnt takes the probability of the second team even though specified''' from random import * def volleySimulation(): printInstructions() probA, probB, n = getInputs() winA, winB

Re: python html 2 image (png)

2006-10-26 Thread baur79
thanks Diez i will start with your suggestions let see what happen On Oct 25, 11:27 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > >> what tools are you using to do that today? > > > where are many of EXE programs > > but i need python solution for adding it to

iterator idea

2006-10-26 Thread Paul Rubin
I wonder if Python would benefit from letting a generator jump to another iterator, i.e. something like yield return *seq would be the equivalent of for s in seq: yield s return except that it would work by transferring control directly to seq's iterator (like a goto) instead of callin

Re: python html 2 image (png)

2006-10-26 Thread joe Li
class Bunch(object):    def __init__(self, **fields):     self.__dict__ = fields    p = Bunch(x=2.3, y=4.5)print p print p.__dict__I dont' understand the usage of the double * here, could anyone explain it for me? thanks. -- http://mail.python.org/mailman/listinfo/pyth

Re: Can any one help with solving this program it just doesnt take probability of the second team

2006-10-26 Thread Peter Otten
Arun Nair wrote: > ''' Can anyone help me with this program it just takes probability of > the first team and runs the program doesnt takes the probability of the > second team even though specified''' > def simGame(probA, probB): > scoreA = 0 > scoreB = 0 > serving = "A" > while

Re: Fatal Python error: deallocating None

2006-10-26 Thread Fredrik Lundh
Gabriel Genellina wrote: > Mmm, it appears that one of these C extensions isn't managing the ref > count correctly - perhaps there is a return Py_None without a previous > Py_INCREF? If None were returned in certain functions to indicate > failure or something exceptional - and not a regular co

Re: using mmap on large (> 2 Gig) files

2006-10-26 Thread Chetan
Paul Rubin writes: > "sturlamolden" <[EMAIL PROTECTED]> writes: >> However, "memory mapping" a file by means of fseek() is probably more >> efficient than using UNIX' mmap() or Windows' >> CreateFileMapping()/MapViewOfFile(). > > Why on would you think that?! It is coun

Re: python html 2 image (png)

2006-10-26 Thread Fredrik Lundh
joe Li wrote: > **class Bunch(object): > def __init__(self, **fields): > self.__dict__ = fields > > p = Bunch(x=2.3, y=4.5) > print p > > print p.__dict__ > > I dont' understand the usage of the double * here, could anyone explain > it for me? if you're

Re: using mmap on large (> 2 Gig) files

2006-10-26 Thread Paul Rubin
Chetan <[EMAIL PROTECTED]> writes: > > Why on would you think that?! It is counterintuitive. fseek beyond > > whatever is buffered in stdio (usually no more than 1kbyte or so) > > requires a system call, while mmap is just a memory access. > And the buffer copy required with every I/O from/to the

Re: Can any one help with solving this program it just doesnt take probability of the second team

2006-10-26 Thread Arun Nair
Thanks a ton peter its working. Peter Otten wrote: > Arun Nair wrote: > > > ''' Can anyone help me with this program it just takes probability of > > the first team and runs the program doesnt takes the probability of the > > second team even though specified''' > > > def simGame(probA, probB): >

Re: To remove some lines from a file

2006-10-26 Thread Chetan
Sebastian Busch <[EMAIL PROTECTED]> writes: > Steve Holden wrote: >> Sebastian Busch wrote: >>> [EMAIL PROTECTED] wrote: ... I would like to remove two lines from a file. ... >>> ... grep -v ... >> ... show ... > > grep -v "`grep -v "commentsymbol" yourfile | head -2`" yourfile > > > i frankl

Problem Commenting within Filehandle Iteration

2006-10-26 Thread Wijaya Edward
Hi all, I have the following code: import sys import re ham_count = 0 spam_count = 0 myfile = open('full/index') for line in myfile.readlines(): p = re.compile('ham') m = p.match(line) if m: print line, else: #print

Re: Sorting by item_in_another_list

2006-10-26 Thread Steven Bethard
Cameron Walsh wrote: > Which brings me to the question, would this solution: > > B = set(B) > A = B + list(x for x in A if x not in B) > > be faster than this solution: > > B = set(B) > A.sort(key=B.__contains__, reverse=True) > > My guess is yes, since while the __contains__ method is only run

Re: python html 2 image (png)

2006-10-26 Thread joe Li
Thanks a lot.Please forgive my careless mistake, I am completely a new user^-^2006/10/26, Fredrik Lundh <[EMAIL PROTECTED]>: joe Li wrote:> **class Bunch(object):> def __init__(self, **fields): > self.__dict__ = fields>> p = Bunch(x=2.3, y=4.5)> print p>> print p.__dict__>> I dont' unde

Re: Sorting by item_in_another_list

2006-10-26 Thread Paul Rubin
Steven Bethard <[EMAIL PROTECTED]> writes: > Cameron Walsh wrote: > > Which brings me to the question, would this solution: > > B = set(B) > > A = B + list(x for x in A if x not in B) > > be faster than this solution: > > B = set(B) > > A.sort(key=B.__contains__, reverse=True) > [timings deleted] >

Slightly OT: Is pyhelp.cgi documentation search broken?

2006-10-26 Thread Joel Hedlund
Hi! For a number of days I haven't been able to search the online python docs at: http://starship.python.net/crew/theller/pyhelp.cgi that is the "search the docs with" link at this page: http://www.python.org/doc/ Instead of the search engine, I get Error 404. This is a real bother for me, s

Re: ANN compiler2 : Produce bytecode from Python 2.5 Abstract Syntax Trees

2006-10-26 Thread [EMAIL PROTECTED]
Martin v. Löwis wrote: > >> Let me second this. The compiler package is largely unmaintained and > >> was known to be broken (and perhaps still is). A replacement > >> implementation, especially if it comes with a new maintainer, would > >> be welcome. > > Many of these are fixed, but it wouldn't s

Re: Problem Commenting within Filehandle Iteration

2006-10-26 Thread Fredrik Lundh
Wijaya Edward wrote: > if m: > print line, > else: > #print 'SPAM -- %s' % line > myfile.close() > > Sometime while developing/debugging the code we usually > put in such situation. Where expression under "else" > is not yet supplied, yet we would like see the printout of

Re: Problem Commenting within Filehandle Iteration

2006-10-26 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Wijaya Edward wrote: > if m: > print line, > else: > #print 'SPAM -- %s' % line > myfile.close() > > […] > > Notice that I wanted to comment out the #print line there. > However I found problem with myfile.close(), with identation error. > This erro

Re: Problem Commenting within Filehandle Iteration

2006-10-26 Thread Ben Finney
Wijaya Edward <[EMAIL PROTECTED]> writes: > if m: > print line, > else: > #print 'SPAM -- %s' % line Simple answer: if m: print line, # else: # print 'SPAM' My preferred answer: if m: print line, and get the lines back again later f

Re: Slightly OT: Is pyhelp.cgi documentation search broken?

2006-10-26 Thread Thomas Heller
Joel Hedlund schrieb: > Hi! > > For a number of days I haven't been able to search the online python > docs at: > > http://starship.python.net/crew/theller/pyhelp.cgi > > that is the "search the docs with" link at this page: > > http://www.python.org/doc/ > > Instead of the search engine, I g

Re: Problem Commenting within Filehandle Iteration

2006-10-26 Thread Fredrik Lundh
Ben Finney wrote: > My preferred answer: > > if m: > print line, > > and get the lines back again later from your version control system. switching debugging statements on and off by rolling back to an earlier release strikes me as a somewhat misguided use of version control. --

Printing Hidden Character in Python

2006-10-26 Thread Wijaya Edward
Hi, How can we print out the hidden character like "\n", "\r" etc in Python? -- Edward WIJAYA SINGAPORE Institute For Infocomm Research - Disclaimer - This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notif

Re: Problem Commenting within Filehandle Iteration

2006-10-26 Thread Ben Finney
Fredrik Lundh <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > > My preferred answer: > > > > if m: > > print line, > > > > and get the lines back again later from your version control system. > > switching debugging statements on and off by rolling back to an > earlier release st

Make alternative like NAnt, rake, ... written in python?

2006-10-26 Thread Achim Domma
Hi, I'm looking for a tool to automate build tasks like copying files, zipping them up, change config files NAnt works fine, because it's quite easy to extend in C#, but it would even easier to write tasks in Python. SCons is the only Python tool of this kind which I know. But SCons is m

Re: unsigned 32 bit arithmetic type?

2006-10-26 Thread Robin Becker
sturlamolden wrote: > Robin Becker wrote: > >> it's probably wonderful, but I don't think I can ask people to add numpy to >> the >> list of requirements for reportlab :) > > This was Matlab, but the same holds for Python and NumPy. The overhead > in the first code sniplet comes from ca

Re: Sending Dictionary via Network

2006-10-26 Thread Frithiof Andreas Jensen
"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Frithiof Andreas Jensen wrote: > >> "mumebuhi" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > >> The simplejson module is really cool and simple to use. This is great! > > > > JUST what I need for some

Re: chained attrgetter

2006-10-26 Thread Brian Beck
Alexey Borzenkov wrote: > Do you mean something like > > class cattrgetter: > def __init__(self, name): > self.names = name.split('.') > def __call__(self, obj): > for name in self.names: > obj = getattr(obj, name) > return obj I'll raise you one: def c

Re: Printing Hidden Character in Python

2006-10-26 Thread Ben Finney
Wijaya Edward <[EMAIL PROTECTED]> writes: > How can we print out the hidden character like "\n", "\r" etc in > Python? What result do you want that you're not getting with: print "\n" -- \ "Two rules to success in life: 1. Don't tell people everything | `\

Get coordinates of a cell

2006-10-26 Thread Teja
I have a GUI application with a Frame and a grid in it. I want to popup a menu after the user enters some text in a cell and hits ENTER key. I was able to popup the menu. However the menu is not popping up exactly at the position where I want it. It should be popped up immediately after the cell in

Re: chained attrgetter

2006-10-26 Thread Brian Beck
David S. wrote: > Does something like operator.getattr exist to perform a chained attr > lookup? > > I came up with the following, but I can not help but think it is > already done and done better. You were on the right track, but the built-in getattr is a perfectly good argument to reduce(), usin

Re: cleaner way to write this?

2006-10-26 Thread Hendrik van Rooyen
"John Salerno" <[EMAIL PROTECTED]> wrote: 8<- > > LOL. Guess I'm doing things right, then? ;) > you can NEVER be sure - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

RE: Printing Hidden Character in Python

2006-10-26 Thread Wijaya Edward
Ben, I mean while opening a file, like this for line in open('somefile.txt'): print line printing "line" will not show the hidden chars like "\n","\r". Is there a way to print it out? -- Edward WIJAYA SINGAPORE From: [EMAIL PROTECTED] on behalf of Ben

Re: To remove some lines from a file

2006-10-26 Thread Sebastian Busch
Chetan wrote: > Sebastian Busch <[EMAIL PROTECTED]> writes: > >> Steve Holden wrote: >>> Sebastian Busch wrote: [EMAIL PROTECTED] wrote: > ... I would like to remove two lines from a file. ... ... grep -v ... >>> ... show ... >> grep -v "`grep -v "commentsymbol" yourfile | head -2`"

Re: Printing Hidden Character in Python

2006-10-26 Thread Ben Finney
[Please don't top-post replies. I've corrected it in this post.] Wijaya Edward <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > Wijaya Edward <[EMAIL PROTECTED]> writes: > > > How can we print out the hidden character like "\n", "\r" etc in > > > Python? > > What result do you want that you're

Re: Printing Hidden Character in Python

2006-10-26 Thread Fredrik Lundh
"Wijaya Edward" wrote: > I mean while opening a file, like this > > for line in open('somefile.txt'): >print line > > printing "line" will not show the hidden chars like "\n","\r". > Is there a way to print it out? print repr(line) -- http://mail.python.org/mailman/listinfo/python

Re: Printing Hidden Character in Python

2006-10-26 Thread [EMAIL PROTECTED]
Just escape the '\' character. So you would do: print "\\n" On Oct 26, 2:06 am, Wijaya Edward <[EMAIL PROTECTED]> wrote: > Ben, > > I mean while opening a file, like this > > for line in open('somefile.txt'): > print line > > printing "line" will not show the hidden chars like "\n","\r". > Is

Re: Make alternative like NAnt, rake, ... written in python?

2006-10-26 Thread Paul Boddie
Achim Domma wrote: > > I'm looking for a tool to automate build tasks like copying files, > zipping them up, change config files NAnt works fine, because it's > quite easy to extend in C#, but it would even easier to write tasks in > Python. > > SCons is the only Python tool of this kind which

Re: using mmap on large (> 2 Gig) files

2006-10-26 Thread Chetan
Paul Rubin writes: > I mean just have an interface to OS locks (Linux futex and whatever > the Windows counterpart is) and maybe also a utility function to do a > compare-and-swap in user space. There is code for spinlocks, but it allocates the lockword in the process me

Cards deck problem

2006-10-26 Thread Arun Nair
Can any one help me with this im not getting it even after reading books because there is not much of discussion anywhere a> Implement a calss that represents a playing card. The class should implement the following methods: _ _ init _ _ (self, rank, suit) Creates a card. rank is an integer in r

Re: Cards deck problem

2006-10-26 Thread Paul Rubin
"Arun Nair" <[EMAIL PROTECTED]> writes: > Your urgent and quick reply help will be appreciated the most. Do you have a specific question? What are you having trouble with? -- http://mail.python.org/mailman/listinfo/python-list

Re: Cards deck problem

2006-10-26 Thread Ben Finney
"Arun Nair" <[EMAIL PROTECTED]> writes: > Can any one help me with this im not getting it even after reading > books because there is not much of discussion anywhere Perhaps the discussion should be between yourself and your teacher, or the other students in your class. We're not here to do your

Re: Cards deck problem

2006-10-26 Thread Arun Nair
Hey paul i dont know how to implement this stuff if you have any ebook or any notes which can halp me then i would like to try it and implement my and refer back to you for any errors comming out of it Regards, Arun On Oct 26, 7:39 pm, Paul Rubin wrote: > "Arun Nair" <

Re: Cards deck problem

2006-10-26 Thread Arun Nair
Im so sorry about that but the lecturer doesnt teaches anything so its become very difficult for me to do it if you guys have any notes on classes it will be very helpfull. and i can try on my own. regards, Arun On Oct 26, 7:47 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > "Arun Nair" <[EMAIL PROT

Re: Cards deck problem

2006-10-26 Thread Fredrik Lundh
Arun Nair wrote: > Hey paul i dont know how to implement this stuff if you have any ebook > or any notes which can halp me then i would like to try it and > implement my and refer back to you for any errors comming out of it http://wiki.python.org/moin/BeginnersGuide -- http://mail.python.

Re: question about True values

2006-10-26 Thread John Coleman
Donn Cave wrote: > In article <[EMAIL PROTECTED]>, > "John Coleman" <[EMAIL PROTECTED]> wrote: > > > Very good point, though one could argue perhaps that when one is > > comparing an object with a truth value then one is implicitly asking > > for the truth value of that object > > On the contrary

Re: To remove some lines from a file

2006-10-26 Thread Roberto Bonvallet
Sebastian Busch wrote: > The task is: > > "Remove the first two lines that don't begin with "@" from a file." awk 'BEGIN {c = 0} c < 2 && !/^@/ {c += 1; next} {print}' < mybeautifulfile -- Roberto Bonvallet -- http://mail.python.org/mailman/listinfo/python-list

Error to be resolved

2006-10-26 Thread Arun Nair
Hey guys can you help me resolve this error Thanks & Regards, Arun Nair This is the program from random import * from string import * class Card: def __init__(self, suit, rank): self.suit = suit self.ran

Re: question about True values

2006-10-26 Thread Steve Holden
John Coleman wrote: > Donn Cave wrote: > >>In article <[EMAIL PROTECTED]>, >> "John Coleman" <[EMAIL PROTECTED]> wrote: >> >> >>>Very good point, though one could argue perhaps that when one is >>>comparing an object with a truth value then one is implicitly asking >>>for the truth value of that o

Re: The format of filename

2006-10-26 Thread Neil Cerutti
On 2006-10-26, Tim Roberts <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> wrote: >> >>Some experimentation shows that Python does seem to provide >>*some* translation. Windows lets me use '/' as a path separator, >>but not as the name of the root of a partition name. But perhaps >>th

Re: Error to be resolved

2006-10-26 Thread Fredrik Lundh
Arun Nair wrote: >self.rank = rank >self.rank = ["None","Clubs","Diamonds","Hearts","Spades"] hint: what's "self.rank" after you've executed the above? -- http://mail.python.org/mailman/listinfo/python-list

problem using subprocess.call

2006-10-26 Thread Alex Kachanov
Hi! running py module with the following code from shell: __ dir=os.path.join(os.path.expanduser("~/domains/domain.com/html"),'test') subprocess.call(['find',dir+" -name '*.zip' -execdir unzip {} \;"]) __ returns: __ find: /home/clients/alex291_ftp0/domains/domain.com/html/test -name '*.zi

Re: The format of filename

2006-10-26 Thread Fredrik Lundh
Neil Cerutti wrote: > Seriously, experiments show the forward slash is OK as a > seperator, it just can't be root. do you think you can figure out why, even without reading the various MSDN pages you've been pointed to ? -- http://mail.python.org/mailman/listinfo/python-list

Re: The format of filename

2006-10-26 Thread Neil Cerutti
On 2006-10-26, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> Seriously, experiments show the forward slash is OK as a >> seperator, it just can't be root. > > do you think you can figure out why, even without reading the > various MSDN pages you've been pointed to ? Too late. P

Re: Error to be resolved

2006-10-26 Thread Arun Nair
These is the latest with the changes made: = from random import * from string import * class Card: def __init__(self, suit, rank): self.suit = suit self.rank = rank self.suit = [

Re: problem using subprocess.call

2006-10-26 Thread Fredrik Lundh
Alex Kachanov wrote: > running py module with the following code from shell: > __ >dir=os.path.join(os.path.expanduser("~/domains/domain.com/html"),'test') >subprocess.call(['find',dir+" -name '*.zip' -execdir unzip {} \;"]) subprocess.call(["find", dir, "-name", "*.zip", "-execdir",

Re: Error to be resolved

2006-10-26 Thread Bruno Desthuilliers
Arun Nair wrote: > Hey guys can you help me resolve this error > > Thanks & Regards, > > Arun Nair > This is the program > > from random import * > from string import * Avoid the from XXX import * idiom whenever possible. B

subprocess-how to suppress the stdout

2006-10-26 Thread alf
Hi, I use subprocess to execute another program but need to suppress its stdout. I can achieve it by using Popen(...,stdout=subprocess.PIPE,...) but wonder where the all stdout actually goes. Is it buffered (to eventually fill up)or just discarded? Or there is a better solution ... Thx, alf --

Re: Error to be resolved

2006-10-26 Thread Fredrik Lundh
Arun Nair wrote: >self.suit = suit >self.rank = rank >self.suit = ["None","Clubs","Diamonds","Hearts","Spades"] >self.rank = ["zero", "Ace", "2", "3", "4", "5", "6", "7", "8", "9", > "10", "Jack", "Queen", > "King"] hint: what happens if two variables have the sa

displaying \n-less prompts in a pythonic way

2006-10-26 Thread alf
Hi, I have a command line program which also does some interaction with the user using stdin and stdout. My requirement is to print prompt so the user can answer in the same line. Unfortunately: print 'enter command:', does not really work as the comma is carried over to the following line

http://tipc.sourceforge.net support

2006-10-26 Thread alf
Hi, I did my homework and researched the net - can not find the python support for TIPC. Does anybody know if there are plans to implement it? -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: problem using subprocess.call

2006-10-26 Thread Alex Kachanov
>> >> dir=os.path.join(os.path.expanduser("~/domains/domain.com/html"),'test') >>subprocess.call(['find',dir+" -name '*.zip' -execdir unzip {} \;"]) > >subprocess.call(["find", dir, "-name", "*.zip", "-execdir", "unzip", > "{}", ";"]) Ok, thanks, it works. But what's the difference? Why

Re: subprocess-how to suppress the stdout

2006-10-26 Thread Fredrik Lundh
"alf" <[EMAIL PROTECTED]> wrote: > I can achieve it by using Popen(...,stdout=subprocess.PIPE,...) but > wonder where the all stdout actually goes. Is it buffered (to eventually > fill up) it ends up in a pipe buffer, yes. > Or there is a better solution ... /dev/null is your friend: Popen

Re: problem using subprocess.call

2006-10-26 Thread Fredrik Lundh
Alex Kachanov wrote: >>subprocess.call(["find", dir, "-name", "*.zip", "-execdir", "unzip", >> "{}", ";"]) > > Ok, thanks, it works. > But what's the difference? Why I can't pass all parameters as one string? because there's no one around to split them up for you. after all, that's the whol

Re: displaying \n-less prompts in a pythonic way

2006-10-26 Thread Sybren Stuvel
alf enlightened us with: > I have a command line program which also does some interaction with the > user using stdin and stdout. > > My requirement is to print prompt so the user can answer in the same > line. Unfortunately: > > print 'enter command:', > > > does not really work as the comma i

Re: subprocess-how to suppress the stdout

2006-10-26 Thread alf
Fredrik Lundh wrote: > "alf" <[EMAIL PROTECTED]> wrote: > > >>I can achieve it by using Popen(...,stdout=subprocess.PIPE,...) but >>wonder where the all stdout actually goes. Is it buffered (to eventually >>fill up) > > > it ends up in a pipe buffer, yes. > > >>Or there is a better solution .

Re: What's the best IDE?

2006-10-26 Thread Colin J. Williams
Josh Bloom wrote: > I'm not going to call it the 'best' ide as thats just silly. > > But if your developing on Windows pyscripter > http://mmm-experts.com/Products.aspx?ProductId=4 is a great IDE. > > -Josh > +1 Colin W. -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the best IDE?

2006-10-26 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > After researching Komodo, I found it's not free. The only funds I have > are a college fund, and I can't start diping into that until I'm going > to college. Any free AND good IDEs? > PyScripter has already been suggested. It is both of these. Colin W. -- http://mail

PythonMagic - has any body played with it recently

2006-10-26 Thread alf
Hi, I downloaded the latest found version and untared it - but can not find any information how to install it. I guess it is boost based ... Has any body played with it recently? -- alf -- http://mail.python.org/mailman/listinfo/python-list

my first software

2006-10-26 Thread [EMAIL PROTECTED]
I am a beginner of programming and started to learn Python a week ago. last 3 days, i write this little tool for Renju.if you have any advice on my code,please tell me ps:sorry for my poor english bow. #!C:\\Python25 # -*- coding: GBK -*- from Tkinter import * import os import tkFileDialog import

Re: Debugging

2006-10-26 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Wednesday 25 October 2006 06:13, Bruno Desthuilliers wrote: > The bp #1 should only trigger if y >= 6 This give me the right point. > > Supposing to have a function on program's variables the stateme

Re: Handling emails

2006-10-26 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Wednesday 25 October 2006 13:06, Dennis Lee Bieber wrote: > # based upon bits from the (Active)Python 2.4 help system and other > code... OK, good help, Thank you. As I had confessed, that code was

Re: python html 2 image (png)

2006-10-26 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote: > Whatever lunix is, […] An operating system for the Commodore 64. `LUnix NG` Website: http://lng.sourceforge.net/ :-) Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: The format of filename

2006-10-26 Thread Tim Chase
>> Some experimentation shows that Python does seem to provide >> *some* translation. Windows lets me use '/' as a path separator, >> but not as the name of the root of a partition name. But perhaps >> this a peculiarity of the commands themselves, and not of Windows >> path names in particular. >>

Re: Debugging

2006-10-26 Thread Ben Finney
Fulvio <[EMAIL PROTECTED]> writes: > *** > Your mail has been scanned by InterScan MSS. > *** Please stop sending messages with obnoxious headers like this. -- http://mail.python.org/mailman/listinfo/python-list

Re: return tuple from C to python (extending python)

2006-10-26 Thread Kiran
Farshid Lashkari wrote: > Simon Forman wrote: > > I have not done a great deal of extension work with python, however, I > > do not believe you can simply cast an int (or pointer to int, which is > > what you say dat is declared as, unless my C is /really/ rusty) to > > PyObject*. > > > > I think

Re: Get coordinates of a cell

2006-10-26 Thread [EMAIL PROTECTED]
I will give it a try if you have source code so that I can test it.. https://sourceforge.net/project/showfiles.php?group_id=156455&package_id=202823 http://www.dexrow.com Teja wrote: > I have a GUI application with a Frame and a grid in it. I want to popup > a menu after the user enters some tex

Re: Handling emails

2006-10-26 Thread Ben Finney
Fulvio <[EMAIL PROTECTED]> writes: > *** > Your mail has been scanned by InterScan MSS. > *** Please stop sending messages with obnoxious headers like this. -- http://mail.python.org/mailman/listinfo/python-list

Re: displaying \n-less prompts in a pythonic way

2006-10-26 Thread bearophileHUGS
Sybren Stuvel: > def prompt(label): > '''Prompts the user, returning the typed text''' > sys.stdout.write(label) > return sys.stdin.readline() Maybe raw_input function may help too. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: chained attrgetter

2006-10-26 Thread David S.
Ah, pretty Python. Thanks, all. -- http://mail.python.org/mailman/listinfo/python-list

Re: Handling emails

2006-10-26 Thread Steve Holden
Ben Finney wrote: > Fulvio <[EMAIL PROTECTED]> writes: > > >>*** >>Your mail has been scanned by InterScan MSS. >>*** > > > Please stop sending messages with obnoxious headers like this. > Please stop sending messages with obnoxious content like this. I

Re: displaying \n-less prompts in a pythonic way

2006-10-26 Thread Steve Holden
Sybren Stuvel wrote: > alf enlightened us with: > >>I have a command line program which also does some interaction with the >>user using stdin and stdout. >> >>My requirement is to print prompt so the user can answer in the same >>line. Unfortunately: >> >> print 'enter command:', >> >> >>does

doesnt seems to work can any help be provided

2006-10-26 Thread Arun Nair
import string class Card: # Not sure if I need to set these first??? # suitList = () # rankList = () def __init__(self,suit,rank): self.suit = suit self.rank = rank def __repr__(self): return str(self) def __str__(self): return "%s of %s"

Re: Can any one help with solving this program it just doesnt take probability of the second team

2006-10-26 Thread Paul McGuire
"Arun Nair" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > ''' Can anyone help me with this program it just takes probability of > the first team and runs the program doesnt takes the probability of the > second team even though specified''' > > from random import * > > def volleySi

Re: iterator idea

2006-10-26 Thread Duncan Booth
Paul Rubin wrote: ... > For example, the annoyance means itertools.takewhile consumes an extra > element with no reasonable way to retrieve it. ... > >def is_even(n): return (n%2 == 0) >def is_odd(n): return (n%2 != 0) > ># we want to do something with all

Re: question about True values

2006-10-26 Thread skip
Skip> string "" Skip> list[] Skip> tuple () Skip> dict{} Skip> int 0 Skip> float 0.0 Skip> complex 0j Skip> set set()

Re: iterator idea

2006-10-26 Thread Paul Rubin
Duncan Booth <[EMAIL PROTECTED]> writes: > I wouldn't agree that there is no way reasonable way to get the terminating > value with takewhile, you just need another generator or two: Hmm, I hadn't thought about iterator.send. I'll have to look at that more carefully and re-read the PEP. -- http

Re: doesnt seems to work can any help be provided

2006-10-26 Thread Bruno Desthuilliers
Arun Nair wrote: > import string You don't need it. Use "some string".split() instead > class Card: class Card(object): > # Not sure if I need to set these first??? Not only do you need to define them, but it would probably be a good idea to populate them. And BTW, () is a tuple, not a lis

Re: doesnt seems to work can any help be provided

2006-10-26 Thread Fredrik Lundh
Bruno Desthuilliers wrote: > Please take a few minutes to read this: > http://catb.org/esr/faqs/smart-questions.html or better, check if the the academic misconduct rules for the university you're attending happens to say anything about "collusion". -- http://mail.python.org/mailman/listin

Re: doesnt seems to work can any help be provided

2006-10-26 Thread Steve Holden
Arun Nair wrote: [stuff] You will find people are willing to help, even sometimes with homework questions, when questioners show some evidence that they are looking to learn rather than simply to have their problems solved for them. regards Steve -- Steve Holden +44 150 684 7255 +1 80

Re: doesnt seems to work can any help be provided

2006-10-26 Thread Grant Edwards
On 2006-10-26, Arun Nair <[EMAIL PROTECTED]> wrote: > import string > > class Card: Could you please keep this homework assignment in a single thread in order to make it easier to ignore for those of us who don't want to work on this particular homework problem for you? If not, then you're likely

Re: Slightly OT: Is pyhelp.cgi documentation search broken?

2006-10-26 Thread jim-on-linux
On Thursday 26 October 2006 04:01, you wrote: > Hi! > > For a number of days I haven't been able to > search the online python docs at: > > http://starship.python.net/crew/theller/pyhelp. >cgi > Joel, Try here, [EMAIL PROTECTED] jim-on-linux http://www.inqvista.com > that is the "search the

Re: question about True values

2006-10-26 Thread Steven D'Aprano
On Wed, 25 Oct 2006 19:19:59 +, John Salerno wrote: > Oh!!! I get it now! I was thinking that > > if s > > was the same as > > if s == True No. But you know that now :) > because I know sometimes you can write if statements this way (though > it's wordy). You can, but shouldn't. > Bu

Re: cleaner way to write this?

2006-10-26 Thread John Salerno
Steve Holden wrote: > I suspect you need to use a validator so the user can't click OK until > they've put a value int eh text entry item. wow, didn't think of that. that might end up being simpler than anything else i've considered! :) -- http://mail.python.org/mailman/listinfo/python-list

Re: cleaner way to write this?

2006-10-26 Thread John Salerno
Paul Rubin wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >>> But if the user doesn't enter any text, I don't want the method to >>> return at all (even None). >> John, please re-read the FineManual(tm). None is the default return >> value of a function - even if there's no return stateme

Re: What's the best IDE?

2006-10-26 Thread John Salerno
[EMAIL PROTECTED] wrote: > as I have yet to try Vim - maybe I'll try tomarrow. Warning: Vim isn't something you just "try tomorrow" :) -- http://mail.python.org/mailman/listinfo/python-list

Re: subprocess-how to suppress the stdout

2006-10-26 Thread Fredrik Lundh
alf wrote: >> /dev/null is your friend: >> >> Popen(..., stdout=open("/dev/null", "w"), stderr=subprocess.STDOUT, ...) >> > > I am forced to use win32 :-( plus it needs to be platform independent ... alright, os.devnull is your friend: Popen(..., stdout=open(os.devnull, "w"), stderr=subpr

Re: What's the best IDE?

2006-10-26 Thread Neil Cerutti
On 2006-10-26, John Salerno <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> as I have yet to try Vim - maybe I'll try tomarrow. > > Warning: Vim isn't something you just "try tomorrow" :) You can become proficient enough for basic editing in about 20 minutes with the built-in tutorial.

[ANN] IronPython Community Edition r3

2006-10-26 Thread Sanghyeon Seo
This is the third release of IronPython Community Edition (IPCE). Get it here. http://sparcs.kaist.ac.kr/~tinuviel/download/IPCE-r3.zip This release is also available on SourceForge mirrors near you. http://sourceforge.net/projects/fepy IPCE has a homepage. You can read about licenses and patche

Debugging/Networking ?s.

2006-10-26 Thread Michael B. Trausch
I am having a little bit of trouble figuring out what to do about a problem that I am having with the program I am working with. I had it working yesterday, and up through till this morning. I hadn't thought about putting it in version control until now, so whatever it was I did, I can't just hit

  1   2   3   >