Announcement: Code generation from state diagrams

2016-10-16 Thread peter . o . mueller
>From (UML) state diagrams to Python code made easy. State machines are without any doubt a very good way to model behavior. The new code generator from Sinelabore translates hierarchical state machines efficiently into different languages now including Python. The generator accepts diagrams fr

Re: [Python-ideas] How the heck does async/await work in Python 3.5

2016-02-24 Thread Joao S. O. Bueno
Today I also stumbled on this helpful "essay" from Brett Cannon about the same subject http://www.snarky.ca/how-the-heck-does-async-await-work-in-python-3-5 On 23 February 2016 at 18:05, Sven R. Kunze wrote: > On 20.02.2016 07:53, Christian Gollwitzer wrote: > > If you have difficulties wit hthe

Backslash Escapes

2011-12-25 Thread Felipe O
Hi all, Whenever I take any input (raw_input, of course!) or I read from a file, etc., any backslashes get escaped automatically. Is there any elegant way of parsing the backslashes as though they were written in a python string. The best I have so far right now goes like this: def parse_backslash

Property Abuse

2011-12-14 Thread Felipe O
Hi All, I was wondering what everyone's thought process was regarding properties. Lately I find I've been binging on them and have classes with > 10 properties. While pylint doesn't complain (yet), it tends to be picky about keeping instance attribute counts low, so I figure there's something again

Re: any(), all() and empty iterable

2009-04-12 Thread Eduardo O. Padoan
On Sun, Apr 12, 2009 at 8:53 AM, Tim Chase wrote: >>> From the docs: >> >> all(iterable) >>                Return True if all elements of the iterable are true. >> Equivalent >>        to: >>                def all(iterable): >>            for element in iterable: >>                if not element:

Re: urllib2 httplib.BadStatusLine exception while opening a page on an Oracle HTTP Server

2009-02-19 Thread O Peng
I'm running into a similar problem with the BadStatusLine. The source code for httplib.py in the problem is as follows: class HTTPResponse: ... def _read_status(self): line = self.fp.readline() ... if not line: # Presumably, the server closed the connect

Re: A different kind of interface

2009-01-23 Thread Eduardo O. Padoan
On Thu, Jan 22, 2009 at 5:01 PM, wrote: > Eduardo O. Padoan: >> You are almost *describing* reinteract: > > - Thank you for the link and the software, I have not tried it yet, > but from the screencast it looks quite nice. > - I am glad that there are people that don&

Re: A different kind of interface

2009-01-22 Thread Eduardo O. Padoan
On Thu, Jan 22, 2009 at 7:10 AM, wrote: > I use the Python shell daily, plus of course normal editors to edit > python scripts. They both are very useful for different purposes. But > the default interactive shell isn't much handy if you want to modify > the past code to run it again, or you want

Re: "as" keyword woes

2008-12-04 Thread Eduardo O. Padoan
On Thu, Dec 4, 2008 at 7:44 AM, James Stroud <[EMAIL PROTECTED]> wrote: > alex23 wrote: >> >> On Dec 4, 3:42 pm, "Warren DeLano" <[EMAIL PROTECTED]> wrote: >>> >>> So you prefer broken code to broken rules, eh? Your customers must love >>> that! This is exactly the kind of ivory-tower thinking I

Re: What about a decorator module version 3.0?

2008-12-01 Thread Eduardo O. Padoan
On Mon, Dec 1, 2008 at 9:16 AM, Michele Simionato <[EMAIL PROTECTED]> wrote: > I am thinking about releasing a new version of the decorator module, > [...] Just FYI, the module being discussed here is http://www.phyast.pitt.edu/~micheles/python/documentation.html I dont use it myself, but given h

Re: Python3 - it's awesome

2008-11-17 Thread Eduardo O. Padoan
On Mon, Nov 17, 2008 at 7:30 AM, Johannes Bauer <[EMAIL PROTECTED]> wrote: > Hello list, > > since I've read so much about Python 3 and ran into some trouble which > was supposed to be fixed with 3k, I yesterday came around to compile it > and try it out. > > To sum it up: It's awesome. All the pro

Re: Not fully OO ?

2008-09-20 Thread Eduardo O. Padoan
On Sat, Sep 20, 2008 at 11:26 AM, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 20 Sep., 12:14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> Kay Schluehr wrote: >> > Answer: if you want to define an entity it has to be defined inside a >> > class. If you want to access an entity you have to use the d

Re: Multiple variable control in for loops. Doable in Python?

