Re: Ironpython book?

2006-04-17 Thread BartlebyScrivener
>> Who's "the ruling hierarchy"? I guess I just meant the congnoscenti. Them that knows what's what. >> I'm a Mac fan, with Linux a close second I suspected. I've played with Linux distros, but never a Mac. That takes more $$ than M$, and Apple is even more proprietary than MS, if you ask me. It

Re: Ironpython book?

2006-04-17 Thread Alex Martelli
Jay Parlar <[EMAIL PROTECTED]> wrote: ... > > I don't know of any such books, but if M$ is willing to slip me a > > suitable sweetener (to make it worth my while to install Windows again ... > Q: "So Alex, what are you doing with your 20% time at Google right now?" > A: "Working for Microsoft

Re: Ironpython book?

2006-04-17 Thread Alex Martelli
BartlebyScrivener <[EMAIL PROTECTED]> wrote: > Alex: > > So is the ruling hierarchy all using the UNIX command line on Mac OSX? > Free BSD? Linux? I'm a struggling novice. I'm just curious. Uh? Who's "the ruling hierarchy"? If you're talking about the PSF, I guess Linux, overall, may hold the

How do you guys print out a binary tree?

2006-04-17 Thread Anthony Liu
There are many ways to represent a binary tree on an ascii screen. 1 / \ 2 3 / \ / \ 4 5 6 7 or 4---2---1 | | 56- 3 | 7 Suppose I have a function that takes a matrix like this one:

Re: PEP 359: The "make" Statement

2006-04-17 Thread Tim Hochberg
Carl Banks wrote: > Tim Hochberg wrote: > >>Carl Banks wrote: >> >>>Mike Orr wrote: >>> >>> >I think this PEP is going off the rails. It's primary virtue was that it was a simpler, clearer way to write: class Foo(args): __metaclass__ = some_metaclass

Re: Ironpython book?

2006-04-17 Thread Heiko Wundram
Am Dienstag 18 April 2006 05:03 schrieb [EMAIL PROTECTED]: > it seems like there are some new language > features added to handle some quirks with working within the CLR. > Although I could be wrong. I'm no Microsoft friend (let me begin by saying that), but I don't think I'm very paranoid if I c

Re: PEP 359: The "make" Statement

2006-04-17 Thread Carl Banks
Tim Hochberg wrote: > Carl Banks wrote: > > Mike Orr wrote: > > > >>>I think this PEP is going off the rails. It's primary virtue was that it > >> > >>was a simpler, clearer way to write: > >> > >> class Foo(args): > >>__metaclass__ = some_metaclass > >>#... > >> > >>And it doe

Re: Ironpython book?

2006-04-17 Thread BartlebyScrivener
Alex: So is the ruling hierarchy all using the UNIX command line on Mac OSX? Free BSD? Linux? I'm a struggling novice. I'm just curious. rick -- http://mail.python.org/mailman/listinfo/python-list

Re: Ironpython book?

2006-04-17 Thread Jay Parlar
On Apr 17, 2006, at 8:58 PM, Alex Martelli wrote: > > I don't know of any such books, but if M$ is willing to slip me a > suitable sweetener (to make it worth my while to install Windows again > after years of blissfully Windows-free existence: it must at least > cover > the expense of the extra

Re: Missing interfaces in Python...

2006-04-17 Thread Jonathan Daugherty
# My real-world experience with Java is very dated -- nowadays, I'm # told, the NEED to cast is vastly reduced by Java 1.5's "generics" (I # haven't yet written one line of Java 1.5, not even for "play" # purposes, much less "real world" ones;-). Interesting; thanks. # So much for "compiler enfor

Re: PEP 359: The "make" Statement

2006-04-17 Thread Tim Hochberg
Carl Banks wrote: > Mike Orr wrote: > >>>I think this PEP is going off the rails. It's primary virtue was that it >> >>was a simpler, clearer way to write: >> >> class Foo(args): >>__metaclass__ = some_metaclass >>#... >> >>And it doesn't even do that. What's wrong with "class

Re: Ironpython book?

