Re: python + postgres psql + os.popen

2006-06-22 Thread Laszlo Nagy
damacy írta: > hello, everyone. > > i am trying to write a program which executes SQL commands stored in > .sql files. > > i wrote a function called psql() whose contents look like the > following. > > ... > os.popen(command) > file = os.popen(command, 'w') > file.write(password) > file.close() > .

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Pascal Costanza
David Hopwood wrote: > Marshall wrote: >> Chris Smith wrote: >>> Marshall <[EMAIL PROTECTED]> wrote: >>> I think what this highlights is the fact that our existing terminology is not up to the task of representing all the possible design choices we could make. Some parts of dynamic v

Re: What is a type error?

2006-06-22 Thread Pascal Costanza
Chris Smith wrote: > While this effort to salvage the term "type error" in dynamic languages > is interesting, I fear it will fail. Either we'll all have to admit > that "type" in the dynamic sense is a psychological concept with no > precise technical definition (as was at least hinted by Ant

Re: python + postgres psql + os.popen

2006-06-22 Thread Bruno Desthuilliers
damacy wrote: > hello, everyone. > > i am trying to write a program which executes SQL commands stored in > .sql files. > > i wrote a function called psql() whose contents look like the > following. > > ... > os.popen(command) > file = os.popen(command, 'w') > file.write(password) > file.close()

How to generate all permutations of a string?

2006-06-22 Thread Girish Sahani
Hi guys, I want to generate all permutations of a string. I've managed to generate all cyclic permutations. Please help :) def permute(string): l= [] l.append(string) string1 = '' for i in range(0,len(string)-1,1): string1 = string[1:len(string)] + string[:1] l.ap

Re: Is it possible to split a class definition?

2006-06-22 Thread Bruno Desthuilliers
[EMAIL PROTECTED] wrote: > Hi, > > Is it possible to split a Class definition over two or more text files? Yes, but not directly. Could you tell us why you think you have such a need ? > (if so, how:) Please answer my previous question first !-) -- bruno desthuilliers python -c "print '@'.joi

Re: wxPython GUI designer

2006-06-22 Thread Tim N. van der Leeuw
[EMAIL PROTECTED] wrote: > Are there any good commercial project built with wx ? I am a newbie and > a have to write a small application in Python. I was wondering which > optin would be best for me in terms of least learning curve and getting > the final product ASAP. > > Thanks > It's not a com

Re: tkMessagebox.askyesno always returns False

2006-06-22 Thread peter
It's a moderately large application, and so impractical to post it all. I'll have a go at isolating circumstances where this fault occurs then post the preceeding code - but not before this evening (London time) when I might have some free time. Peter -- http://mail.python.org/mailman/listinfo/

Re: Can PyObjC be used on shared Mac OS X hosting?

2006-06-22 Thread Diez B. Roggisch
weston schrieb: > Does anyone have experience with (or failing that, theoretical > knowledge about) installing using the PyObjC bridge on a Mac OS X > machine in a context where one doesn't have root/admin access (and > therefore can't install things in conventional locations)? Can such a > thing

Re: comparing two arrays

2006-06-22 Thread Sheldon
Thanks Diez, It will take a little while for this one to sink in but it gets the job done now and will for future cases. /Sheldon Diez B. Roggisch skrev: > >> print [i for i, _ in enumerate((None for x, y in zip(a, b) where x == > >> y))] > >> > >> instead. > >> > >> Diez > > > > Hi Diez, > > >

Re: comparing two arrays

2006-06-22 Thread Sheldon
Thanks Diez, It will take a little while for this one to sink in but it gets the job done now and will for future cases. /Sheldon Diez B. Roggisch skrev: > >> print [i for i, _ in enumerate((None for x, y in zip(a, b) where x == > >> y))] > >> > >> instead. > >> > >> Diez > > > > Hi Diez, > > >

OverflowError: math range error...

2006-06-22 Thread Sheldon
Hi, I have a written a script that will check to see if the divisor is zero before executing but python will not allow this: if statistic_array[0:4] > 0.0: statistic_array[0,0:4] = int(multiply(divide(statistic_array[0,0:4],statistic_array \ [0,4]),1.0))/100.0 Does anyone know why Python is

Re: How to generate all permutations of a string?

2006-06-22 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Girish Sahani" <[EMAIL PROTECTED]> wrote: > I want to generate all permutations of a string. def permute(Seq) : """generator which yields successive permutations of the elements of Seq.""" if len(Seq) == 0 : yield () else : for i

Re: Cycles between package imports

2006-06-22 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, "Martin Blais" <[EMAIL PROTECTED]> wrote: >On 18 Jun 2006 05:25:14 -0700, John Roth <[EMAIL PROTECTED]> wrote: > >> The general rule is: don't do that. It doesn't work, and the >> hoops you have to go through to force it to work are so >> complex and bizzare that t

Re: 10GB XML Blows out Memory, Suggestions?

2006-06-22 Thread cavallo71
> > I wrote a program that takes an XML file into memory using Minidom. I > > found out that the XML document is 10gb. > > > > I clearly need SAX or something else? If the data is composed by a large number of records, like a database dump of some sort, then probably you could have a look to a sta

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread ilitzroth
> A statically type language requires you to think about two models of > your program at the same time: the static type model and the dynamic > behavioral model. A static type system ensures that these two > _different_ (that's important!) perspectives are always in sync. I have trouble understa

Help req: Problems with MySQLdb

2006-06-22 Thread rodmc
I have written an application that connects to a database on a remote machine which uses MySQLdb 1.2.0. The application works perfectly when connecting to the database from a remote machine, however when it attempts to connect to a database on the same machine a connection error is generated. I hav

Re: How to generate all permutations of a string?

2006-06-22 Thread bayerj
Mind, that Lawrence's solution may contain doubles: >>> [ i for i in permute("aa") ] [('a', 'a'), ('a', 'a')] If you don't want this, use sets. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to generate all permutations of a string?

2006-06-22 Thread Girish Sahani
> In article <[EMAIL PROTECTED]>, > "Girish Sahani" <[EMAIL PROTECTED]> wrote: > >> I want to generate all permutations of a string. > > def permute(Seq) : > """generator which yields successive permutations of the elements > of Seq.""" > if len(Seq) == 0 : > yield () > el

Re: Python to PHP Login System (HTTP Post)

2006-06-22 Thread Jeethu Rao
You need to use httplib. http://docs.python.org/lib/httplib-examples.html Jeethu Rao -- http://mail.python.org/mailman/listinfo/python-list

Re: Help req: Problems with MySQLdb

2006-06-22 Thread rodmc
Hi, Thanks for your email. Well I am kind of new to exceptions in Python, but here is the code used below, as you can see it is somewhat basic. Is there a way to display more information about the exception? Best, rod try: #Exception handler for database queries db = MySQLdb.conn

Re: Problem on win xp and run time error

2006-06-22 Thread Michele Petrazzo
Chris Lambacher wrote: > On Sat, Jun 17, 2006 at 07:32:34AM +, Michele Petrazzo wrote: >> Chris Lambacher wrote: >>> On Fri, Jun 16, 2006 at 06:11:53PM +, Michele Petrazzo wrote: >>> Hi list, just found in this moment that my applications stop to work with win xp and receive thi

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
Marshall wrote: >Andreas Rossberg wrote: >>Chris Uppal wrote: >> >>>I have never been very happy with relating type to sets of values (objects, >>>whatever). >> >>Indeed, this view is much too narrow. In particular, it cannot explain >>abstract types, which is *the* central aspect of decent type sy

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
Rob Warnock wrote: > > Here's what the Scheme Standard has to say: > > http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-4.html > 1.1 Semantics > ... > Scheme has latent as opposed to manifest types. Types are assoc- > iated with values (also called objects) rath

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Pascal Costanza
[EMAIL PROTECTED] wrote: > > A statically type language requires you to think about two models of > >> your program at the same time: the static type model and the dynamic >> behavioral model. A static type system ensures that these two >> _different_ (that's important!) perspectives are always i

Re: Help req: Problems with MySQLdb

2006-06-22 Thread Bruno Desthuilliers
rodmc wrote: (top-post corrected) > Sybren Stuvel wrote: > >>rodmc enlightened us with: >> >>>--- it refuses to connect on the above line and the exception is >>>caught and a message displayed. >> >>So why do you think this exception and the error message contain >>no useful information at all

Re: How to generate all permutations of a string?

2006-06-22 Thread Maric Michaud
Le Jeudi 22 Juin 2006 10:07, Girish Sahani a écrit : > Hi guys, > I want to generate all permutations of a string. I've managed to > generate all cyclic permutations. Please help :) > Here is mine, maybe more versatile : def permute(iterable) : if len(iterable) == 1 : yield iterable e

bug in Makepy

2006-06-22 Thread Jim
I was trying to use Makepy to wrap a typelib, but couldn't find the one I wanted in the list of libs offered, and couldn't find a way to browse to a specific one. Turns out the reason was that the lib was version 10, which was listed in the registry in hex as version a.0. The tlb chooser in Makep

Re: How to generate all permutations of a string?

2006-06-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Girish Sahani <[EMAIL PROTECTED]> wrote: >Hi guys, > I want to generate all permutations of a string. I've managed to >generate all cyclic permutations. Please help :) > >def permute(string): >l= [] >l.append(string) >string1 = '' >for i in range(0,l

Re: What's the best way to wrap a whole script in try..except?

2006-06-22 Thread Hari Sekhon
On 21/06/06, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: Hari Sekhon wrote:> I want to wrap a whole script in try ... except. What is the best way of> doing this?>> Consider the following: ->> try:>import > >>>def notifyme(traceback):>   code to tell me there is a problem>> excep

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
Pascal Costanza wrote: > > Consider a simple expression like 'a + b': In a dynamically typed > language, all I need to have in mind is that the program will attempt to > add two numbers. In a statically typed language, I additionally need to > know that there must a guarantee that a and b will

upgrading python on virtual hosting server

2006-06-22 Thread Brian
Hello, I have a dedicated linux server with several virtual domains on it. These domains are chrooted for security. I need to upgrade python and be able to have it available for all accounts. I am also concerned that I may muck up some of the server processes that use python. Can someone tell m

smtplib problem for newbie

2006-06-22 Thread Noah Gift
Hi, I am writing a few different scripts that need to send email confirmation and I wanted to use smtplib instead of cheating and using os.system('mail -s "foo") Some of the examples I have seen don't seem to work for me. (Note, I am new to Python and probably doing something stupid...thanks

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Pascal Costanza
Andreas Rossberg wrote: > Pascal Costanza wrote: >> >> Consider a simple expression like 'a + b': In a dynamically typed >> language, all I need to have in mind is that the program will attempt >> to add two numbers. In a statically typed language, I additionally >> need to know that there must

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Pascal Bourguignon
Andreas Rossberg <[EMAIL PROTECTED]> writes: > Pascal Costanza wrote: >> Consider a simple expression like 'a + b': In a dynamically typed >> language, all I need to have in mind is that the program will >> attempt to add two numbers. In a statically typed language, I >> additionally need to know

Entity GUI tool?

2006-06-22 Thread icebear
Ubuntu Drake comes with or allows you to install something called "entity" which sounds like it ought to be the world's ultimate Python GUI tool. Nonetheless all I can get it to do looks like this: Usage: entity [-Vhm] [-g ] [-l ] [-a ] [file] -V Print version and e

Re: Entity GUI tool?

2006-06-22 Thread icebear
The ubuntu synaptic package manager claims: XML-based GUI builder for GTK+ Entity is an XML-based GUI builder and application scripting framework. It combines the ease of use of XML for GUI layout and the power of Perl, Python, TCL, JavaScript, and C for the applica

Re: bug in Makepy

2006-06-22 Thread Jim
> This only works if the hexadecimal representation has digits in [A-F]. > What if the stored value is 10, but in hexadecimal? I don't get what you mean. If the value is "10, but in hexadecimal", isn't that A? The problem my fix solves is where the folder under the typelib guid is named somethin

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Pascal Bourguignon
Pascal Costanza <[EMAIL PROTECTED]> writes: > Andreas Rossberg wrote: >> Pascal Costanza wrote: >>> >>> Consider a simple expression like 'a + b': In a dynamically typed >>> language, all I need to have in mind is that the program will >>> attempt to add two numbers. In a statically typed language

Re: smtplib problem for newbie

2006-06-22 Thread Noah Gift
It turns out it is a cgi issue. If I run this code outside of the cgi-bin it runs just fine. The webhosting company I am using allows python cgi code to run, but I might need to check with them about how it works. Does anyone have advice on python cgi vs. psp vs. python web application framework

Re: need all python dialog equivalent

2006-06-22 Thread Thomas Dickey
Eric S. Johansson <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> dialog binary is 110 KB. Won't it fit ? > missing library. I have ncurses and newt and dialog seems to require > something called ncursesw. I've been trying to find the Python newt "seems to require" if you're install

Re: returning index of minimum in a list of lists

2006-06-22 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Hi all, > Is there a simple python function to return the list index of the > minimum entry in a list of lists? > ie, for [[3,3,3,3], [3,3,3,1], [3,3,3,3]] to return 2,4. > Or, same question but just for a list of numbers, not a list of lists. > Thanks, > Josh Unteste

(Iron)Python on new MS robotics platform

2006-06-22 Thread George Sakkis
"Both remote (PC-based) and autonomous (robot-based) execution scenarios can be developed using a selection of programming languages, including those in Microsoft Visual Studio® and Microsoft Visual Studio Express languages (Visual C#® and Visual Basic® .NET), JScript® and Microsoft IronPython 1.0

Using Python as a web scripting language

2006-06-22 Thread Vlad Dogaru
Hello everyone,I am learning Python and have heard it can be used similarly to PHP for web scripting. Because I find the latter not entirely to my liking, I would like to use Python. How should I configure my web server, what do I need, where should I start at, etc. I realise this sort of question

Re: smtplib problem for newbie

2006-06-22 Thread Justin Azoff
Noah Gift wrote: [snip] > a = long(time.time() * 256) # use fractional seconds > TypeError: 'module' object is not callable Part of your program includes a file or directory that you called 'long'. You should not re-use names of built-ins in your programs.. they cause you to get errors like t

Registry of Methods via Decorators

2006-06-22 Thread bayerj
I want to make a registry of methods of a class during creation. My attempt was this """ classdecorators.py Author: Justin Bayer Creation Date: 2006-06-22 Copyright (c) 2006 Chess Pattern Soft, All rights reserved. """ class decorated(object): methods = [] @classmethod def collect

Feed wxComboBox with dictionary/hash

2006-06-22 Thread Roland Rickborn
Hi folks, I am relatively new to Python. Although I read a lot of howtos, introductions and wikis, I am still having trouble ;-) My querstion: As the subject says, I'd like to feed a wx.ComboBox with a dictionary/hash. According to the posting of Stano Paska ("wxComboBox <> combobox", 20 Jul. 200

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Matthias Blume
Pascal Bourguignon <[EMAIL PROTECTED]> writes: > Moreover, a good proportion of the program and a good number of > algorithms don't even need to know the type of the objects they > manipulate. > > For example, sort doesn't need to know what type the objects it sorts > are. It only needs to be giv

Re: How to generate all permutations of a string?

2006-06-22 Thread Anton Vredegoor
Girish Sahani wrote: > I want to generate all permutations of a string. I've managed to > generate all cyclic permutations. Please help :) http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496724 anton -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-06-22 Thread Matthias Blume
Pascal Costanza <[EMAIL PROTECTED]> writes: > Chris Smith wrote: > >> While this effort to salvage the term "type error" in dynamic >> languages is interesting, I fear it will fail. Either we'll all >> have to admit that "type" in the dynamic sense is a psychological >> concept with no precise te

Re: The code that could not be...

2006-06-22 Thread Steven Bethard
Alex A. Naanou wrote: > The object's __dict__ can only be a dict derivative and at that none of > the Python's mapping API will be used (the dict is accessed directly). [snip] > I wrote a patch some time back, it appears rather stable and is being > production tested. > > you can download it here:

Re: What is a type error?

2006-06-22 Thread Chris Smith
Pascal Costanza <[EMAIL PROTECTED]> wrote: > What about this: You get a type error when the program attempts to > invoke an operation on values that are not appropriate for this operation. > > Examples: adding numbers to strings; determining the string-length of a > number; applying a function o

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Marshall
Rob Warnock wrote: > Marshall <[EMAIL PROTECTED]> wrote: > > > > Can you be more explicit about what "latent types" means? > > I'm sorry to say it's not at all natural or intuitive to me. > > Are you referring to the types in the programmers head, > > or the ones at runtime, or what? > > Here's wha

Re: How to generate all permutations of a string?

2006-06-22 Thread Gerard Flanagan
Girish Sahani wrote: > Hi guys, > I want to generate all permutations of a string. I've managed to > generate all cyclic permutations. Please help :) > http://gflanagan.net/site/python/05/Johnson.html Gerard -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Marshall
Pascal Costanza wrote: > > A statically type language requires you to think about two models of > your program at the same time: the static type model and the dynamic > behavioral model. A static type system ensures that these two > _different_ (that's important!) perspectives are always in sync. T

Re: Registry of Methods via Decorators

2006-06-22 Thread Bruno Desthuilliers
bayerj wrote: > I want to make a registry of methods of a class during creation. My > attempt was this > > """ classdecorators.py > > Author: Justin Bayer > Creation Date: 2006-06-22 > Copyright (c) 2006 Chess Pattern Soft, > All rights reserved. """ > > class decorated(object): > > method

Re: Registry of Methods via Decorators

2006-06-22 Thread Steven Bethard
bayerj wrote: > I want to make a registry of methods of a class during creation. I think you're going to need a metaclass for this, e.g.:: >>> import inspect >>> def registered(func): ... func.registered = True ... return func ... >>> class RegisterFuncs(type): ... def __init__(cls

Re: Registry of Methods via Decorators

2006-06-22 Thread Maric Michaud
Hi, Le Jeudi 22 Juin 2006 15:32, bayerj a écrit : > I want to make a registry of methods of a class during creation. Why ? you already have them in dec2.__dict__ : In [42]: import types In [43]: class a : : def b(self) : return : @classmethod : def c(self) : retu

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Marshall
Andreas Rossberg wrote: > Marshall wrote: > > > > What prohibits us from describing an abstract type as a set of values? > > If you identify an abstract type with the set of underlying values then > it is equivalent to the underlying representation type, i.e. there is no > abstraction. I don't fol

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Chris Uppal
Andreas Rossberg wrote: [me:] > > It's worth noting, too, that (in some sense) the type of an object can > > change over time[*]. > > No. Since a type expresses invariants, this is precisely what may *not* > happen. If certain properties of an object may change then the type of > the object has to

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Chris Uppal
I wrote: > It would be interesting to see what a language designed specifically to > support user-defined, pluggable, and perhaps composable, type systems > would look like. Since writing that I've come across some thoughts by Gilad Bracha (a Name known to Java and Smalltalk enthusiasts alike) he

Re: What is a type error?

2006-06-22 Thread Chris Uppal
Chris Smith wrote: > Some people here seem to be > saying that there is a universal concept of "type error" in dynamic > typing, but I've still yet to see a good precise definition (nor a good > precise definition of dynamic typing at all). How about this, at least as a strawman: I think we're

Re: The code that could not be...

2006-06-22 Thread Fredrik Lundh
Alex A. Naanou wrote: > To mention several tasks that can be made trivial using this technique > are, for instance zope-like acquisitions, various ACLs, interfaces and > other namespace manipulation patterns. eh ? why not use Python's OO mechanisms for this, like everyone else is doing... --

Re: Registry of Methods via Decorators

2006-06-22 Thread Stephan Diehl
bayerj schrieb: > I want to make a registry of methods of a class during creation. My > attempt was this > > """ classdecorators.py > > Author: Justin Bayer > Creation Date: 2006-06-22 > Copyright (c) 2006 Chess Pattern Soft, > All rights reserved. """ > > class decorated(object): > > meth

Re: Feed wxComboBox with dictionary/hash

2006-06-22 Thread Iain King
Roland Rickborn wrote: > Hi folks, > > I am relatively new to Python. Although I read a lot of howtos, > introductions and wikis, I am still having trouble ;-) > > My querstion: > As the subject says, I'd like to feed a wx.ComboBox with a > dictionary/hash. According to the posting of Stano Paska

Re: Registry of Methods via Decorators

2006-06-22 Thread Duncan Booth
Stephan Diehl wrote: > replace '@collect_methods' with '@decorated.collect_methods' > and this will do what you want. That is unlikely as it will keep a single list of methods for all classes derived from decorated: calling decorated.collect_methods will pass decorated as the cls parameter. Wha

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Marshall
Pascal Costanza wrote: > > Consider a simple expression like 'a + b': In a dynamically typed > language, all I need to have in mind is that the program will attempt to > add two numbers. In a statically typed language, I additionally need to > know that there must a guarantee that a and b will alwa

Blog source code in Python

2006-06-22 Thread Lad
Is there a blog application source available in Python? Thank you for reply L. -- http://mail.python.org/mailman/listinfo/python-list

serial port servo control

2006-06-22 Thread boyle5
So I ordered a mini SSC II (the servo controller), in order to control some servos from the computer. I was hoping to use python to do the control but have two questions... 1) How should I write to the serial port with python? I found the module "pyserial": http://pyserial.sourceforge.net/ on the

Re: Blog source code in Python

2006-06-22 Thread Fredrik Lundh
Lad wrote: > Is there a blog application source available in Python? google down today? how many do you need ? http://newsbruiser.tigris.org/ http://pyblosxom.sourceforge.net/ http://wiki.python.org/moin/PythonBlogSoftware etc -- http://mail.python.org/mailman/listinfo/p

Re: serial port servo control

2006-06-22 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > So I ordered a mini SSC II (the servo controller), in order to > control some servos from the computer. I was hoping to use python to > do the control but have two questions... > > 1) How should I write to the serial port with python? I found the > module "pyserial":

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
Chris Uppal wrote: > >>>It's worth noting, too, that (in some sense) the type of an object can >>>change over time[*]. >> >>No. Since a type expresses invariants, this is precisely what may *not* >>happen. If certain properties of an object may change then the type of >>the object has to reflect t

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
Pascal Bourguignon wrote: > > For example, sort doesn't need to know what type the objects it sorts > are. It only needs to be given a function that is able to compare the > objects. Sure. That's why any decent type system supports polymorphism of this sort. (And some of them can even infer whi

Re: Blog source code in Python

2006-06-22 Thread Klaus Alexander Seistrup
Lazy Lad wrote: > Is there a blog application source available in Python? Several. Did you try Google before you posted your question? The search term "python blog" has within the first 10 hits. Cheers, -- Klaus Alexander Seistrup Copenhage

Re: serial port servo control

2006-06-22 Thread Richard Brodie
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 1) How should I write to the serial port with python? I found the > module "pyserial": I don't think there is any need to hunt for anything better. > In C I'd do this by sending 3 char's, as they're only 1 byte, > but i'm not exactl

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Rob Thorpe
Dr.Ruud wrote: > Rob Thorpe schreef: > > Dr.Ruud: > >> Marshall: > > >>> "dynamic types." I don't have a firm definition for > >>> that term, but my working model is runtime type tags. In which > >>> case, I would say that among statically typed languages, > >>> Java does have dynamic types, but C

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread John W. Kennedy
Rob Warnock wrote: > Another language which has *neither* latent ("dynamic") nor > manifest ("static") types is (was?) BLISS[1], in which, like > assembler, variables are "just" addresses[2], and values are > "just" a machine word of bits. 360-family assembler, yes. 8086-family assembler, not so m

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread rossberg
Darren New schrieb: > Andreas Rossberg wrote: > > AFAICT, ADT describes a type whose values can only be accessed by a > > certain fixed set of operations. > > No. AFAIU, an ADT defines the type based on the operations. The stack > holding the integers 1 and 2 is the value (push(2, push(1, empty()))

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Rob Thorpe
David Hopwood wrote: > Rob Thorpe wrote: > > Vesa Karvonen wrote: > > > >>In comp.lang.functional Anton van Straaten <[EMAIL PROTECTED]> wrote: > >> > >>>Let me add another complex subtlety, then: the above description misses > >>>an important point, which is that *automated* type checking is not t

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
Marshall wrote: >> >>>What prohibits us from describing an abstract type as a set of values? >> >>If you identify an abstract type with the set of underlying values then >>it is equivalent to the underlying representation type, i.e. there is no >>abstraction. > > I don't follow. Are you saying tha

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Darren New
[EMAIL PROTECTED] wrote: > Are you sure that you aren't confusing *abstract* with *algebraic* data > types? I've never heard of algebraic data types. It's always been "abstract data types". Perhaps I stopped studying it, and the terminology changed when many people started to consider encapsula

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Darren New
John W. Kennedy wrote: > 360-family assembler, yes. 8086-family assembler, not so much. And Burroughs B-series, not at all. There was one "ADD" instruction, and it looked at the data in the addresses to determine whether to add ints or floats. :-) -- Darren New / San Diego, CA, USA (PST)

Re: python + postgres psql + os.popen

2006-06-22 Thread Simon Forman
damacy wrote: > hello, everyone. ... > this works well. however, it does not show me any warning nor error > messages if there is one. for example, i am trying to create a table > which already exists in the database, it should show me a warning/error > message saying there already is one present i

Re: VPW: T-Shirt design contest

2006-06-22 Thread Brian Quinlan
Bruno Desthuilliers submitted this really cool rant/essay/something from Tim Lesher that I hadn't seen before. I think that the original source is: http://apipes.blogspot.com/2005/01/choose-python.html Choose Python. Choose readability. Choose the simple over the complex and the complex over the

Re: Feed wxComboBox with dictionary/hash

2006-06-22 Thread Simon Forman
Roland Rickborn wrote: > Hi folks, ... > As the subject says, I'd like to feed a wx.ComboBox with a > dictionary/hash. According to the posting of Stano Paska ("wxComboBox > <> combobox", 20 Jul. 2004), there seems to be a way to do this: > > > You must use something like > > combo.Append('aaa', 'a

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
Rob Thorpe wrote: > > Its easy to create a reasonable framework. Luca Cardelli has given the most convincing one in his seminal tutorial "Type Systems", where he identifies "typed" and "safe" as two orthogonal dimensions and gives the following matrix: | typed | untyped ---+

struct.unpack on 64-bit platforms

2006-06-22 Thread Nadav Samet
Hi, I am trying to unpack a 32-bit unsigned integer from a string using struct.unpack. so using string.unpack('L', data) would work fine on 32-bit systems, But apparently, on 64-bit platforms it tries to read 64-bit unsigned integer (since that's what the C Type unsigned long means on 64-bit pla

Re: struct.unpack on 64-bit platforms

2006-06-22 Thread Georg Brandl
Nadav Samet wrote: > Hi, > > I am trying to unpack a 32-bit unsigned integer from a string using > struct.unpack. > so using string.unpack('L', data) would work fine on 32-bit systems, > > But apparently, on 64-bit platforms it tries to read 64-bit unsigned > integer (since > that's what the C T

Re: tkMessagebox.askyesno always returns False

2006-06-22 Thread peter
I've managed to narrow down the circimstances in which the error occurs. The application is a file manager (not terribly original,I know, but my main purpose is to gain experience in using Tkinter). It displays the contents of a directory in a list box, and then applies the function (in this cas

Re: VPW: T-Shirt design contest

2006-06-22 Thread Bruno Desthuilliers
Brian Quinlan wrote: > Bruno Desthuilliers submitted this really cool rant/essay/something from > Tim Lesher that I hadn't seen before. I think that the original source is: > > http://apipes.blogspot.com/2005/01/choose-python.html > (snip) > I think that it might be a bit long to put on a T-Shir

Status of optional static typing in Python?

2006-06-22 Thread Christian Convey
Hi guys, I'm looking at developing a somewhat complex system, and I think some static typing will help me keep limit my confusion. I.e.: http://www.artima.com/weblogs/viewpost.jsp?thread=87182 Does anyone know if/when that feature may become part of Python? Thanks very much, Christian -- C

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Dimitri Maziuk
George Neuner sez: > On Wed, 21 Jun 2006 16:12:48 + (UTC), Dimitri Maziuk ><[EMAIL PROTECTED]> wrote: > >>George Neuner sez: >>> On Mon, 19 Jun 2006 22:02:55 + (UTC), Dimitri Maziuk >>><[EMAIL PROTECTED]> wrote: >>> Yet Another Dan sez: ... Requiring an array index to be an int

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Pascal Bourguignon
Matthias Blume <[EMAIL PROTECTED]> writes: > Pascal Bourguignon <[EMAIL PROTECTED]> writes: > >> Moreover, a good proportion of the program and a good number of >> algorithms don't even need to know the type of the objects they >> manipulate. >> >> For example, sort doesn't need to know what type

Re: OverflowError: math range error...

2006-06-22 Thread Simon Forman
Sheldon wrote: > Hi, > > I have a written a script that will check to see if the divisor is zero > before executing but python will not allow this: > > if statistic_array[0:4] > 0.0: > statistic_array[0,0:4] = > int(multiply(divide(statistic_array[0,0:4],statistic_array \ > [0,4]),1.0))/100.0

Re: OverflowError: math range error...

2006-06-22 Thread Robert Kern
Sheldon wrote: > Hi, > > I have a written a script that will check to see if the divisor is zero > before executing but python will not allow this: > > if statistic_array[0:4] > 0.0: > statistic_array[0,0:4] = > int(multiply(divide(statistic_array[0,0:4],statistic_array \ > [0,4]),1.0))/100.

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Matthias Blume
Pascal Bourguignon <[EMAIL PROTECTED]> writes: > Matthias Blume <[EMAIL PROTECTED]> writes: > >> Pascal Bourguignon <[EMAIL PROTECTED]> writes: >> >>> Moreover, a good proportion of the program and a good number of >>> algorithms don't even need to know the type of the objects they >>> manipulate.

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Marshall
Marshall wrote: > > In this simple example, > the static case is better, but this is not free, and the cost > of the static case is evident elsewhere, but maybe not > illuminated by this example. Ugh, please forgive my ham-fisted use of the word "better." Let me try again: In this simple example,

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Chris Uppal
Joe Marshall wrote: > What we need is an FAQ entry for how to talk about types with people > who are technically adept, but non-specialists. Or alternatively, an > FAQ of how to explain the term `dynamic typing' to a type theorist. You could point people at "a regular series on object-orient

Re: Feed wxComboBox with dictionary/hash

2006-06-22 Thread Peter Decker
On 22 Jun 2006 06:45:25 -0700, Roland Rickborn <[EMAIL PROTECTED]> wrote: > My first question: > how can a wx.ComboBox be fed by a dictionary? This is one of those annoying things about wxPython that made me so happy to switch to using the dabo.ui wrapper for wxPython instead. You can set up the

Re: Help req: Problems with MySQLdb

2006-06-22 Thread Simon Forman
rodmc wrote: > Hi, > > Thanks for your email. Well I am kind of new to exceptions in Python, > but here is the code used below, as you can see it is somewhat basic. > Is there a way to display more information about the exception? > > Best, > > rod > Use the traceback module (See http://docs.pytho

  1   2   3   >