Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-23 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > maybe it's time to change "equivalent to" to "similar to", to avoid > messing things up for people who reads the mostly informal library > reference as if it were an ISO specification. That is their fault as the library reference is supposed to be "(keep this under your pill

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-23 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > > maybe it's time to change "equivalent to" to "similar to", to avoid > > > messing things up for people who reads the mostly informal library > > > reference as if it were an ISO

wxPython installation issues on Debian

2005-11-23 Thread [EMAIL PROTECTED]
Hi all, I'm trying to install wxPython on Debian using 'apt-get install python-wxgtk2.4.' I've got both Python 2.3 and 2.4 installed with 2.4 set as my default. For whatever reason, wxPython always installs under /usr/lib/python2.3/site-packages. Does anyone know how I can force it to install in

Re: Python as Guido Intended

2005-11-23 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > > I do think that the Python development community believes they do, > > or more accurately, that if someone wants to use a different style, > > they can go use something else. > > In other words, they believe that you should use a screwdriver to > drive screws, and not a hamme

Re: Python as Guido Intended

2005-11-23 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > Whatever it is, trying to turn Python into a tool for dealing with it > isn't the right thing to do. Still this tone, and logic. This statement alone is right except that it may not be what was about. > > >> > I think that it is possible to include in Python, things that are >

Re: (newbie) N-uples from list of lists

