Re: Error in following code

2007-06-21 Thread Efrat Regev
else: print 'end' return 1 if __name__ == '__main__': n = int(raw_input("enter number: ")) f(n) The line (if __name__...) means that if the interpreter is running your module the way you mean here, then it should

Re: Fastest Way To Iterate Over A Probability Simplex

2007-05-22 Thread Efrat Regev
[EMAIL PROTECTED] wrote: > On May 22, 11:19 am, Efrat Regev: >> I want to iterate over all >> such vectors under the constraint that the granularity of >> each component is at most some delta. > > You can think of this like your sum is an integer>=1 and the single

Fastest Way To Iterate Over A Probability Simplex

2007-05-22 Thread Efrat Regev
def __iter__(self): ... def next(self): ... The problem is, what's a fast implementation? I tried something simple, and it is slow. If anyone can think of something clever, I'd love to hear it.

Re: Grabbing the output of a long-winded shell call (in GNU/Linux)

2007-05-01 Thread Efrat Regev
Diez B. Roggisch wrote: > Efrat Regev schrieb: >> [EMAIL PROTECTED] wrote: >>> On May 1, 2:23 pm, Efrat Regev <[EMAIL PROTECTED]> wrote: >>> >>>> So my question is if there's a way to "grab" the output as it's being >>>

Re: Grabbing the output of a long-winded shell call (in GNU/Linux)

2007-05-01 Thread Efrat Regev
[EMAIL PROTECTED] wrote: > On May 1, 2:23 pm, Efrat Regev <[EMAIL PROTECTED]> wrote: > >> So my question is if there's a way to "grab" the output as it's being >> generated. It doesn't matter if the solution is blocking (as opposed to >>

Grabbing the output of a long-winded shell call (in GNU/Linux)

2007-05-01 Thread Efrat Regev
Hello, Suppose I want to run from within a Python GUI app some long-output shell call. For example, from within Python I might want to call g++ foo.cpp I already know there are many ways to do this, e.g., commands.getstatusoutput('g++ foo.cpp') to name one. The problem is that thi

Compiler-AST-Walk-Visitor: Any Examples or Documentation?

2007-03-23 Thread Efrat Regev
006-July/392716.html Any help is appreciated. Thanks and Bye, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Calling GNU/make from a Python Script

2006-10-30 Thread Efrat Regev
After searching around, it seems that os.system(..) should be avoided if there's an alternative. Is there one in this case? Many Thanks! Efrat -- http://mail.python.org/mailman/listinfo/python-list

Thanks to DSA Q. Repliers (was: Re: Questions on Using Python to Teach Data Structures...)

2006-09-28 Thread efrat
efrat wrote: > Hello, > > I'm planning to use Python in order to teach a DSA (data structures > and algorithms) course ... Hello, Many thanks, repliers, for the informative and useful answers. Bye, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread efrat
e visitor pattern seems impossible. Python is such a cool language - I'm really hoping the students will enjoy it as much as I do. Once again, many thanks for helping out with this. Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread efrat
e visitor pattern seems impossible. Python is such a cool language - I'm really hoping the students will enjoy it as much as I do. Once again, many thanks for helping out with this. Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Python Module for Determining CPU Freq. and Memory?

2006-04-06 Thread efrat
ython help(), I searched for moudles cpu, but non were found. (Please note: I'm interested in hardware stuff, like how much memory the machine has; not how much free memory is available.) Many Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and location of .so files?

2006-01-10 Thread Efrat Regev
Carsten Haese wrote: > On Tue, 2006-01-10 at 09:42, Efrat Regev wrote: > >> Hello, >> >> On FC4, I've generated an .so file from C++ which I want to use from >>python. It works when I copy it into /usr/lib/python2.4/site-packages. >>(I.e., say I have

Python and location of .so files?

2006-01-10 Thread Efrat Regev
ossible that this question belongs in a different forum, and if so, I'd appreciate if you'd tell me where. Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Re: One-step multiples list generation?

2006-01-03 Thread Efrat Regev
Damien Wyart wrote: > * Efrat Regev <[EMAIL PROTECTED]> in comp.lang.python: > >>Suppose I have some non-numerical Foo and would like to create a list >>of 20 Foo-s. Is there a one-step method (not a loop) of doing so? > > > Maybe : > > [ Foo ] * 20 >

One-step multiples list generation?

2006-01-03 Thread Efrat Regev
docs, FAQs and help, but couldn't find anything (the closest is range, but it seems it's only for numerics) - I very much appreciate your time in answering. Also, please excuse me if I used some wrong terminology. Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Python CGI Script

2005-10-02 Thread Efrat Regev
word for doing this, therefore. Suppose I place the password inside a python script, and give this script only +x permission for others. Is this adequate as far as security? Thanks in advance for answering these questions. Efrat -- http://mail.python.org/mailman/listinfo/python-list

Newbie Question on ctypes

2005-09-20 Thread Efrat Regev
hanks in advance for all answers. I should point out that I'm not an expert in python or linux (in the combination, alas, even less). Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Re: HC Library and *attributes parameter

2005-03-11 Thread Efrat Regev
"Efrat Regev" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > ... Many thanks for the useful replies!! -- http://mail.python.org/mailman/listinfo/python-list

HC Library and *attributes parameter

2005-03-11 Thread Efrat Regev
, border = None, cellspacing = None, cellpaddding = None, *attributes) So, what does *attribute stand for (being a C++ programmer, it looks like a pointer, probably not the case). Is it like the C++ ellipsis? If so, how can I use it? Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Modules for Various Internet Protocols?

2005-02-24 Thread Efrat Regev
"Kartic" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Efrat Regev wrote: > > Hello, > > > > I was wondering whether there are any Python > Erfat...yes...batteries included! > > http://docs.python.org/lib/internet.html > >

Python Modules for Various Internet Protocols?

2005-02-24 Thread Efrat Regev
Hello, I was wondering whether there are any Python modules for various Internet protocols, e.g., is there something similar to import ftp client = ftpopen(...) and so on. Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic poker client

2005-02-14 Thread Efrat Regev
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > My PC finally went belly up last week and I'm looking forward to > playing with my new Mac. However, I play a bit of online poker, and > there is no Mac client for my poker room. > > Ideally, instead of running Virtual PC, I'

Q: Portable Way to Make Files Read Only

2005-02-13 Thread Efrat Regev
module. That's great, but I was hoping there's a more portable way to do so. Is there a more portable API call to make files read only? Many Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list

Re: Python in Makefile Question

2005-02-11 Thread Efrat Regev
"Efrat Regev" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I'd like to ask a question concerning a python script in a makefile. > ... Many thanks for the very useful (and very quick) answers! Efrat -- http://mail.p

Python in Makefile Question

2005-02-11 Thread Efrat Regev
e python script to return a value to make, so that if it decides that there are convention violations make will fail? 2. How can I pass information from the makefile to the python script, e.g., the base directory to check? Thanks, Efrat -- http://mail.python.org/mailman/listinfo/python-list