2006-04-17 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Anyone know if there is a book for Ironpython in the works? A good > knowledge of .NET and Python is enough to get started but just poking > around Ironpython homepage it seems like there are some new language > features added to handle some quirks with working within

Re: Missing interfaces in Python...

2006-04-17 Thread Alex Martelli
Jonathan Daugherty <[EMAIL PROTECTED]> wrote: > # "parser"...?! If you have an 'Object o', say one just received as an > # argument, and cast it to IBlahble, a la > # > # IBlahble blah = (IBlahble) o; > # > # ...what can the parser ever say about it? > > Maybe you didn't read the "I think"

Re: Ironpython book?

2006-04-17 Thread BartlebyScrivener
I'll let somebody jump in and say, "You're crazy!" But it seems to me the interest in IronPython on this list is pretty subdued. Maybe because most people are running on Linux or Macs? Here's a thread http://groups.google.com/group/comp.lang.python/browse_thread/thread/2762f6dfc5f72651/ I would

Re: Slicing matrix

2006-04-17 Thread Anthony Liu
Hi, James, I just realized that my English is so good that I can joke with slangs. Hopefully it isn't that offensive. Otherwise, I am sorry. --- James Stroud <[EMAIL PROTECTED]> wrote: > Anthony Liu wrote: > > I figure it out, too. NumArray is so flexible, > it's > > like cutting the cheese.

Re: Slicing matrix

2006-04-17 Thread Alex Martelli
Robert Kern <[EMAIL PROTECTED]> wrote: ... > array([[ 0, 1, 2, 3, 4], >[ 5, 6, 7, 8, 9], >[10, 11, 12, 13, 14], >[15, 16, 17, 18, 19], >[20, 21, 22, 23, 24]]) > > > How do I easily slice out [0,1,2] > > In [7]: p[0, :3] > Out[7]: array([0, 1, 2]) > > >

Re: Slicing matrix

2006-04-17 Thread James Stroud
Anthony Liu wrote: > I figure it out, too. NumArray is so flexible, it's > like cutting the cheese. Some idioms do not translate so well. -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com/ -- http://mail.python.org/mai

Ironpython book?

2006-04-17 Thread alacrite
Anyone know if there is a book for Ironpython in the works? A good knowledge of .NET and Python is enough to get started but just poking around Ironpython homepage it seems like there are some new language features added to handle some quirks with working within the CLR. Although I could be wrong.

Re: Slicing matrix

2006-04-17 Thread Anthony Liu
Hi, Robert, Thanks a lot. I figure it out, too. NumArray is so flexible, it's like cutting the cheese. You can cut it anyway you want. I really like NumArray. --- Robert Kern <[EMAIL PROTECTED]> wrote: > Anthony Liu wrote: > > I am using numarray. > > I will be using numpy for this post,

Reducing memory overhead for dictionaries by removing precomputed hash

2006-04-17 Thread kirat . singh
Forgive me if this has already been discussed, but it seems to me that one could reduce the memory usage of dictionaries by 2/3 by removing the precomputed hash in each bucket. Since Dictionaries only allow immutable objects as keys, one could move the precomputed hash into the keys. * Strings ar

Re: Missing interfaces in Python...

2006-04-17 Thread Jonathan Daugherty
# "parser"...?! If you have an 'Object o', say one just received as an # argument, and cast it to IBlahble, a la # # IBlahble blah = (IBlahble) o; # # ...what can the parser ever say about it? Maybe you didn't read the "I think" in my OP. Anyway, you clearly know more about (or have more r

Re: Slicing matrix

2006-04-17 Thread Robert Kern
Anthony Liu wrote: > I am using numarray. I will be using numpy for this post, and if you are new to numarray, then you should probably skip it and use numpy instead. All new development is going towards numpy. http://numeric.scipy.org/ > Suppose I have > p = array(range(25), shape=(5,5))

Re: PEP 359: The "make" Statement

2006-04-17 Thread Carl Banks
Mike Orr wrote: > > I think this PEP is going off the rails. It's primary virtue was that it > was a simpler, clearer way to write: > > class Foo(args): > __metaclass__ = some_metaclass > #... > > And it doesn't even do that. What's wrong with "class Foo: > __metaclass__ = bla