2005-11-23 Thread [EMAIL PROTECTED]
Out of curiousity, is "recursion" the desirable way(or is it pythonic way) ? How would one do it in the imperative way ? Dan Bishop wrote: > > it could be done by a recursive call, but i am interested in using and > > understanding generators. > > def cross(*args): >"""Iterates over the set cr

Re: Why is dictionary.keys() a list and not a set?

2005-11-23 Thread [EMAIL PROTECTED]
Peter Hansen wrote: > Christoph Zwerschke wrote: > > Ok, the answer is easy: For historical reasons - built-in sets exist > > only since Python 2.4. > > > > Anyway, I was thinking about whether it would be possible and desirable > > to change the old behavior in future Python versions and let dict

Re: about sort and dictionary

2005-11-23 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > "do things right" is my fundamental beef with Python. > Dispite claims, I don't believe Python's designers have > a monopoly on the definition of "right". I think raymond's post more correctly described it. Rather than do

Re: Why is dictionary.keys() a list and not a set?

2005-11-23 Thread [EMAIL PROTECTED]
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > > Peter Hansen wrote: > >>I believe it's currently guaranteed that the order of > >>the items in dict.keys() and dict.values() will match (i.e. the index of > >>any key in its list will be the same as the in

Re: (newbie) N-uples from list of lists

2005-11-23 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Out of curiousity, is "recursion" the desirable way(or is it pythonic > > way) ? How would one do it in the imperative way ? > > For an inherently recursive problem (as this one appea

Re: Why is dictionary.keys() a list and not a set?

2005-11-23 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > One reason might be Practicality. The zip() versions handily beat the > listcomp versions on a 10kitem dict. (python2.4) > > $ timeit.py -s 'd = dict.fromkeys(range(1))' '[(v, k) for (k, v) in > d.iteritems()]' > 10

Re: Python as Guido Intended

2005-11-23 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > >> You're the one that wants to use the hammer to do whatever it is, not > >> me. I don't believe in silver bullets. Python is good at what it > >> does. If I need a diff

Re: Why is dictionary.keys() a list and not a set?

2005-11-23 Thread [EMAIL PROTECTED]
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > > Which is also my initial puzzle, items() and iteritems() already gives > > you the tuples, why such gurantee or the others ? Doesn't that violate > > the general idiom that if we can do certain thing in one way, there

Re: Python as Guido Intended

2005-11-23 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > >> Maybe Python attracts people who share that belief. After all, TRTFTJ > >> is implies TSBOOWTDI, and vice versa. > > I was not talking about the believe, I was talking about the w

Re: Why is dictionary.keys() a list and not a set?

2005-11-23 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Which is also my initial puzzle, items() and iteritems() already gives > > you the tuples, why such gurantee or the others ? Doesn't that violate > > the general idiom that if

Re: Making immutable instances

2005-11-23 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > A substantial fraction of the time, people asking "how do I stop the > users of my code from doing X" proceed by screaming "but they could > still do X if they hopped on their left foot in a moonless midnight > while sprinkling bat's blood!" as a response to any suggestion.

Re: return in loop for ?

2005-11-23 Thread [EMAIL PROTECTED]
Steve Holden wrote: > Yomgui: I am not a language lawyer, but I think you can feel safe > returning from inside a loop. Just as a matter of interest, how else > would you propose to implement the functionality Mike showed: > > > >>>def f(): > > > > ... for i in range(20): > > ... if i > 10: re

Re: Why is dictionary.keys() a list and not a set?

2005-11-23 Thread [EMAIL PROTECTED]
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] wrote: > > [...] > >>Maybe there are also other reasons to promise this property that I'm not > >>aware of. Certainly it seems like this property is useful and not hard > >>to p

Re: Python as Guido Intended

2005-11-23 Thread [EMAIL PROTECTED]
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Mike Meyer wrote: > [...] > > > >>By the results of the vote, most people wanted ternary. The use > >>cases for it are well know. From what I recall, the debate was over > >>which of the many proposa

Re: Python as Guido Intended

2005-11-23 Thread [EMAIL PROTECTED]
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > > Mike Meyer wrote: > > > >>"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > >> > >>>>Maybe Python attracts people who share that belief. After all, TRTFTJ > >>>>is im

Re: Why is dictionary.keys() a list and not a set?

2005-11-23 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > performance is of course another aspect; if you *need* two parallel > lists, creating a list full of tuples just to pull them apart and throw > them all away isn't exactly the most efficient way to do things. > > (if performance didn't matter at all, we could get rid most di

Re: wxPython Licence vs GPL

2005-11-23 Thread [EMAIL PROTECTED]
Steve Holden wrote: > Whether or not some fragments of code remain unchanged at the end of > your project, if you start out with a piece of source code lifted from > wxPython then what you have created is definitely a "derivative work" > and, as such, you must take into account the wxPython licens

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > Fredrik Lundh wrote: > > > performance is of course another aspect; if you *need* two parallel > > > lists, creating a list full of tuples just to pull them apart and throw > > > them all away isn't

Re: wxPython Licence vs GPL

2005-11-24 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Steve Holden wrote: > >> Whether or not some fragments of code remain unchanged at the end of > >> your project, if you start out with a piece of source code lifted from > >&g

Re: return in loop for ?

2005-11-24 Thread [EMAIL PROTECTED]
Steve Holden wrote: > Well, I'm happy in this instance that practicality beats purity, since > the above is not only ugly in the extreme it's also far harder to read. > > What are the claimed advantages for a single exit point? I'd have > thought it was pretty obvious the eight-line version you ga

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > > the thing that's in favour is "then-if-else", not "if-then-else". > > > > Sorry if I confused you, I though it was clear that I meant the > > concept, not a specific syntactical imple

Re: Making immutable instances

2005-11-24 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >... > > > qualification, you're quite likely to get such disclaimers. If you > > > don't want them, learn to ask about stopping your users from > > > ACCIDENTALLY doing X,

Re: Making immutable instances

2005-11-24 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > "Giovanni Bajo" <[EMAIL PROTECTED]> writes: > > Mike Meyer wrote: > >> Note that this property of __slots__ is an implementation detail. You > >> can't rely on it working in the future. > > I don't "rely" on

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I know that is a single list of tuples, I mean that can be used as > > well. > > > > for k, _ in d.items(): print k > > for _, v in d.items(): print v > > for k in d.keys(): print k > > for v

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I know that is a single list of tuples, I mean that can be used as > > well. > > > > for k, _ in d.items(): print k > > for _, v in d.items(): print v > > for k in d.keys(): print k > > for v

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > Consider a dictionary with one million items. The following operations > > k = d.keys() > v = d.values() > > creates two list objects, while > > i = d.items() > > creates just over one million objects. In your "equivalent" example, > you're calling d.items() tw

Re: return in loop for ?

2005-11-24 Thread [EMAIL PROTECTED]
Duncan Booth wrote: > To bonono, not Steve: > > So if a function should religiously have only one exit point why does the > example you give have two exit points? i.e. the 'return r', and the implied > 'return None' if you execute the 'something' branch. I may have remember it wrong, but don't ask

Re: strange behaviour when writing a large amount of data on stdout

2005-11-24 Thread [EMAIL PROTECTED]
Bengt Richter wrote: > If windows has been running a long time (a few days or a week may be long ;-) > it > may get fragmented in some smallish memory arena reserved for special things > (I forgot > what versions, but I wouldn't be surprised if something still had s > specialized limit). > I kn

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > These results make more sense. However, I am still puzzled : > > > > 1. why would d.keys()/d.values() only return one list element ? Why > > isn't it a list of 1M element of either the keys or values but it

Re: Python as Guido Intended

2005-11-24 Thread [EMAIL PROTECTED]
Antoon Pardon wrote: > When we notice that people are fighting the language, sometimes > the best approach is to change the language so that there is > less reason to fight the language. > I think just don't "disregard the other side" without considering their rationale is enough, and I mean the o

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > > creates just over one million objects. In your "equivalent" example, > > > you're calling d.items() twice to produce two million objects, none > > > of which you really care about. > >

Re: wxPython Licence vs GPL

2005-11-24 Thread [EMAIL PROTECTED]
Peter Hansen wrote: > Steven D'Aprano wrote: > > On Thu, 24 Nov 2005 00:26:36 -0800, [EMAIL PROTECTED] wrote: > >>As for the liability, that is for sure, withness what is happening for > >>the linux kernel. > > > > What is happening for the Lin

Re: strange behaviour when writing a large amount of data on stdout

2005-11-24 Thread [EMAIL PROTECTED]
Bengt Richter wrote: > Depends on what you run ;-) Maybe how many times buggy apps die in unusual > ways. > Or worse, buggy drivers. Your car might have bad 4-wheel drive that you never > used, > so you thought your car reliable ;-) > Sure, no casual toys are allowed. But this is true in general

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-24 Thread [EMAIL PROTECTED]
Magnus Lycka wrote: > [EMAIL PROTECTED] wrote: > > Oh, find a need to shut other up ? > > > Oh, find a need to get the last word? > like you ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Christoph Zwerschke wrote: > [EMAIL PROTECTED] schrieb: > > You can already get a set from a dictionary's keys in an efficient manner: > >>>>l = dict.fromkeys(range(10)) > >>>>set(l) > > Set([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) > > Good poin

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Christoph Zwerschke wrote: > >> [EMAIL PROTECTED] schrieb: > >> > You can already get a set from a dictionary's keys in an efficient > >> > manner: > >>

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
Mike Meyer wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > Christoph Zwerschke wrote: > >> [EMAIL PROTECTED] schrieb: > >> > You can already get a set from a dictionary's keys in an efficient > >> > manner: > >>

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > Mike Meyer wrote: > > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > Christoph Zwerschke wrote: > > >> [EMAIL PROTECTED] schrieb: > > >> > You can already get a set from a dictionary's keys in an

Re: Why is dictionary.keys() a list and not a set?

2005-11-25 Thread [EMAIL PROTECTED]
Duncan Booth wrote: > [EMAIL PROTECTED] wrote: > > > As for the (k,v) vs (v,k), I still don't think it is a good example. I > > can always use index to access the tuple elements and most other > > functions expect the first element to be the key. For example : > &g

Re: defining the behavior of zip(it, it) (WAS: Converting a flat list...)

2005-11-25 Thread [EMAIL PROTECTED]
Steve Holden wrote: > Magnus Lycka wrote: > > [EMAIL PROTECTED] wrote: > > > >>Oh, find a need to shut other up ? > >> > > > > Oh, find a need to get the last word? > > > > /Magnus > > > > P.S. Yes, this *is* a test. &g

Re: Python as Guido Intended

2005-11-25 Thread [EMAIL PROTECTED]
Antoon Pardon wrote: > Op 2005-11-24, Mike Meyer schreef <[EMAIL PROTECTED]>: > > [EMAIL PROTECTED] writes: > >> "Mike Meyer" <[EMAIL PROTECTED]> writes: > >>> [EMAIL PROTECTED] writes: > >>> > Different programming styles are app

Re: Draw a triangle...

2005-11-25 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > The Eternal Squire wrote: > > > PyGame is your best bet for pure graphics. Simple shapes can be done > > in just a few statements. > > the same applies to Tkinter, of course. > > from Tkinter import * > > # set things up > c = Canvas(); c.pack() > > # draw s

Re: Making immutable instances

2005-11-25 Thread [EMAIL PROTECTED]
Paul Rubin wrote: > Fair enough. How's this: > >a = ImmutableObject() >b = deepcopy(a) >assert a == b # a and b start out equal > do stuff ># since a and b are immutable, they should still be equal ># no matter what has happened above >assert a == b > > If yo

Re: (newbie) N-uples from list of lists

2005-11-25 Thread [EMAIL PROTECTED]
This is my attempt : def cross(seq): r=[[]] for x in seq: r = [ a + b for a in r for b in [[i] for i in x ]] return r It is not very efficient though as it would loop through the intermediate list produced multiple times. [EMAIL PROTECTED] wrote: > Hello, > > i

Move xml.sax.saxutils.*?

2005-11-25 Thread [EMAIL PROTECTED]
It seems like functions such as xml.sax.saxutils.escape and unescape are generally useful, and not at all tied to the xml.sax module. Would it make sense to move them somewhere else, like to xml? I ask because it just took me 20 minutes to figure out how to escape entities in python. It's not ob

Writing pins to the RS232

2005-11-25 Thread [EMAIL PROTECTED]
I want to write to the pins of an RS232 without using the serial protocol. The use would be every pin could act to complete a circuit in customized hardware. I could use python to communicate serially to a BASIC stamp or a Javelin stamp and then use the stamp to set however many pins as 0's or 1'

Re: How to get started in GUI Programming?

2005-11-25 Thread [EMAIL PROTECTED]
did you search GUI in this group? I think the results will be helpful. some other GUI packages you might of missed are wxPython and pygame -- http://mail.python.org/mailman/listinfo/python-list

Hello World-ish

2005-11-26 Thread [EMAIL PROTECTED]
from os import * print "Working path: %s" % os.getcwd(); Just wondering how you would do that .. in theory, if you get what I mean? I get NameError: name 'os' is not defined currently, which I don't know how to fix.. anyone? -- http://mail.python.org/mailman/listinfo/python-list

scanl in python

2005-11-26 Thread [EMAIL PROTECTED]
>I think that the test for an empty iterator makes ireduce() unintuitive. Try >asking someone who has not followed the discussion >what list(ireduce(add, [], 42)) might produce, given that >list(ireduce(add, [1], 42)) --> [43] >list(ireduce(add, [1, 2], 42)) --> [43, 45] >list(ireduce(add, [])) --

Re: Which License Should I Use?

2005-11-26 Thread [EMAIL PROTECTED]
First thing first, you need to find out if you are an "employee", not in the normal sense, but legal sense. This directly affect the copyright issue, outside your "work hours". If you need their consent on take on other clients, that would be iffy. There are a number of things a court would look

Re: Comparison problem

2005-11-27 Thread [EMAIL PROTECTED]
I think no matter what language you programs it, it is hard to understand. Can you break it up into sub-problems first ? Like first parsing the inventory file into a python dict, then also the fields from web to another dict ? Chris wrote: > Hi, > > I'm new to python, and I'm trying to write a sma

Re: Which License Should I Use?

2005-11-27 Thread [EMAIL PROTECTED]
Yup, these independent contractor test doctrines bite both way and in your case, it is not in your advantage, usually. I would suggest that whatever tools you want to make to enhance the work(even it is inspired by your current task), don't use it on this employer/client, at least not on their pre

Re: Writing pins to the RS232

2005-11-27 Thread [EMAIL PROTECTED]
First of all I'd like to thank all of you for your input. It's nice to have a place to throw ideas around and get some feedback. I think the reason the serial source code I'm using is using javax.comm stuff which is possibly part of Jython is because I'm on Mac OS X. However this is just my guess

Re: Writing pins to the RS232

2005-11-27 Thread [EMAIL PROTECTED]
ahhh I understand now -- http://mail.python.org/mailman/listinfo/python-list

Re: best cumulative sum

2005-11-27 Thread [EMAIL PROTECTED]
Peter Otten wrote: > David Isaac wrote: > > > "Peter Otten" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > >> I think that the test for an empty iterator makes ireduce() unintuitive. > > > > OK. > > I misundersto

Re: General question about Python design goals

2005-11-27 Thread [EMAIL PROTECTED]
Christoph Zwerschke wrote: > >>For instance, I just wanted to use the index() method on a tuple which > >>does not work. ... > > Aahz wrote: > > > Because Guido believes that tuples should be primarily used as > > lightweight replacements for C structs. Therefore they have minimal > > functionali

ANN: Dao Language v.0.9.6-beta is release!

2005-11-28 Thread [EMAIL PROTECTED]
Specification of precision in numeric array enumeration is supported: [EMAIL PROTECTED] array]; ! Transpose operator(right operator) is changed from ' to ~. - Function convolute() for numeric arrays is removed. EXTENDING AND EMBEDDING: + Some abstract classes are

pcm format to wav...

2005-11-28 Thread [EMAIL PROTECTED]
Hi ! I have WinXP. I want to convert my PySonic recorded (raw) pcm format files to wav files. How can I do it ? Please help me ! dd -- http://mail.python.org/mailman/listinfo/python-list

Re: Death to tuples!

2005-11-29 Thread [EMAIL PROTECTED]
r all container types. I'm not sure tuple should be eliminated, however. It still has value to show that these things are a group. And it's very lightweight to construct. -- Mike Orr <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question concerning formatted output

2005-11-29 Thread [EMAIL PROTECTED]
You can try something like: #!/usr/bin/python import sys inp = open("xyplan.nobreaks") data = [ i.strip() for i in inp if i ] while data: print ' '.join(data[0:3]) del data[0:3] -- http://mail.python.org/mailman/listinfo/python-list

Re: python speed

2005-11-29 Thread [EMAIL PROTECTED]
Krystian wrote: > Hi > > >>are there any future perspectives for Python to be as fast as java? i > >>would like to use Python as a language for writing games. > > > >Why would we want Python to be as fast as Java when it's already faster? > > hm... i came across this site: > http://shootout.alioth.

sha1,256,512 on files

2005-11-30 Thread [EMAIL PROTECTED]
Hi ! I have a problem in Windows. I need to get the filelist in HDD-s, with sha-N value for every file (to see what changed in the past). 1. I see that Python supports the sha-1. But I need to make sha value in big files to (swap file, iso-s, etc.). Possible that file size more than 2 GB, so

Re: wxPython installation issues on Debian

2005-11-30 Thread [EMAIL PROTECTED]
Hi Robert, Thanks for the suggestion, but an apt-cache search python2.4-wxgtk2.4 returns no results for a package with that name. Aaron -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython installation issues on Debian

2005-11-30 Thread [EMAIL PROTECTED]
Hi Ken, Thanks a lot for the clarification. I don't have a compelling reason not to use 2.3 other than having to install the modules I've already set up for 2.4. Not really a big deal. Looks like I'll be switching to 2.3. Thanks again, Aaron -- http://mail.python.org/mailman/listinfo/python-lis

Re: python speed

2005-11-30 Thread [EMAIL PROTECTED]
Isaac Gouy wrote: > Peter Hansen wrote: > > Isaac Gouy wrote: > > > Peter Hansen wrote: > > >>Judging by the other posts in this thread, the gauntlet is down: Python > > >>is faster than Java. Let those who believe otherwise prove their point > > >>with facts, and without artificially handcuffing

help python swig problem

2005-11-30 Thread [EMAIL PROTECTED]
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c */ #include double My_variable = 3.0; int fact(int n) { if (n <= 1) return 1; else return

A bug in struct module on the 64-bit platform?

2005-11-30 Thread [EMAIL PROTECTED]
Hi, I have a user who complained about how "struct" module computes C struct data size on Itanium2 based 64-bit machine. His first reproducer was -- #!/usr/local/bin/python import struct fmthead = '12id5i5d7id5i3di12i3di' fmtsize = struct.calcsize(fmthead) prin

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-01 Thread [EMAIL PROTECTED]
The best way to compare Dao with Python in detail would be, join a SF project PLEAC, and provide solutions in Dao to those common programming problems listed in Perl Cookbook(by Tom Christiansen & Nathan Torkington, published by O'Reilly). The solutions in Python is there, when solutions in Dao wou

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-01 Thread [EMAIL PROTECTED]
> Maybe trying Python requires less time :-) Yes. Maybe if I tried python instead of perl, probably there would be no Dao language :). However there is one thing I don't like in python, that is, scoping by indentation. But it would not annoy me so much that make me decide to implement a new langua

Tkinter menu

2005-12-01 Thread [EMAIL PROTECTED]
Hi, I'm writing a small GUI program in Python/Tkinter (my first Python program). I want to make a menu which lists the names of a number of text files that my program uses/generates. When I select one of the files from the menu, I would like a new window to open up a scroll box containing the fi

URI http get

2005-12-01 Thread [EMAIL PROTECTED]
I have a website and by accessing it from the browser, for example: "http://www..com:/status";, the web page will display "ok" only if the URI is up. And it will return "website could not be found" alert if the URI is down. In Python, is there a way to retrieve "ok" programmatically and de

Eclipse best/good or bad IDE for Python?

2005-12-01 Thread [EMAIL PROTECTED]
I'm trying to move beyond Emacs/Vim/Kate and was wondering if Eclipse is better and if it is the *best* IDE for Python. Should I leave Emacs and do Python coding in Eclipse? Chris -- http://mail.python.org/mailman/listinfo/python-list

Setting PYTHONPATH from Makefile

2005-12-02 Thread [EMAIL PROTECTED]
I have a Makefile target that uses a python script, like: %.abc: %.def python myscript.py The problem is that myscript.py and some modules that myscript.py imports are not in the current directory, but in another place in the filesystem, say, /path/to/stuff. If this was a tcsh script, I w

Re: How to creat a file?

2005-12-02 Thread [EMAIL PROTECTED]
sandorf wrote: > Thank to you all, guys. Here's another question: > > I'm using the Windows version of Python and IDLE. When I debug my .py > file, my modification to the .py file does not seem to take effect > unless I restart IDLE. Saving the file and re-importing it doesn't help > either. Where

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-02 Thread [EMAIL PROTECTED]
8:21 -0800 in comp.lang.python, [EMAIL PROTECTED] > wrote: > ... (cutted) > Of these, only (2) is valid. And the only reason it's valid is that > Python recognizes the TAB character as valid indentation. TAB > characters are evil. They should be banned from Python source code. > The

Re: Tkinter menu

2005-12-02 Thread [EMAIL PROTECTED]
> > the easiest way to do this is to create a new function object for each > file, and use default argument binding to pass in the right filename: > > for file in self.allfiles: > def callback(fname=file): > self.showFile(fname, parent) > self.showfilemenu_bar.add

distutils problem windows xp python 2.4.2

2005-12-03 Thread [EMAIL PROTECTED]
Hello I tried to combine c++ and python together. So I follow from this website: http://kortis.to/radix/python_ext/ I have this code: # prmodule.c static PyObject *pr_isprime(PyObject *self, PyObject *args){ int n, input; if (!PyArg_ParseTuple(args, "i", &input)) return

How to execute an EXE via os.system() with spaces in the directory name?

2005-12-03 Thread [EMAIL PROTECTED]
I am trying to run an exe within a python script, but I'm having trouble with spaces in the directory name. The following example will display the usage statement of the program, so I know that the space in the path to the exe is being handled correctly and that the program was executed. CMD= r'"

Re: distutils problem windows xp python 2.4.2

2005-12-04 Thread [EMAIL PROTECTED]
Hello Scott, It didn't work with visual studio 5. .Net framework 2.0 Do you have any suggestions? Thanks, pujo -- http://mail.python.org/mailman/listinfo/python-list

appending messages in imaplib

2005-12-05 Thread [EMAIL PROTECTED]
So I have the unfortunate task of migrating several hundred users from local mail (mbox and mh) up to an exchange server as part of wearisome SOX compliance nonsense. I thought the best path through this thicket would be to knock up a quick python script using imaplib to replicate folder structure

Re: distutils problem windows xp python 2.4.2

2005-12-05 Thread [EMAIL PROTECTED]
Hello, It give the same error result: D:\testprogram\distutils problem>setup build running build running build_ext *** Failed: error: The .NET Framework SDK needs to be installed before building extensions for Python. Attempting to patch distutils.msvccompiler and retry: running build running buil

Re: Eclipse best/good or bad IDE for Python?

2005-12-05 Thread [EMAIL PROTECTED]
I fear licensing issues will keep away Emacs hackers who > might otherwise switch and make the platform more usable for other > Emacs refugees. Please tell me what licensing issues you are referring to. Eclipse should be GPLv3.0 compatible I would guess. Chris -- http://mail.python.org/mailma

Re: Eclipse best/good or bad IDE for Python?

2005-12-05 Thread [EMAIL PROTECTED]
> Sure, but it was the fact that the *core* is in Java I was thinking about. > I wonder how 'closed' it is. The code is under open source license. There are open source JVMs. What is the problem then with Java code? -- http://mail.python.org/mailman/listinfo/python-list

Re: appending messages in imaplib

2005-12-05 Thread [EMAIL PROTECTED]
>On google the first link is... a Python script. >http://home.tiscali.cz:8080/~cz210552/distfiles/mbox2imap.py >And there are other entries... That appears to contain the magic I need thanks. It just use python mailbox so adding in MH support should be trivial. Then I need to add some directory

Ant (with Python extensions) good replacement for distutils?

2005-12-05 Thread [EMAIL PROTECTED]
I know distutils well but don't know anything about Ant except that it is a build tool from Apache project. Could it possible be better or as good as distutils? (There are extensions for Python.) Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils problem windows xp python 2.4.2

2005-12-06 Thread [EMAIL PROTECTED]
Hello, I have .net framework 2.0 because I' already able to run visual studio express 2005. Should I install .net framework 1.1 and also ms toolkit ? Sincerely Yours, pujo -- http://mail.python.org/mailman/listinfo/python-list

iron python exe problem

2005-12-06 Thread [EMAIL PROTECTED]
Hello, I have test.py: print 'hello' I compile using iron python the result is test.exe I have got error message when I tried to call test.exe telling that test.exe is not a valid win32 application. How can I solve this problem? Sincerely Yours, Pujo -- http://mail.python.org/mailman/listinf

Re: iron python exe problem

2005-12-06 Thread [EMAIL PROTECTED]
I use version 0.9.5 Windows xp with .net framework 2.0, visual studio Express pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: iron python exe problem

2005-12-06 Thread [EMAIL PROTECTED]
Hello, I run exactly inside IronPython-0.9.5\bin where IronPython.dll exist. I've already uninstalled my .net 1.1 so there is onle .net 2.0 pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse best/good or bad IDE for Python?

2005-12-07 Thread [EMAIL PROTECTED]
Well i use eric3 and i am pretty happy with it. Comes with integrated refactoring, unittest, python shell, project browser, version control. Do try it , avaialble under GPL. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to ping in Python?

2005-12-07 Thread [EMAIL PROTECTED]
There is also always searching the Python Cookbook (http://pythoncookbook.activestate.com/) for something like this. There is already an ICMP library there (written by me and a friend) that includes a ping function that uses the library. -Brett -- http://mail.python.org/mailman/listinfo/python-l

Re: Another newbie question

2005-12-07 Thread [EMAIL PROTECTED]
ython parse ("green", "red")[(i * 8 + j) % 2] command ... he says while reaching for "python for the semi-illiterate" ...) Again, thanks for your help. Jpl Mike Meyer wrote: > "solaris_1234" <[EMAIL PROTECTED]> writes: > > > 1)

hp-ux crash: threading within a c++ module.

2005-12-08 Thread [EMAIL PROTECTED]
[also sent to [EMAIL PROTECTED] Hi Python Experts, I am developing a Python interface to an existing (multithreaded) c++ api. I have it working on several platforms (linux, solaris, irix, windoze) but I am having a few problems with threading on hp-ux and aix platforms. Here is one of the

idea of building python module using pyrex

2005-12-09 Thread [EMAIL PROTECTED]
Hello, I have an idea to build python module to speed up python code in some of field where pyrex shines such as numeric, code which needs a lot of looping etc. What do you think? Sincerely Yours, pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: idea of building python module using pyrex

2005-12-09 Thread [EMAIL PROTECTED]
Hello, I just wonder if someone has already build it. Thanks for the response. Best Regards, pujo -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >