Re: read/write to java socket in python

2007-11-28 Thread Dave Baum
Your server program is using readLine(), which will block until a newline is received. The server code does not write a newline, so it is waiting at recv() for data from the server, and the server is still waiting for a newline. If you change the client to do the following, it should work: s

Re: Discover instance variables

2007-07-18 Thread Dave Baum
In article <[EMAIL PROTECTED]>, JonathanB <[EMAIL PROTECTED]> wrote: > I can handle the formatting and changing the variable itself, no > problem, but how do I get a list of all the variables in a class > instance? I almost put a list in there called vars and appended all > the variables to it so

Re: Can a low-level programmer learn OOP?

2007-07-14 Thread Dave Baum
In article <[EMAIL PROTECTED]>, Chris Carlen <[EMAIL PROTECTED]> wrote: > Why would OOP be better? Different is not better. Popular is not > better. What the academics say is not better. Less lines of code might > be better, if the priority is ease of programming. Or, less machine > execu

Re: Function parameter type safety?

2007-07-13 Thread Dave Baum
In article <[EMAIL PROTECTED]>, Robert Dailey <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a way to force a specific parameter in a function to be a > specific type? For example, say the first parameter in a function of > mine is required to be a string. If the user passes in an integer, I > wa

Re: Tuple vs List: Whats the difference?

2007-07-12 Thread Dave Baum
In article <[EMAIL PROTECTED]>, Shafik <[EMAIL PROTECTED]> wrote: > Hello folks, > > I am an experienced programmer, but very new to python (2 days). I > wanted to ask: what exactly is the difference between a tuple and a > list? I'm sure there are some, but I can't seem to find a situation > wh

Re: "assert" annoyance

2007-06-23 Thread Dave Baum
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > > What I really want is for any assertion failure, anywhere in the > program, to trap to the debugger WITHOUT blowing out of the scope > where the failure happened, so I can examine the local frame. That > just seems

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-22 Thread Dave Baum
In article <[EMAIL PROTECTED]>, kaens <[EMAIL PROTECTED]> wrote: > On 6/20/07, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > > That is exactly the problem - there is no "some more" static typing. > > There is static typing - or not. You can't have it "just a bit". > > Couldn't a language be m

Re: List sequential initialization

2007-06-13 Thread Dave Baum
In article <[EMAIL PROTECTED]>, HMS Surprise <[EMAIL PROTECTED]> wrote: > I thought if I could do this: > >>> a = b = '' a and b refer to the same object (the empty string) > >>> a = 'a' You are assigning a new value to a - it now refers to the string 'a', while b refers to the same thing it

Re: What is an instance and what isn't?

2007-05-25 Thread Dave Baum
In article <[EMAIL PROTECTED]>, "Gre7g Luterman" <[EMAIL PROTECTED]> wrote: > I suppose I was lulled into complacency by how Python makes so many things > look like classes, but I'm starting to realize that they're not, are they? > > I'm writing a C program which handles Python objects in diffe

Re: A few questions

2007-05-22 Thread Dave Baum
In article <[EMAIL PROTECTED]>, jay <[EMAIL PROTECTED]> wrote: > Hi, > > I'm totally new to Python and was hoping someone might be able to > answer a few questions for me: > > 1. What are your views about Python vs Perl? Do you see one as > better than the other? I introduced Python into

Re: newb: Python Module and Class Scope

2007-05-11 Thread Dave Baum
In article <[EMAIL PROTECTED]>, johnny <[EMAIL PROTECTED]> wrote: > Can a class inside a module, access a method, outside of class, but > inside of the module? > > Eg. Can instance of class a access main, if so how? What is the > scope of "def main()" interms of class A? > > myModule: > > cl

Re: Simulating simple electric circuits

2007-05-10 Thread Dave Baum
In article <[EMAIL PROTECTED]>, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Sounds more familiar than the analog approach. Maybe I misunderstood > something ... but I can't transfer my problem to this way of > thinking yet. My biggest problem is the fact that relays aren't > really interes

Re: Simulating simple electric circuits

2007-05-08 Thread Dave Baum
In article <[EMAIL PROTECTED]>, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm trying to simulate simple electric logic (asynchronous) > circuits. By "simple" I mean that I only want to know if I > have "current" or "no current" (it's quite digital) and the only > elements

Re: Project organization and import

2007-03-06 Thread Dave Baum
In article <[EMAIL PROTECTED]>, "Martin Unsal" <[EMAIL PROTECTED]> wrote: > That too... although I think that's unfortunate. If reload() were > reliable, would you use it? Do you think it's inherently unreliable, > that is, it couldn't be fixed without fundamentally breaking the > Python language