Re: Java Developer Exploring Python

2006-04-17 Thread Roy Smith
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Alex Martelli) wrote: > Consider for example that one of the additions to Python 2.5 (currently > in alpha stage) is the inclusion in the Python standard library of > ctypes Indeed, I think the inclusion of ctypes is far and away the most exci

Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)

2006-04-17 Thread Alex Martelli
gangesmaster <[EMAIL PROTECTED]> wrote: ... > but anyway, it's stupid. why be a dick? those who *really* want to get > to the source will be able to, no matter what you use. after all, the > code is executing on their CPU, and if the CPU can execute it, so > can really enthused men. and those wh

Re: Missing interfaces in Python...

2006-04-17 Thread Alex Martelli
Jonathan Daugherty <[EMAIL PROTECTED]> wrote: > # enforced by whom, at what point ? > > In the case of Java, I think the JVM enforces interface implementation > (probably at the parser level). "parser"...?! If you have an 'Object o', say one just received as an argument, and cast it to IBlahble

Re: Java Developer Exploring Python

2006-04-17 Thread Alex Martelli
Ravi Teja <[EMAIL PROTECTED]> wrote: > >> I've traditionally been a Java developer, although I play around with LISP. > > For most java developers, understanding dynamic typing is a big step. > Your Lisp background however would mean that you will pick up Python > very quickly. Very good point.

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-17 Thread Alex Martelli
Aahz <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: > >Aahz <[EMAIL PROTECTED]> wrote: > >> > >> Method resolution order is the primary up-front difference, but > >> introspective code can also have problems. > > > >The crucial difference

Slicing matrix

2006-04-17 Thread Anthony Liu
I am using numarray. Suppose I have >>> p = array(range(25), shape=(5,5)) >>> p array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19], [20, 21, 22, 23, 24]]) How do I easily slice out [0,1,2] or [1,2,3] or [2,7,12] or [7,12,17]

Re: A 'Box' Function

2006-04-17 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The word-wrapping function I'm working with is I have never used this, but it might help you >>> import textwrap >>> dir(textwrap) ['TextWrapper', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__revision__', '_white

freakin out over C++ module in python

2006-04-17 Thread nephish
lo there all ! i have a huge delima, i have to be able to connect to a data server and recieve info from it. The servers software guys release some visual C++ modules that one can incorporate into a visual C++ project. Which is great, but i am developing in linux, and only am very familliar with p

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread skip
Kun> assuming that my date column is 2, how would i parse out the date? No parsing required. Just get its date: d = record[2].date() The str() of a datetime.date object is a string in -MM-DD form. Kun> the example you gave is of you parsing out the current time, but Kun> h

Re-creating a Tkinter mainloop()

2006-04-17 Thread [EMAIL PROTECTED]
Hi, I am trying to run a Tkinter application in a thread and it works pretty well to an extent. However, when I try to recreate the application after the thread exits, the new application never shows up. The code below the message explains what I am trying. On running this, you should see a simpl

A 'Box' Function

2006-04-17 Thread mikelaskey
Hey guys. I should warn you, first off, that I'm relatively new to Python. Basically, what I'm trying to do is create a word-wrapping function with the added complication that it add a character at the beginning and end of each line, so that it encloses the text in a sort of 'box': --

Schedule

2006-04-17 Thread Fetofs Ashu
I want to create a work schedule; I will have to input some names (in alphabetical order) and the days they can't be working because they have a license, are in vacation or are doing special services. Then, using that information, the program would assign, from a Monday specified onwards, from tw

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Kun
Tim Chase wrote: >> for col in range(0, numcols): >> print "", record[col], "" > > This is the point at which you want to intercept the column data and > make your change: > > print "", str(record[col]).replace("00:00:00.0", ""), " > If it's possible/plausible that other fie

Freeze without a binary

2006-04-17 Thread imdognuts
I want to use freeze to create the .o's to then include in a library that will be distributed. When I use freeze it creates a binary and a main, and the main calls some frozenmain func. Obviously I dont want a main() in this code. Do I need to extract the code that was generated by freeze in main