2008-07-18 Thread Eduardo O. Padoan
On Fri, Jul 18, 2008 at 4:21 PM, mark floyd <[EMAIL PROTECTED]> wrote: > I'm new to Python and have been doing work converting a few apps from Perl > to Python. I can not figure out the comparable Python structures for > multi-variable for loop control. > > Examples: > > # In Perl > for($i = 0, j

Re: Does the python library of Google Data API is truly free?

2008-06-11 Thread Eduardo O. Padoan
On Wed, Jun 11, 2008 at 10:28 AM, Kless <[EMAIL PROTECTED]> wrote: > I understand very well that a service is a software which is accessed > through a network. > > And the description given on Wikipedia [1] is "A 'Web service' (also > Web Service) is defined by the W3C as "a software system designe

Re: Python and Harry Potter?

2008-06-05 Thread Eduardo O. Padoan
On Thu, Jun 5, 2008 at 10:29 AM, Hans Nowak <[EMAIL PROTECTED]> wrote: > Helmut Jarausch wrote: >> >> Hi, >> just to let you know ... >> >> Today I've got an email from Amazon recommending me >> Harry Potter and the Deathly Hallows >> >> and they told me why they recommended this book, >> because I

Re: should I put old or new style classes in my book?

2008-05-30 Thread Eduardo O. Padoan
On Thu, May 29, 2008 at 3:06 PM, Jason <[EMAIL PROTECTED]> wrote: > I've got Python 3.0 alpha 2. In this version, it looks like you can > define classes in either the old style or new style. (I snipped the > top line a bit in the following example): Wrong. Py3k Classes are always new-style. They

Re: What is wrong with my Python threading?

2008-05-20 Thread Eduardo O. Padoan
On Tue, May 20, 2008 at 8:24 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Tue, 20 May 2008 10:28:51 -0300, castironpi <[EMAIL PROTECTED]> > escribió: > >> You meant 'thd1.start( )' and 'thd2.start( )'. > > Wow! A message with a high S/N ratio coming from you! > And it's not the first I've

Re: can't delete from a dictionary in a loop

2008-05-16 Thread Eduardo O. Padoan
On Fri, May 16, 2008 at 6:40 PM, Gary Herron <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> >> On 16 mai, 23:28, Hans Nowak <[EMAIL PROTECTED]> wrote: >> >>> >>> Dan Upton wrote: >>> for pid in procs_dict: if procs_dict[pid].poll() != None # do the counter updates >

Re: HASH TABLES IN PYTHON

2008-05-14 Thread Eduardo O. Padoan
On Wed, May 14, 2008 at 12:20 PM, Blubaugh, David A. <[EMAIL PROTECTED]> wrote: > To Whom It May Concern, > > I was wondering if anyone has ever worked with hash tables within the Python > Programming language? I will need to utilize this ability for quick > numerical calculations. http://docs.py

Re: Newbie to python --- why should i learn !

2008-05-08 Thread Eduardo O. Padoan
On Thu, May 8, 2008 at 7:25 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > i was reading/learning some hello world program in python. > I think its very simillar to Java/C++/C#. What's different (except > syntax) ? > > what can i do easily with python which is not easy in c++/java !

Re: Is this a good time to start learning python?

2008-04-01 Thread Eduardo O. Padoan
On Tue, Apr 1, 2008 at 4:20 PM, <[EMAIL PROTECTED]> wrote: > > > > Please explain how the existence of Python 3.0 would break your > production > > > > code. > > > > > The existence of battery acid won't hurt me either, unless I come into > > > contact with it. If one eventually upgrades

Re: Is this a good time to start learning python?

2008-04-01 Thread Eduardo O. Padoan
On Tue, Apr 1, 2008 at 3:57 PM, <[EMAIL PROTECTED]> wrote: > On Apr 1, 12:47 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote: > > En Tue, 01 Apr 2008 13:57:55 -0300, <[EMAIL PROTECTED]> escribió: > > > > > > On Mar 31, 1:36 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > > > wrote: > > > >

Re: Why must implementing Python be hard unlike Scheme?

2008-02-20 Thread Eduardo O. Padoan
On Feb 19, 2008 3:15 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Does this have to be true? Beneath the more complex syntax are there > a few core design principles/objects/relationships to help in grokking > the whole thing? Got any related links? Take a look at a simpler implementation,

Re: Does anyone else use this little idiom?

2008-02-05 Thread Eduardo O. Padoan
On Feb 5, 2008 1:30 PM, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Ruby has a neat little convenience when writing loops where you don't > > care about the loop index: you just do n.times do { ... some > > code ... } where n is an integer repres

