Python CGI Script

2005-10-02 Thread Efrat Regev
Hello, I'm a data-structures course TA trying to write a python CGI script for automatically compiling and testing students' projects. Unfortunately, I've run into some questions while writing this, which I couldn't solve with the various (and helpful) python-CGI documentation. (It's

Newbie Question on ctypes

2005-09-20 Thread Efrat Regev
Hello, (I apologize in advance if I'm posting to the wrong group. If so, could you please instruct me which is appropriate?) I'm trying to use uTidyLib, HTML-tidy's python binding. When I import tidy Python says it can't import ctypes. Since I'm using FC4, I looked for a FC4 ctype

Python in Makefile Question

2005-02-11 Thread Efrat Regev
Hello, I'd like to ask a question concerning a python script in a makefile. Suppose I have a C++ project (sorry for raising this in a Python newsgroup), with some makefile for it. Before compiling the code, I'd like to check that there are no C++ convention violations (e.g., identifiers be

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

Q: Portable Way to Make Files Read Only

2005-02-13 Thread Efrat Regev
Hello, I would like to recurse through a directory and make files (which match a specific criteria) read only. From searching the Internet, I found http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303343 which shows how to change file attributes to read only using the win32api m

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'

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: 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 > >

HC Library and *attributes parameter

2005-03-11 Thread Efrat Regev
Hello, I'm a really new (and quite bad) Python programmer. While trying to use the HC HTML-Generating library, I couldn't figure out how to set a table's width to some given width. Moreover, the constructors interface is def __init__(self, object = None, align = None, border = None, cellspaci

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

One-step multiples list generation?

2006-01-03 Thread Efrat Regev
Hello, 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? E.g., something like [Foo * 20] (which is obviously not the right way) that would create [Foo, Foo, Foo, ...,Foo]. I tried looking through the

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 >

Python and location of .so files?

2006-01-10 Thread Efrat Regev
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 hello.so in that directory, then from the python prompt I can 'import hello', and the code works fine). The problem is that

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

Calling GNU/make from a Python Script

2006-10-30 Thread Efrat Regev
Hello, I need to call GNU/make from within a Python script. This raised some problems: 1. The script is not in the directory of the makefile, and changing the locations of either is not an option. Consequently, the makefile fails, since it can't find the targets/dependencies. 2. After sea

Re: Error in following code

2007-06-21 Thread Efrat Regev
[EMAIL PROTECTED] wrote: > Im working with python2.2 on red hat linux. > The following program is supposed to print decreasing numbers from an > entered number till 1, each decrement being = 1 : > > #! usr/bin/env/python > > def f(n=int(raw_input("enter number: "))): > print 'n=',n > if

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

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 >>

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 >>>

Fastest Way To Iterate Over A Probability Simplex

2007-05-22 Thread Efrat Regev
Hello, Let's say a probability vector of dimension d is x_1, ..., x_d, where each one is a non-negative term, and they all sum up to 1. Now I'd like to iterate over all probability vectors, but this is impossible, since they're uncountable. So instead, let's say I want to iterat

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

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

2007-03-23 Thread Efrat Regev
Hello, I'm trying to write something that will translate Python code to pseudo-code (for teaching purposes). Googling around indicated that the compiler module is pertinent, especially creating a visitor to walk the generated AST: http://docs.python.org/lib/module-compiler.html