Re: PEP 359: The "make" Statement

2006-04-17 Thread Mike Orr
> I think this PEP is going off the rails. It's primary virtue was that it was a simpler, clearer way to write: class Foo(args): __metaclass__ = some_metaclass #... And it doesn't even do that. What's wrong with "class Foo: __metaclass__ = blah"? Two lines of code, and the

a flattening operator?

2006-04-17 Thread gangesmaster
as we all know, * (asterisk) can be used to "inline" or "flatten" a tuple into an argument list, i.e.: def f(a, b, c): ... x = (1,2,3) f(*x) so... mainly for symmetry's sake, why not make a "flattening" operator that also works outside the context of function calls? for example: a = (1,2,3)

Re: Missing interfaces in Python...

2006-04-17 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm coming from a Java background, so please don't stone me... Most of us came to Python from some other language background ;-) > I see that Python is missing "interfaces". As someone else noted, Python objectively does not have 'i

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Kun
[EMAIL PROTECTED] wrote: > Kun> i have the following python-cgi which extracts data from a mysql > Kun> table, how do i parse the date so that it doesn't display the time > Kun> '00:00:00.00'? > > I have no idea which column in your table is a datetime object, but just > convert it to

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Tim Chase
> for col in range(0, numcols): > print "", record[col], "" This is the point at which you want to intercept the column data and make your change: print "", str(record[col]).replace("00:00:00.0", ""), "%s" % foo or alternatively DATECOLUMNS = [3, 14] for col

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread skip
Kun> i have the following python-cgi which extracts data from a mysql Kun> table, how do i parse the date so that it doesn't display the time Kun> '00:00:00.00'? I have no idea which column in your table is a datetime object, but just convert it to a date. For example: >>> impor

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Kun
Fredrik Lundh wrote: > "Kun" wrote: > >> because in my sql database, the date is only 'date' (as in -mm-dd), >> only when i extract it with my python-cgi does the date turn into >> (-mm-dd 00:00:00.00), thus i figured the best way to fix this >> problem is to parse it after the matter. >

Re: Threading problem

2006-04-17 Thread Aleksandar Cikota
Thank You, but now it cannot open a file, but it should work... Here the error message: >>> Exception in thread Thread-1: Traceback (most recent call last): File "C:\Program Files\Python\lib\threading.py", line 442, in __bootstrap self.run() File "G:\Robot teleskop\VRT\test\test2.py", line

Re: python to c API, passing a tuple array

2006-04-17 Thread imdognuts
Thanks for the solution! Farshid Lashkari wrote: > [EMAIL PROTECTED] wrote: > > Hi, > > I want to pass something like this to a C function via the Python C > > API. > > mytuple = (("string_one", 1.2, 1.3), ("string_two", 1.4, 1.5), .., > > ., ) > > This tuple is dynamic in size, it needs

Re: Missing interfaces in Python...

2006-04-17 Thread Serge Orlov
Jonathan Daugherty wrote: > # so with interfaces, missing methods will suddenly appear out of thin > # air ? > > With interfaces, the idea is that they're enforced; so, they'll appear > because someone implements them. But if you're writing tests you will check method signatures anyway, so why bo

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Fredrik Lundh
"Kun" wrote: > because in my sql database, the date is only 'date' (as in -mm-dd), > only when i extract it with my python-cgi does the date turn into > (-mm-dd 00:00:00.00), thus i figured the best way to fix this > problem is to parse it after the matter. you still make no sense. why n

ANN: the experimental python faq wiki

2006-04-17 Thread Fredrik Lundh
encouraged by the great response to the python tutorial wiki, I've set up another semi-open wiki for the Python FAQ: http://pyfaq.infogami.com/ the immediate goal is to get the FAQ ready for the 2.5 release, by using the wiki to collect comments. for more on future plans, see this page:

Re: Missing interfaces in Python...