Re: type, object hierarchy?

2008-02-04 Thread Eduardo O. Padoan
On Feb 4, 2008 1:36 AM, 7stud <[EMAIL PROTECTED]> wrote: > print dir(type) #__mro__ attribute is in here > print dir(object) #no __mro__ attribute > > > class Mammals(object): > pass > class Dog(Mammals): > pass > > print issubclass(Dog, type) #False > print Dog.__mro__ > > --outpu

Re: Python Standardization: Wikipedia entry

2008-02-02 Thread Eduardo O. Padoan
On Jan 29, 2008 2:43 PM, John Nagle <[EMAIL PROTECTED]> wrote: >Submitting Python 2.5 to ISO/ANSI might be a good idea. >From GvR himself: """ - Does a specification (ISO, ECMA, ..) is planned for Python and when ? No, never. I don't see the point. """ http://blogs.nuxeo.com/sections/blogs/ta

Re: PLEASE ACCEPT MY SINCERE APOLOGIES

2008-02-01 Thread Eduardo O. Padoan
On Feb 1, 2008 5:19 AM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > > On Feb 1, 5:08 am, Paddy <[EMAIL PROTECTED]> wrote: > > On Feb 1, 1:26 am, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > > > > > > > > > To Everyone on the planet Earth, > > > > > Please accept my apologies for > > > > > Wh

Re: Removing objects

2008-01-23 Thread Eduardo O. Padoan
On Jan 23, 2008 9:55 AM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > For that to work, you need to give your class an __eq__ method, and have > it match by name: > > # put this in MyClass > def __eq__(self, other): > return self.name == self.other Do you mean: # put this in M

Re: Bug in __init__?

2008-01-18 Thread Eduardo O. Padoan
On Jan 18, 2008 3:09 PM, Zbigniew Braniecki <[EMAIL PROTECTED]> wrote: > I found a bug in my code today, and spent an hour trying to locate it > and then minimize the testcase. > > Once I did it, I'm still confused about the behavior and I could not > find any reference to this behavior in docs. >

Re: Oh no, my code is being published ... help!

2007-11-30 Thread Eduardo O. Padoan
On Nov 30, 2007 11:36 AM, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > "Eduardo O. Padoan" <[EMAIL PROTECTED]> writes: > > > No, writing this way will confound the 2to3 tool. > > Why? print("foo") is a perfectly valid Python 2 statement. Maybe &

Re: Oh no, my code is being published ... help!

2007-11-30 Thread Eduardo O. Padoan
On Nov 30, 2007 11:18 AM, Peter Decker <[EMAIL PROTECTED]> wrote: > On Nov 30, 2007 1:19 AM, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > You also have a couple of instances of: > > print("Error Squeezing %s...") > > > > The parentheses serve no purpose here, and are unidiomatic. > > I thought

Re: A Python 3000 Question

2007-10-30 Thread Eduardo O. Padoan
On 10/29/07, brad <[EMAIL PROTECTED]> wrote: > Will len(a_string) become a_string.len()? I was just reading > > http://docs.python.org/dev/3.0/whatsnew/3.0.html > > One of the criticisms of Python compared to other OO languages is that > it isn't OO enough or as OO as others or that it is inconsist

Re: Script to Download Ubuntu Gutsy ASAP

2007-10-18 Thread Eduardo O. Padoan
On 10/18/07, danfolkes <[EMAIL PROTECTED]> wrote: > I thought I would post the source to a program that I made that will > download the http://ubuntu.media.mit.edu/ubuntu-releases/gutsy/ > as soon as its posted. > > It checks the site every 10 min time.sleep(600) > > This is mostly untested so I wo

Re: Duck Typing and **kwds

