[Tutor] Compiling a program ::Embedding Python in C

2007-02-12 Thread Shadab Sayani
Hi, I have a C program mm.c calling python function as follows:: #include "Python.h" #include int main(int argc, char* argv[]) { double answer = 0; PyObject *modname, *mod, *mdict, *func, *stringarg, *args, *rslt; Py_Initialize(); modname = PyString_FromString("Test")

Re: [Tutor] telnet read_until problems

2007-02-12 Thread Bob Gailer
Chris Hallman wrote: > > I've written a program that tests ISDN dial backup at 1,000 locations. > I've broken up the logic into server functions within a threading > class (i.e. logon, get interfaces, get dial string, etc.). At 999 > locations, the following code extract the first of three dial

[Tutor] Accessing installed windows software from python

2007-02-12 Thread Jalil
I was wondering if its possible to go about writing a code to find out all the installed program on a windows machines. Basically everything under Add Remove Programs in the control panel. ___ Tutor maillist - Tutor@python.org http://mail.python.org/

[Tutor] Geolocating objects

2007-02-12 Thread Terry Carroll
anil maran was asking about determining distances between two US zip codes. I pointed him to a couple resources, but just for the fun of it, tried my hand at it. As far as I know, this actually works: from math import radians, sin, asin, cos, sqrt, atan2 class ZCTA: """ class for ea

Re: [Tutor] telnet read_until problems

2007-02-12 Thread Alan Gauld
"Chris Hallman" <[EMAIL PROTECTED]> wrote > I've written a program that tests ISDN dial backup at 1,000 > locations. I've > broken up the logic into server functions within a threading class > (i.e. > logon, get interfaces, get dial string, etc.). At 999 locations, the > following code extract

[Tutor] telnet read_until problems

2007-02-12 Thread Chris Hallman
I've written a program that tests ISDN dial backup at 1,000 locations. I've broken up the logic into server functions within a threading class (i.e. logon, get interfaces, get dial string, etc.). At 999 locations, the following code extract the first of three dial strings: def GetDialString(se

Re: [Tutor] How to pass a large list to another object?

2007-02-12 Thread Rikard Bosnjakovic
On 2/12/07, Hazlett, Les <[EMAIL PROTECTED]> wrote: > If I pass a large list via a parameter, there will be two copies of the > list. No. You pass a *reference* to the list, not the list itself. >>> a = [1,2,3,4] >>> b = a >>> b is a True >>> id(b), id(a) (1075562604, 1075562604) >>> b = [1,2,3,

Re: [Tutor] How to pass a large list to another object?

2007-02-12 Thread Kent Johnson
Hazlett, Les wrote: > Hello, > > I just joined the list. I have searched the archives unsuccessfully > trying to learn how to approach my problem. So I have 2 questions - > > 1) How can I best pass a large list to another object? Just pass it. Python does not pass parameters by value. Th

[Tutor] How to pass a large list to another object?

2007-02-12 Thread Hazlett, Les
Hello, I just joined the list. I have searched the archives unsuccessfully trying to learn how to approach my problem. So I have 2 questions - 1) How can I best pass a large list to another object? 2) How could I have found related discussion with a search of the archives?

Re: [Tutor] Random Number Randrange

2007-02-12 Thread Alan Gauld
<[EMAIL PROTECTED]> wrote > When I use the function random.randrange(x,y) I never get the upper > limit y > in the list. I've tried the range 1,3 and never get 3. If I choose > 1,4 I > get 3 but never 4. Is the upperlimit actually >> print range(1,3) [1,2] HTH, Alan G.

[Tutor] Random Number Randrange

2007-02-12 Thread [EMAIL PROTECTED]
When I use the function random.randrange(x,y) I never get the upper limit y in the list. I've tried the range 1,3 and never get 3. If I choose 1,4 I get 3 but never 4. Is the upperlimit actually ___ Tutor maillist - Tutor@python.org http://mail.pyt