2006-04-17 Thread Roy Smith
<[EMAIL PROTECTED]> wrote: > I see that Python is missing "interfaces". The concept of an interface > is a key to good programming design in Java, but I've read that they > aren't really necessary in Python. I am wondering what technique I can > use in Python to get the same benefits to a program d

Re: Missing interfaces in Python...

2006-04-17 Thread I V
Jonathan Daugherty wrote: > Except when you need to handle exceptions when those methods don't > exist. I think interfaces can definitely be useful. I think I see what you mean, but that's an odd way to put it. Typically, you aren't going to handle the exceptions produced by type errors. Of cours

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Kun
Fredrik Lundh wrote: > "Kun" wrote: > >> I have a python-cgi file that pulls data from an sql database, i am >> wondering what is the easiest way to remove all instances of >> '00:00:00.00' in my date column. >> >> how would i write a python script to scan the entire page and delete all >> instanc

Re: Missing interfaces in Python...

2006-04-17 Thread Larry Bates
[EMAIL PROTECTED] wrote: > I'm coming from a Java background, so please don't stone me... > > I see that Python is missing "interfaces". The concept of an interface > is a key to good programming design in Java, but I've read that they > aren't really necessary in Python. I am wondering what techn

Re: Missing interfaces in Python...

2006-04-17 Thread I V
[EMAIL PROTECTED] wrote: > I see that Python is missing "interfaces". The concept of an interface > is a key to good programming design in Java, but I've read that they > aren't really necessary in Python. I am wondering what technique I can > use in Python to get the same benefits to a program de

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Fredrik Lundh
"Kun" wrote: > I have a python-cgi file that pulls data from an sql database, i am > wondering what is the easiest way to remove all instances of > '00:00:00.00' in my date column. > > how would i write a python script to scan the entire page and delete all > instances of '00:00:00.00', would i us

Re: Missing interfaces in Python...

2006-04-17 Thread Egon Frerich
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Have a look at Zope 3. (http://www.zope.org/DevHome/Wikis/DevSite/Projects/ComponentArchitecture/FrontPage). It has an interface implementation. You can use this implementation with the apllication server Zope 3 or alone. Regards, Egon [EMAIL PROTECT

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Larry Bates
Kun wrote: > I have a python-cgi file that pulls data from an sql database, i am > wondering what is the easiest way to remove all instances of > '00:00:00.00' in my date column. > > how would i write a python script to scan the entire page and delete all > instances of '00:00:00.00', would i use

Re: Missing interfaces in Python...

2006-04-17 Thread Benji York
Jonathan Daugherty wrote: > # Thanks for the responses...Looks like I might have opened Pandora's > # box here. Could I accomplish the above with an abstract class? > > Zope 3 has an interface system which is good. I recommend you look at > that. Zope 3's interface system is quite good, but it's

Re: Missing interfaces in Python...

2006-04-17 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > If the mechanic class had a "fixIt()" method defined, could I pass it > any object I wanted absolutely. > and then just call the method that I expect to find there yes. > or do I need to strictly define the type, or class, of an object that is > passed to a method.

Re: Threading problem

2006-04-17 Thread Faber
Aleksandar Cikota wrote: > How to integrate the Code-part in the main programm, so that the > mainprogramm works? > > Code: > > import win32com.client > import time > import os > import threading > > Document = win32com.client.Dispatch('MaxIm.Document') > Application = win32com.client.Dispatch(

Re: scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Tim Chase
> I have a python-cgi file that pulls data from an sql > database, i am wondering what is the easiest way to > remove all instances of '00:00:00.00' in my date column. > > how would i write a python script to scan the entire page > and delete all instances of '00:00:00.00', would i use > regular e

Re: Missing interfaces in Python...

2006-04-17 Thread Jonathan Daugherty
# Thanks for the responses...Looks like I might have opened Pandora's # box here. Could I accomplish the above with an abstract class? Zope 3 has an interface system which is good. I recommend you look at that. -- Jonathan Daugherty http://www.parsed.org -- http://mail.python.org/mailman/l

Re: Missing interfaces in Python...

2006-04-17 Thread Jonathan Daugherty
# enforced by whom, at what point ? In the case of Java, I think the JVM enforces interface implementation (probably at the parser level). -- Jonathan Daugherty http://www.parsed.org -- http://mail.python.org/mailman/listinfo/python-list

Re: Missing interfaces in Python...

2006-04-17 Thread redefined . horizons
Thanks for the responses...Looks like I might have opened Pandora's box here. Could I accomplish the above with an abstract class? If the mechanic class had a "fixIt()" method defined, could I pass it any object I wanted, and then just call the method that I expect to find there, or do I need to s

Re: Missing interfaces in Python...

2006-04-17 Thread Fredrik Lundh
Jonathan Daugherty wrote: > # so with interfaces, missing methods will suddenly appear out of thin > # air ? > > With interfaces, the idea is that they're enforced; so, they'll appear > because someone implements them. enforced by whom, at what point ? -- http://mail.python.org/mailman/list

Re: Missing interfaces in Python...

2006-04-17 Thread Jonathan Daugherty
# so with interfaces, missing methods will suddenly appear out of thin # air ? With interfaces, the idea is that they're enforced; so, they'll appear because someone implements them. -- Jonathan Daugherty http://www.parsed.org -- http://mail.python.org/mailman/listinfo/python-list

Re: piping question

2006-04-17 Thread Steve Bergman
Have you tried running python with '-u'? That turns off most buffering within python at least. I'm not familiar with newspost, so I've no idea what to do about any output buffering it might be doing. -- http://mail.python.org/mailman/listinfo/python-list

scanning through page and replacing all instances of 00:00:00.00

2006-04-17 Thread Kun
I have a python-cgi file that pulls data from an sql database, i am wondering what is the easiest way to remove all instances of '00:00:00.00' in my date column. how would i write a python script to scan the entire page and delete all instances of '00:00:00.00', would i use regular expressions?

Re: Missing interfaces in Python...

2006-04-17 Thread Fredrik Lundh
Jonathan Daugherty wrote_ > # In Python, you would simply call the functions you need. No need to > # make things that rigidly defined. > > Except when you need to handle exceptions when those methods don't > exist. I think interfaces can definitely be useful. so with interfaces, missing methods

Re: Missing interfaces in Python...

2006-04-17 Thread Jonathan Daugherty
# In Python, you would simply call the functions you need. No need to # make things that rigidly defined. Except when you need to handle exceptions when those methods don't exist. I think interfaces can definitely be useful. -- Jonathan Daugherty http://www.parsed.org -- http://mail.python

Re: Missing interfaces in Python...

2006-04-17 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > I see that Python is missing "interfaces". No it isn't. It just hasn't got them. > The concept of an interface is a key to good programming design in > Java, but I've read that they aren't really necessary in Python. > In Java I would accomplish this by

Re: Queue can result in nested monitor deadlock

2006-04-17 Thread Paul McGuire
"Jonathan Amsterdam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This is a reply to Alan Morgan, Paul McGuire and Duncan Booth. > > I need mutex M because I have other fields in my class that need to be > thread-safe. > > The reason I want to use a Queue and not a list is that a Q

Re: Socket Error: Connection Refused

2006-04-17 Thread Steve Horsley
[EMAIL PROTECTED] wrote: > Dear c.l.p, > > I have recently been doing the tutorial of Python and everything is > well, i'm upto the pass section. Anyway, when I try to launch idle now > I get the error message: Socket Error: Connection Refused. I do not > have a firewall, so I don't know what

Missing interfaces in Python...

2006-04-17 Thread redefined . horizons
I'm coming from a Java background, so please don't stone me... I see that Python is missing "interfaces". The concept of an interface is a key to good programming design in Java, but I've read that they aren't really necessary in Python. I am wondering what technique I can use in Python to get the

Re: XPath/Screen Scraping Gurus..

2006-04-17 Thread Steve Horsley
Peter Hansen wrote: > bruce wrote: >> I'm not that familiar with Pythin, but I wasn wondering if there are any >> XPath/Python Gurus that I might be able to talk to regarding screen >> scraping >> applications... > > Since you mention XPath, it seems likely you are really interested in > *web-sc

Re: Queue can result in nested monitor deadlock

2006-04-17 Thread Jonathan Amsterdam
This is a reply to Alan Morgan, Paul McGuire and Duncan Booth. I need mutex M because I have other fields in my class that need to be thread-safe. The reason I want to use a Queue and not a list is that a Queue has additional synchronization besides the mutex. For instance, Queue.get() will block

Re: MySql -python 1.2.1_p2 and visual c++ toolkit

2006-04-17 Thread simen . haugen
I tried mxODBC now, and it worked out of the box. Thanks for the tip! -- http://mail.python.org/mailman/listinfo/python-list

Re: Java Developer Exploring Python

2006-04-17 Thread redefined . horizons
Ravi Teja wrote: > >> I've traditionally been a Java developer, although I play around with LISP. > > For most java developers, understanding dynamic typing is a big step. > Your Lisp background however would mean that you will pick up Python > very quickly. > > >> I recently migrated to Linux and

Re: How do I use Code Context under Options in IDLE?

2006-04-17 Thread Phoe6
[EMAIL PROTECTED] wrote: > --- > Code Context -- Open a pane at the top of the edit window which > shows the block context of the section of code > which is scrolling off the top or the window. > > But what does that actually mean? > > Take this code fragment example (with line numbers added > for

Re: Why new Python 2.5 feature "class C()" return old-style class ?

2006-04-17 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: >Aahz <[EMAIL PROTECTED]> wrote: >> >> Method resolution order is the primary up-front difference, but >> introspective code can also have problems. > >The crucial difference between the old-style classes and the new ones >

Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)

2006-04-17 Thread Serge Orlov
[EMAIL PROTECTED] wrote: > How can a proprietary software developer protect their Python code? > People often ask me about obfuscating Python bytecode. They don't want > people to easily decompile their proprietary Python app. > > I suppose another idea is to rewrite entire Python app in C if com

Dr. Dobb's Python-URL! - weekly Python news and links (Apr 17)

2006-04-17 Thread Peter Otten
QOTW: "Discussion about Python 3000 is heating up. What I haven't seen so far is a list of things that will be dropped from the language to make room for new ideas." - Greg Wilson "The longer I work at writing software, the more I come to appreciate that people are the hardest thing to figure out.

piping question

2006-04-17 Thread Biggmatt
I forgot to add that i'm running ubuntu with python 2.4, and the imports are: import os import pygtk pygtk.require('2.0') import gtk import gtk.glade -- http://mail.python.org/mailman/listinfo/python-list

Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)

2006-04-17 Thread gangesmaster
well, you can do something silly: create a c file into which you embed your code, ie., #include char code[] = "print 'hello moshe'"; void main(...) { Py_ExecString(code); } then you can compile the C file into an object file, and use regular obfuscators/anti-debuggers. of course people who

Threating problem

2006-04-17 Thread Aleksandar Cikota
Hi all, I have a problem with threading. The following part should be running in a main programm all the time, but so that the main programm also works (like 2 seperate programms, but in one) How to integrate the part in the main programm? Code: import win32com.client import time import os imp

Threading problem

2006-04-17 Thread Aleksandar Cikota
Hi all,   I have a problem with threading. The following part should be running in a main programm all the time, but so that the main programm also works (like 2 seperate programms, but in one) How to integrate the Code-part in the main programm, so that the mainprogramm works?   Code:   impo

Re: C FFI: easy conversion from list to argv?

2006-04-17 Thread Burton Samograd
Burton Samograd <[EMAIL PROTECTED]> writes: > I'm trying to update the fuse python bindings to my app and I was > curious if there were any C utility functions that would turn a > sys.argv into a C style argv array, or am I going to have to write > those myself? Following up to myself again...foun

piping question

2006-04-17 Thread Biggmatt
I have been working on a little frontend for newspost. It runs newspost just fine and gets it's output. The problem is that i want it to get the stdout as the program runs, not hold it all till it's finished. I've tried a few variations of popen , and others with no luck. Here is the subroutine th

Re: MySql -python 1.2.1_p2 and visual c++ toolkit

2006-04-17 Thread BartlebyScrivener
I'm pretty new myself. But if you don't get anywhere using mysql-python, I can recommend mxODBC. I have connected to both MS Access DB and MySQL DB. You get it from: http://www.egenix.com/files/python/mxODBC.html But read the instructions carefully as I think there are two things to install. If

Re: Queue can result in nested monitor deadlock

2006-04-17 Thread Alan Morgan
In article <[EMAIL PROTECTED]>, Jonathan Amsterdam <[EMAIL PROTECTED]> wrote: >If you don't want to call it deadlock, fine, but the program execution >I describe will make no progress to the end of time. Thread 2 can never >put anything in the queue, because Thread 1 holds M, and Thread 1 will >nev

socket timeout error?

2006-04-17 Thread Jaap Spies
Hi, Running Fedora Core 4: Python 2.4.3 and Python 2.4.1. I'm getting: IOError: [Errno socket error] (2, 'No such file or directory') all the time. Trying to track down this problem: Python 2.4.1 (#1, May 16 2005, 15:19:29) [GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2 Type "help", "copyright

Re: Decode html, or is it unicode, how?

2006-04-17 Thread Ben C
On 2006-04-17, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote: > Hi All, > I've done a bunch of searching in google and in python's help, but, > I haven't found any function to decode a string like: > Refresh! (ihenvyr) > In to plain english. > [...] I needed to do that the other day, and did it li

Re: Queue can result in nested monitor deadlock

2006-04-17 Thread Terry Reedy
"Jonathan Amsterdam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > As I'm new to the Python community, I'm not sure that this is the right > forum for this suggestion. Is it the sort of thing one would put on the > SourceForge bug list? Advice appreciated. As a sometimes bug revi

Re: Queue can result in nested monitor deadlock

2006-04-17 Thread Paul McGuire
"Jonathan Amsterdam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If you don't want to call it deadlock, fine, but the program execution > I describe will make no progress to the end of time. Thread 2 can never > put anything in the queue, because Thread 1 holds M, and Thread 1 wil

C FFI: easy conversion from list to argv?

2006-04-17 Thread Burton Samograd
Hi, I'm trying to update the fuse python bindings to my app and I was curious if there were any C utility functions that would turn a sys.argv into a C style argv array, or am I going to have to write those myself? Thanks. -- burton samograd kruhft .at. gmail kru

Re: How protect proprietary Python code? (bytecode obfuscation?, what better?)

2006-04-17 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How can a proprietary software developer protect their Python code? > People often ask me about obfuscating Python bytecode. They don't want > people to easily decompile their proprietary Python app. > > I suppose another idea is to r

Re: Fixing Python instalation in win2000 by hand

2006-04-17 Thread BartlebyScrivener
>> the reason I can't move to brand new installation is because I am missing >> sound drivers. If I were you, I'd download the latest ActiveState version of Python from: http://www.activestate.com/Products/ActivePython/ I would install it from c:\ Who cares about sound drivers if all you want

Re: Queue can result in nested monitor deadlock

2006-04-17 Thread Duncan Booth
Jonathan Amsterdam wrote: > If you don't want to call it deadlock, fine, but the program execution > I describe will make no progress to the end of time. Thread 2 can never > put anything in the queue, because Thread 1 holds M, and Thread 1 will > never release M because that can only happen if so

Re: How do I use Code Context under Options in IDLE?

2006-04-17 Thread [EMAIL PROTECTED]
Phoe6 wrote: > Hi all, >I have this Code Context feature under Options in the IDLE. > How should I use it? Are there folks here who use it regularly and find > it useful. > Please guide me. Well, you could start by looking at the Help: Options Menu: Configure IDLE -- Open a configura

Re: Fixing Python instalation in win2000 by hand

2006-04-17 Thread Sambo
> > c:\temp1>msiexec /I c:\temp1\python-2.4c1.msi /L*v install.log > /L*v ok here it is... before downloading and installin the VB > scripting crap.( in case it starts closing apps > trying to reboot and clear all this typing I've done hehe. > install.log > === Verbose logging started: 17/04

  1   2   >