2007-10-11 Thread Eduardo O. Padoan
On 10/11/07, Luis Zarrabeitia <[EMAIL PROTECTED]> wrote: > > Hi there. > > I just tried this test: > > > def f(**kwds): > print kwds > > import UserDict > d = UserDict.UserDict(hello="world") > f(**d) > > > And it fails with a TypeError exception ("f() argument after ** must be a > di

Re: unit testing

2007-10-05 Thread Eduardo O. Padoan
> What's the equivalent of unittest's "assertRaises"? > In certain situations it is also useful to test wether an exception > (along its type) is raised or not. > Does py.test support such thing? import py.test py.test.raises(NameError, "blablabla") -- http://www.advogato.org/person/eopadoan/ B

Re: Python 3.0 migration plans?

2007-09-27 Thread Eduardo O. Padoan
On 9/27/07, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > It seems that Python 3 is more significant for what it removes than > what it adds. > > What are the additions that people find the most compelling? - dict.items(), .values() and .keys() returns "dict views", and the .iter*() removal h

Re: Python statements not forcing whitespace is messy?

2007-09-15 Thread Eduardo O. Padoan
On 9/15/07, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > And I'd hate to have to remember all of the rules for what can go > together and what can't, especially when it comes time to debug. No. > I don't think it should be forced, but maybe put it in PEP8 or PEP3008. It is: see "Whitespace in Expre

Re: how to join array of integers?

2007-09-15 Thread Eduardo O. Padoan
> > It's nice people have invented so many ways to spell the > > builting "map" ;) > > > ",".join(map(str,[1,2,3])) > > '1,2,3' > > IIRC, map's status as a builtin is going away. Actually, py3k built-in map == itertools.imap >>> map(str, []) -- http://www.advogato.org/person/eopadoan/ Boo

Re: How to avoid overflow errors

2007-09-15 Thread Eduardo O. Padoan
On 9/15/07, Carl Banks <[EMAIL PROTECTED]> wrote: > On Fri, 14 Sep 2007 22:59:13 -0300, Eduardo O. Padoan wrote: > > > On 14 Sep 2007 18:08:00 -0700, Paul Rubin > > <"http://phr.cx"@nospam.invalid> wrote: > >> "Eduardo O. Padoan" <[

Re: How to avoid overflow errors

2007-09-14 Thread Eduardo O. Padoan
On 14 Sep 2007 18:08:00 -0700, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > "Eduardo O. Padoan" <[EMAIL PROTECTED]> writes: > > Not totally unrelated, but in Py3k, as it seems, overflows are really > > things of the past: > > &g

Re: How to avoid overflow errors

2007-09-14 Thread Eduardo O. Padoan
On 9/14/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > I thought that overflow errors would be a thing of the past now that > Python automatically converts ints to longs as needed. Unfortunately, > that is not the case. > > >>> class MyInt(int): > ... pass > ... > >>> MyInt(sys.maxint) > 2147

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread Eduardo O. Padoan
On 9/13/07, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: > because I'm trained to interpret the underscore as a synonym for one > space. It's not particularly beautiful, but that is probably a matter of > habituation. And that exact word is probably the reason why I'd still > use self or s (exp

Calling a matlab script from python

2007-09-05 Thread n o s p a m p l e a s e
Suppose I have a matlab script mymatlab.m. How can I call this script from a python script? Thanx/NSP -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a dos batch file from python

2007-09-05 Thread n o s p a m p l e a s e
On Sep 4, 5:01 pm, [EMAIL PROTECTED] wrote: > On Sep 4, 8:42 am, n o s p a m p l e a s e <[EMAIL PROTECTED]> > wrote: > > > Suppose I have a batch file called mybatch.bat and I want to run it > > from a python script. How can I call this batch file in python scri

Calling a dos batch file from python

2007-09-04 Thread n o s p a m p l e a s e
Suppose I have a batch file called mybatch.bat and I want to run it from a python script. How can I call this batch file in python script? Thanx/NSP -- http://mail.python.org/mailman/listinfo/python-list

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-02 Thread Eduardo O. Padoan
> No. http://www.artima.com/weblogs/viewpost.jsp?thread=211430 Ops, I meant: http://www.artima.com/forums/threaded.jsp?forum=106&thread=211200 -- http://www.advogato.org/person/eopadoan/ Bookmarks: http://del.icio.us/edcrypt -- http://mail.python.org/mailman/listinfo/python-list

Re: Will Python 3.0 remove the global interpreter lock (GIL)

2007-09-02 Thread Eduardo O. Padoan
On 9/2/07, llothar <[EMAIL PROTECTED]> wrote: > I'm afraid that the GIL is killing the usefullness of python for some > types of applications now where 4,8 oder 64 threads on a chip are here > or comming soon. > > What is the status about that for the future of python? > > I know that at the moment

Re: List Comprehension Question: One to Many Mapping?

2007-08-24 Thread Eduardo O. Padoan
> For example, if I have x=[ [1,2], [3,4] ] > > What I want is a new list of list that has four sub-lists: > > [[1,2], [f(1), f(2)], [3,4], [f(3), f(4)]] [[a, [f(b) for b in a]] for a in x] -- http://mail.python.org/mailman/listinfo/python-list

Re: Flatten a list/tuple and Call a function with tuples

2007-07-25 Thread Eduardo \"EdCrypt\" O. Padoan
def flatten(listOfLists): return list(chain(*listOfLists)) >From http://www.python.org/doc/2.4/lib/itertools-recipes.html -- EduardoOPadoan (eopadoan->altavix::com) Bookmarks: http://del.icio.us/edcrypt -- http://mail.python.org/mailman/listinfo/python-list

Re: Pickled objects over the network

2007-07-18 Thread Eduardo \"EdCrypt\" O. Padoan
On 7/18/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Tue, 17 Jul 2007 14:57:16 -0700, Walker Lindley <[EMAIL PROTECTED]> wrote: [...] > The obvious thing you're doing wrong is using pickle over a network. ;) > > http://jcalderone.livejournal.com/15864.html Ok, maybe not the best tools

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

2007-07-04 Thread Eduardo \"EdCrypt\" O. Padoan
On 7/4/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > On 6/22/07, Eduardo EdCrypt O. Padoan <[EMAIL PROTECTED]> wrote: > > Remember that pure CPython has no different "compile time" and > > runtiime. But Psyco and ShedSkin could use the annotations the way &

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

2007-06-30 Thread Eduardo \"EdCrypt\" O. Padoan
On 6/30/07, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Eduardo "EdCrypt" O. Padoan a écrit : > > Remember that pure CPython has no different "compile time" and > > runtiime. > > Oh yes ? So what's the compiler doing, and what are those

Re: Voluntary Abstract Base Classes

2007-06-29 Thread Eduardo \"EdCrypt\" O. Padoan
On 6/29/07, Daniel Nogradi <[EMAIL PROTECTED]> wrote: > Hi list, > > Well, the short question is: what are they? I've read Guido's python > 3000 status report on > http://www.artima.com/weblogs/viewpost.jsp?thread=208549 where he > mentions ABC's but don't quite understand what the whole story is >

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

2007-06-27 Thread Eduardo \"EdCrypt\" O. Padoan
On 6/27/07, Stephen R Laniel <[EMAIL PROTECTED]> wrote: > On Thu, Jun 28, 2007 at 09:08:16AM +0200, Bruno Desthuilliers wrote: > > You said ? > > I could link again to Mark-Jason Dominus, who writes that > people often make the following inference: > > 1) C is strongly typed. > 2) C's typing sucks.

Re: Collections of non-arbitrary objects ?

2007-06-25 Thread Eduardo \"EdCrypt\" O. Padoan
> I don't think there is anything wrong with the data structures that > exist in python. I was just wondering if there was a structure that > would restrict a collection to only allow certain types. The > "restrictedlist" class discussed in another thread may be the sort of > thing I was looking fo

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

2007-06-22 Thread Eduardo \"EdCrypt\" O. Padoan
On 6/22/07, John Nagle <[EMAIL PROTECTED]> wrote: > Paul Boddie wrote: > > P.S. I agree with the sentiment that the annotations feature of Python > > 3000 seems like a lot of baggage. Aside from some benefits around > > writing C/C++/Java wrappers, it's the lowest common denominator type > > annota

Re: Should: "for k,v in **dictionary_instance" work?

2007-06-16 Thread Eduardo \"EdCrypt\" O. Padoan
> Actually since you asked, I had to try this out > > x = range(10) > a, *b = x PEP 3132: Extended Iterable Unpacking http://www.python.org/dev/peps/pep-3132/ -- EduardoOPadoan (eopadoan->altavix::com) Bookmarks: http://del.icio.us/edcrypt -- http://mail.python.org/mailman/listinfo/python-lis

Re: strange PyLint configuration (was: PEP 8 style enforcing program)

2007-05-31 Thread Eduardo \"EdCrypt\" O. Padoan
On 5/31/07, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Alexander Eisenhuth wrote: > > > Pylint is one of them (http://www.logilab.org/857) > > BTW: Why does pylint want all names with underscores? I tested it > and it complains about malformed names in e.g. the following cases > that are conf

Re: NEWBIE: Extending a For Statement.

2007-05-21 Thread Eduardo \"EdCrypt\" O. Padoan
> > Perhaps you meant that second one to be: > > (key, mydict[key] for key in mydict if key in xrange(60, 69) or key == > > 3) > > > Clearly not! Its called *list*-comprehension, not tuple-comprehension. ;) With () instead of [], it is a generator expression. http://docs.python.org/ref/genexpr.html

Re: Python Feature Request: Explicit variable declarations

2007-04-20 Thread Eduardo \"EdCrypt\" O. Padoan
> The thoughts of the inventor of Python on "Adding Optional Static > Typing to Python" are at > http://www.artima.com/weblogs/viewpost.jsp?thread=86641 > . I wonder if the idea will be implemented in Python 3.0. No. He says it in another newer post and in PEP 3099, AFAIK. -- EduardoOPadoan (e

Re: why I don't like range/xrange

2007-02-16 Thread Eduardo \"EdCrypt\" O. Padoan
> But this long int => int issue should not exist in a future python > version any more, IIRC int and long int is scheduled to be merged > somehow. (Or isn't it?) It is done. http://mail.python.org/pipermail/python-3000-checkins/2007-January/000251.html -- EduardoOPadoan (eopadoan->altavix::com

Re: Pep 3105: the end of print?

2007-02-16 Thread Eduardo \"EdCrypt\" O. Padoan
On 2/15/07, Edward K Ream <[EMAIL PROTECTED]> wrote: > > Isn't the very concept of major releases (1.x, 2.x, 3.x) that they *can* > > be not backwards-compatible with previous releases? > > Not at all. [...] It is the only intent of Python 3.0: be free of backward compatibity constraints. There ar

Re: The Python interactive interpreter has no command history

2007-02-15 Thread Eduardo \"EdCrypt\" O. Padoan
> Hello, > > How to configure Python2.5's interactive interpreter to get command > history ? > > I always got ^[[A and ^[[B . > Are you using Ubuntu? The last comes with 2.4.x and 2.5. This only occurs on 2.5. This happens when you compile Python with libreadline installed, AFAIK. FIll a bug in th

Re: idea for testing tools

2007-02-08 Thread Eduardo \"EdCrypt\" O. Padoan
> That's hardly desirable. If one is writing a test library that goes as > far as reparsing the assert statements, I can't see the point of > requiring the user to clutter his test suite with such spurious print > statements. After all, that's one of the main points of test suites in > the first pl

Re: idea for testing tools

2007-02-08 Thread Eduardo \"EdCrypt\" O. Padoan
> #!/usr/bin/python > > a = 1 > b = 2 > > def test_some(): > assert a == b > > didn't reveal the values for a and b, though some more complex cases > showed something. def test_some(): print 'a:', a, 'b:', b assert a == b http://codespeak.net/py/current/doc/test.html#debug-w

Re: Object type check

2007-02-07 Thread Eduardo \"EdCrypt\" O. Padoan
> Of cource i restrict them to particular types! In C# you cannot pass > something bad > this way because the compiler will just catch it! And you cant pass something 'good' that immitates another object interface (a file-like object for example) > I see what you mean by "duck typing". So you sug

Re: lambda functions ?

2007-02-06 Thread Eduardo \"EdCrypt\" O. Padoan
> This means that "f" is not a pointer to make_incrementor but rather to > the internal (copied?) function. "returned" function isthe right here. As any returned object from a function. > > > This style is very common in Scheme programming so you might read a > > Scheme book if you want to underst

re: compound statement from C "?:"

2007-02-02 Thread Eduardo \"EdCrypt\" O. Padoan
http://effbot.org/pyfaq/is-there-an-equivalent-of-c-s-ternary-operator.htm -- EduardoOPadoan (eopadoan->altavix::com) Bookmarks: http://del.icio.us/edcrypt Blog: http://edcrypt.blogspot.com Jabber: edcrypt at jabber dot org ICQ: 161480283 GTalk: eduardo dot padoan at gmail dot com MSN: eopadoan a

Re: File system API

2007-02-02 Thread Eduardo \"EdCrypt\" O. Padoan
On 2/2/07, Tal Einat <[EMAIL PROTECTED]> wrote: > > I think that there aready exists a proposal for an Abstract FS Layer > > for Python somewere. > > I haven't been able to find any mention of it. Maybe you could point me in > the right direction? > > - Tal > http://wiki.python.org/moin/CodingProje

re: Inconsistent list/pointer problem

2007-02-02 Thread Eduardo \"EdCrypt\" O. Padoan
> Won't do for the OP's needs - he wants to modify the objects contained > in listB without impacting the ones in listA (or at least that's what I > understand). Sorry. That is true - the items referenced on the [:] copy are the same as in the original. Rereading what the OP msg, I think we agree

Inconsistent list/pointer problem

2007-02-02 Thread Eduardo \"EdCrypt\" O. Padoan
> def myFunc(listA): > listB = listA > work on & modify listB > return(listB) def my_func(listA): listB = listA[:] #work on & modify listB return listB Attribution makes the name t the left 'point' to the result of the expression at the right. In your myFunc the expersion at

Re: How to detect what type a variable is?

2006-11-29 Thread Eduardo \"EdCrypt\" O. Padoan
> > One might prefer to check for string-ness, as strings can > duck-type somewhat like lists: > > my_list = ['my', 'brain', 'hurts'] > my_string = 'Are you the brain specialist?' > > for test in [my_list, my_string]: > try: > for thing in test: > process_list_item(thing)

Adding private tags to a tiff file.

2006-08-11 Thread O Evans
Hi there, I'm manipualating tiff images captured by a program that insists on using annoying private tags. I want to be able to import an image that I have created into the program but I cannot get PIL to save the private tag. Here is a simplified version of the code I am using: import Image orig

Re: Change value of element in list

2006-06-18 Thread O Plameras
O Plameras wrote: > Hi, > > I'm doing python tutorial, >> http://docs.python.org/tut/node5.html > > and I have these, > > lists = ['spam', 'eggs', 100, 1234] > lists[2] = lists[2] + 23 > > I expected this, > lists = ['spam&#

Change value of element in list

2006-06-18 Thread O Plameras
#x27;eggs', 100, 1234] What's my problem here ? I have Fedora C5 with python2.4. Thanks. O Plameras -- http://mail.python.org/mailman/listinfo/python-list

Test tool - Design advise needed

2006-06-14 Thread P-O Bengtsson
-O -- http://mail.python.org/mailman/listinfo/python-list

Re: The Nature of the “Unix Philosophy”

2006-06-08 Thread Nils O. Selåsdal
Xah Lee wrote: > The Nature of the “Unix Philosophy” > > Xah Lee, 2006-05 > > In the computing industry, especially among unix community, we often > hear that there's a “Unix Philosophy”. In this essay, i dissect the > nature and characterization of such “unix philosophy”, as have been > describe

How to avoid "f.close" (no parens) bug?

2005-11-12 Thread o
plez send me   -- http://mail.python.org/mailman/listinfo/python-list

Class methods

2005-10-05 Thread Hughes, Chad O
Title: Class methods Is there any way to create a class method?  I can create a class variable like this: class Foo:   classVariable = None   def __init__(self, classVariable):     Foo.classVariable = classVariable A = Foo('a') B = Foo('b') Print 'The class variable for A is "%s" a

Can't start new thread

2005-08-11 Thread Hughes, Chad O
Title: Can't start new thread I am trying to understand what is causing python to raise this error when I create a number of threads: thread.error: can't start new thread I have been told that it is due to the default thread size (1 MB), but I have recompiled python defining an alternate

RE: Database recommendations for Windows app

2005-06-22 Thread Hughes, Chad O
Firebird is cross platform (you would need the classic server version) look at the following post: http://mail.python.org/pipermail/python-list/2005-June/286366.html Chad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Will McGugan Sent: Wednesday, June

RE: Python choice of database

2005-06-20 Thread Hughes, Chad O
One db that is very much worth trying is Firebird. This is an open source Interbase 6.0 (Borland product) compatible db. It is a SourceForge project. There are three versions: the super server which is a client/server db, classic server (the one that I am very familiar with) which is also a clie

Using swig to use an existing dll/library

2005-06-18 Thread peter . o . mueller
Hi together, i have a Windows DLL in C that is internally multithreaded and provides a callback function to signal specific events. As I understood one can use "normal" C-code with swig. Is it also possible to use existing DLLs? Does swig can also handel the callback method? If not - is there anot

RE: how to operate the excel by python?

2005-06-17 Thread Hughes, Chad O
Title: Message I have posed a more complete answer to your question, however, it is quite a large and It is awaiting approval.  For now, xlRight = -4152.  You can find this out by opening up Excel and typing the ALT-F11 combination.  From there use the ObjectBrowser.  For example if you type

RE: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread Hughes, Chad O
ri, 17 Jun 2005 10:22:05 -0700, Hughes, Chad O wrote: > Are you sure about the lower-case thing. The original post states > "Perlhead" and there are many instances at www.Perl.com where O'REILLY > spells perl as Perl. I did say "usually" :-) But in fact it see

RE: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread Hughes, Chad O
ent: Friday, June 17, 2005 10:02 AM To: python-list@python.org Subject: RE: Overcoming herpetophobia (or what's up w/ Python scopes)? On Fri, 17 Jun 2005 09:36:55 -0700, Hughes, Chad O wrote: > I am very familiar with Python, but I don't know Pearl. The language is *always* spelt wi

RE: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-17 Thread Hughes, Chad O
I am very familiar with Python, but I don't know Pearl. In order to answer your question, you will have to tell me about your statement, "I couldn't live without closures and without the fine control over scopes that Pearl provides." I don't know what these things are to Pearl. If you tell me wha

RE: Finding Word and switch focus to it

2005-06-15 Thread Hughes, Chad O
Consider reading this post. It highlights how to do what you want: http://mail.python.org/pipermail/python-win32/2002-April/000322.html Chad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Henry Sent: Wednesday, June 15, 2005 3:21 PM To: python-list@

RE: Finding Word and switch focus to it

2005-06-15 Thread Hughes, Chad O
The first part is easy. I will have to think about the second part. To find an opened copy of Word and switch focus to it do the following: from win32com.client import Dispatch word = Dispatch('Word.Application') wdWindowStateNormal = 0 if len(word.Documents): word.Activate() if word.WindowSta

RE: Opening a drive folder from Python

2005-06-14 Thread Hughes, Chad O
I think you are talking about the following: from win32com.client import Dispatch path = raw_input('Type in a path: ') s=Dispatch('WScript.Shell') s.Run('Explorer %s'%path) Chad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Henry Sent: Tuesday,

RE: [python-win32] NTService detecting if the Windows System is Idle

2005-06-13 Thread Hughes, Chad O
-Original Message- From: Hughes, Chad O Sent: Monday, June 13, 2005 9:09 AM To: 'Fred Dixon' Subject: RE: [python-win32] NTService detecting if the Windows System is Idle There may be important processes running in the background (headless process with no user interaction)

RE: SMTP Test Rig

2005-06-10 Thread Hughes, Chad O
example I have seen yet. Chad -Original Message- From: Tim Williams [mailto:[EMAIL PROTECTED] Sent: Friday, June 10, 2005 5:35 AM To: Hughes, Chad O; Jesse Noller Subject: SMTP Test Rig Chad, Jesse. The SMTP test rig receives SMTP emails and can be configured to write them to the screen

RE: how to operate the excel by python?

2005-06-10 Thread Hughes, Chad O
Sorry, I meant to spell check but I did not somehow. Chad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hughes, Chad O Sent: Friday, June 10, 2005 10:01 AM To: python-list@python.org Subject: RE: how to operate the excel by python? Here are two

RE: how to operate the excel by python?

2005-06-10 Thread Hughes, Chad O
Here are two scripts that I have had to build for a class that I teach. You will either need to write the constants explicitly, or I can email neet the constans module that I have built, for the second one to work. I will copy it to the very end. If you have any questions, just let me know. He

RE: smtpd module

2005-06-09 Thread Hughes, Chad O
, Chad -Original Message- From: Ivan Shevanski [mailto:[EMAIL PROTECTED] Sent: Thursday, June 09, 2005 2:03 PM To: python-list@python.org Cc: Hughes, Chad O Subject: RE: smtpd module So youre wondering how to send mail in python? I have a lot of examples if you want the smtp module. I don&#

smtpd module

2005-06-09 Thread Hughes, Chad O
Title: smtpd module Does anyone know of any documentation on how to use the smtpd module, either the SMTPServer or the DebuggingServer?  I cannot find any usage cases or examples anywhere.  I can find examples of using the smtplib module but not the smtpd module. Thanks, Chad -- http:/

Posting a reply to a post in an existing thread

2005-06-09 Thread Hughes, Chad O
Title: Posting a reply to a post in an existing thread This may be a dumb question.  I am new to using this list, and I cannot figure out how to send a reply to a message that has been posed in a thread without creating a new thread.  Let me rephrase my question.  The instructions for posting

RE: EnumKey vs EnumValue

2005-06-06 Thread Hughes, Chad O
EnumKey enumerates subkeys which are equivalent to the folders in regedit. EnumValue enumerates values only. The reason your script is not printing anything must be due to the fact that you are passing in a registry path that contains only subkeys and no values. As I mentioned before, the folders

Thread Stack Size

2005-06-01 Thread Hughes, Chad O
Title: Thread Stack Size I am using the threading module to create a great deal of threads. Is there any way to set the thread stack size?  It looks like each thread is being given a default stack size of 1MB.  I have looked all over and I cannot find a way to shrink the stack to a few KB.  W

Re: Reinstall python 2.3 on OSX 10.3.5?

2005-02-03 Thread Dominique O. Martel
0) compile and install GNU readline 5.0 with the usual ./configure method ftp://ftp.cwru.edu/pub/bash/readline-5.0.tar.gz 1) as an administrator, remove the contents of "/System/Library/Frameworks/Python.framework" 2) install Python from the standard distribution: ./configure --enable-framework=

  1   2   >