Re: Simple (?) question about print statement

2005-12-14 Thread Grant Edwards
On 2005-12-14, TY <[EMAIL PROTECTED]> wrote: > for i in range(10): > for j in range(500): pass # Timing-delay loop > print i, > > Now it does this: > > then prints 0 1 2 3 4 5 6 7 8 9 all at once. > > Why? > > How can I make it to print each numbers on the same line with pauses

Re: Simple (?) question about print statement

2005-12-14 Thread Pelmen
sorry ... i don'understand a question from first read my previos aswer is not an aswer at all -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple (?) question about print statement

2005-12-14 Thread Fredrik Lundh
"TY" <[EMAIL PROTECTED]> wrote: > I have this little simple script: > > for i in range(10): > for j in range(500): pass # Timing-delay loop > print i > > When you run it, it behaves as you would expect -- it prints 0 > on the next line prints 1 on the next line prints 2 > etc. >

Re: ?: in Python

2005-12-14 Thread Bengt Richter
On Wed, 14 Dec 2005 21:16:23 +0100, Lawrence Oluyede <[EMAIL PROTECTED]> wrote: >Il 2005-12-14, Andy Leszczynski <[EMAIL PROTECTED]> ha scritto: >> How can do elegantly in Python: >> >> if condition: >> a=1 >> else: >> a=2 >> >> like in C: >> >> a=condition?1:2 >> > >There are tons of thre

Re: IsString

2005-12-14 Thread Steven D'Aprano
On Wed, 14 Dec 2005 12:51:43 -0500, Mike Meyer wrote: > To restate the first paragraph: Python's calling semantics are a > proper subset of call-by-reference. If the object passed has the same > behavior as it does in a call-by-reference lanuage, then the behavior > of the argument is the same as

Re: ?: in Python

2005-12-14 Thread gene tani
Andy Leszczynski wrote: > How can do elegantly in Python: > > if condition: > a=1 > else: > a=2 > > like in C: > > a=condition?1:2 google for ternary operator http://www.python.org/doc/faq/programming.html#is-there-an-equivalent-of-c-s-ternary-operator http://www.norvig.com/python-iaq.ht

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Neil Hodgson
S.Chang: > Anyone knows the difference(s) between the Python binaries from > ActiveState and Python.org? As well as the differences mentioned by others, ActivePython does not include SSL (Secure Socket Layer) and thus HTTPS support. It would be helpful if the ActivePython "What's Included"

Re: to write set of values to a file from python

2005-12-14 Thread muttu2244
hi dennis, thanks for the help, itseems its good way to go. i tried it, and i liked the idea, but there is one problem with it. its printing each character in a seperate row where as i wanteach string in a seperate column? so how can i do that?? Any help for this. thanks and regards yogi

Re: ?: in Python

2005-12-14 Thread Peter Hansen
Andy Leszczynski wrote: > Lawrence Oluyede wrote: >>There are tons of threads on this newsgroup and in the python-dev mailing >>list about a ternary operator. There's also a PEP AFAIK. >> >>I like this: >> >>In [1]:switch = True >> >>In [2]:a = (1, 2)[switch] >> >>In [3]:print a >>2 > > Like it to

Re: Simple (?) question about print statement

2005-12-14 Thread Grant Edwards
On 2005-12-14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > try this instead: > > import time, sys > > for i in range(10): > time.sleep(0.8) # seconds; tune as necessary > print i, > sys.stdout.flush() # flush stdout > print Is mixing print and sys.stdout.X n

Online Ruby

2005-12-14 Thread bearophileHUGS
Maybe a page like this for Python exists already, or it can be useful to create it: http://tryruby.hobix.com/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: const objects (was Re: Death to tuples!)

2005-12-14 Thread Steven D'Aprano
On Wed, 14 Dec 2005 18:35:51 +, Tom Anderson wrote: > On Wed, 14 Dec 2005, Steven D'Aprano wrote: > >> On Wed, 14 Dec 2005 10:57:05 +0100, Gabriel Zachmann wrote: >> >>> I was wondering why python doesn't contain a way to make things "const"? >>> >>> If it were possible to "declare" variables

Re: Recommend an E-book Meeting the Following Criteria (Newbie, Long)

2005-12-14 Thread gene tani
Veli-Pekka Tätilä wrote: > 5. Before I let you go I should mention one important factor in choosing the > book. I know this narrows down the scope loads, but if at all possible the > book should be readily available in electronic form. My favorite formats > are: CHM, TXT, HTML, accessible PDF and

Re: how to get select label?

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > Sorry , I forget to say that. I use CGI, HTML and python. Why you need to get the text value, don't you have it when you create the page? ps. do you really need CGIs ? -- Lawrence - http://www.oluyede.org/blog "Anyone can freel

Re: Simple (?) question about print statement

2005-12-14 Thread Fredrik Lundh
Grant Edwards wrote: > > try this instead: > > > > import time, sys > > > > for i in range(10): > > time.sleep(0.8) # seconds; tune as necessary > > print i, > > sys.stdout.flush() # flush stdout > > print > > Is mixing print and sys.stdout.X never a problem

Re: set & random.choice question

2005-12-14 Thread Dennis Benzinger
[EMAIL PROTECTED] schrieb: > I want to do something like this: > > from random import choice > x = set(("jenny", "jacqui", "claire", "chris", "tracy")) > somebody = random.choice(x) > > but I bet a "TypeError: unindexable object" error. Any suggestions for > an elegant workaround? > > I'm

Re: to write set of values to a file from python

2005-12-14 Thread Dennis Benzinger
[EMAIL PROTECTED] schrieb: > [...] > its printing each character in a seperate row where as > i wanteach string in a seperate column? > > so how can i do that?? Any help for this. > [...] Could you post your code here? Or explain what you did exactly. Bye, Dennis -- http://mail.python.o

Re: Simple (?) question about print statement

2005-12-14 Thread Grant Edwards
On 2005-12-14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > >> > try this instead: >> > >> > import time, sys >> > >> > for i in range(10): >> > time.sleep(0.8) # seconds; tune as necessary >> > print i, >> > sys.stdout.flush() # flush stdout >>

Re: Question about tuple lengths

2005-12-14 Thread Steven D'Aprano
On Wed, 14 Dec 2005 09:54:31 -0800, Carl J. Van Arsdall wrote: > > From my interpreter prompt: > > >>> tuple = ("blah") There is a special place in Hell reserved for people who overwrite built-in functions like tuple(), list(), str() and so forth. *wink* > >>> len(tuple) > 4 Brackets on t

Re: ?: in Python

2005-12-14 Thread Steven D'Aprano
On Wed, 14 Dec 2005 14:09:10 -0500, Andy Leszczynski wrote: > How can do elegantly in Python: > > if condition: > a=1 > else: > a=2 > > like in C: > > a=condition?1:2 I thought you wanted to do it *elegantly*? Your first solution is perfectly elegant to my eyes, unlike that horrible C

Re: how to get select label?

2005-12-14 Thread lli
I build web application. So I use CGI. I need to show select text in the html page. Now I can only display select value such as '001'. But I need to display its text 'AAA'. LLI -- http://mail.python.org/mailman/listinfo/python-list

SVG rendering with Python

2005-12-14 Thread Dennis Benzinger
Hi! Does anybody know of a SVG rendering library for Python? Bye, Dennis -- http://mail.python.org/mailman/listinfo/python-list

Re: "0 in [True,False]" returns True

2005-12-14 Thread bonono
Mike Meyer wrote: > [EMAIL PROTECTED] writes: > > Steve Holden wrote: > >> >>It would be somewhat more self-documenting, but why not just use one > >> >>name to indicate the state and another, only meaningful in certain > >> >>states, to indicate the callback? > >> > Why should I do that? Checking

Re: ?: in Python

2005-12-14 Thread bonono
Andy Leszczynski wrote: > How can do elegantly in Python: > > if condition: > a=1 > else: > a=2 > > like in C: > > a=condition?1:2 a=(condition and [1] or [2])[0] For this simple snippet, I don't think it is better than if/else, But you can use it in map/reduce or list comprehension/gene

Re: IsString

2005-12-14 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Ben Sizer" <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > def modify_in_place(obj): > > """Modify an arbitrary object in place.""" > > obj = None > > > > x = [1, 2, 3] # mutable object > > modify_in_place(x) > > assert x is None > > > > > > Doesn't

Re: how to get select label?

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > I build web application. So I use CGI. I need to show select text in > the html page. Now I can only display select value such as '001'. But I > need to display its text 'AAA'. There are tons of way to build web apps in Python and

Re: SVG rendering with Python

2005-12-14 Thread richard
Dennis Benzinger wrote: > Does anybody know of a SVG rendering library for Python? Google "python svg" Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the local mac address?

2005-12-14 Thread Daniel Crespo
Hi, Scott, Thanks for your answer >> Hi, I tried: ... >> # Convert binary data into a string. >> macaddr = '' >> for intval in struct.unpack('BB', buffer): >> if intval > 15: >> replacestr = '0x' >> else: >> replacestr = 'x' >> macad

Re: to write set of values to a file from python

2005-12-14 Thread muttu2244
I have tried with the following code import csv file = open("some.csv","wb") writer = csv.writer(file) list = ["CompName", "IpAddr", "MacAddr","OpSys"] for row in list: writer.writerow(row) file.close() And the result am getting in a "some.csv" file is as below c o m p N a m e I

Re: disassemble, was(How do (not) I distribute my Python progz?)

2005-12-14 Thread Juergen Kareta
Hi Paul, I had looked to the same link and downloaded the package. Maybe I'll give it a try at the christmas holidays - hope so ;-) Thanks Jürgen -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get select label?

2005-12-14 Thread Yuri
[EMAIL PROTECTED] wrote: > I built a select in a form. My select is: > print '' > print 'ALL' > print 'AAA' > print 'BBB' > print '' > > I can get which item value users select. For example users select item > 2, I can get its value "001"

Re: IsString

2005-12-14 Thread Fredrik Lundh
Donn Cave wrote: > While I agree (with another post) that there seems to be > a difference in perspective that depends on what language > you were using when you first heard these terms, in the > end it really seems sort of almost disingenuous to argue > that the "value" in question is actually a

access to preallocated block of memory?

2005-12-14 Thread Greg Copeland
I am running python on VxWorks. In the course of operation, a vxworks tasks writes to a reserved area of memory. I need access to this chunk of memory from within python. Initially I thought I could simply access it as a string but a string would reallocate and copy this chunk of memory; which i

Re: Still Loving Python

2005-12-14 Thread Valentino Volonghi aka Dialtone
Paul Rubin wrote: > Glade also does something like that. Indeed. I'd also add some lines on this. There is a very nice designer for GTK+ applications called Gazpacho, written in python and available here: http://gazpacho.sicem.biz/ It generates an XML file in the same

Re: to write set of values to a file from python

2005-12-14 Thread Lawrence Oluyede
Il 2005-12-14, [EMAIL PROTECTED] <[EMAIL PROTECTED]> ha scritto: > I have tried with the following code > > import csv > file = open("some.csv","wb") > writer = csv.writer(file) > list = ["CompName", "IpAddr", "MacAddr","OpSys"] > for row in list: > writer.writerow(row) > > file.close() writer

Re: disassemble, was(How do (not) I distribute my Python progz?)

2005-12-14 Thread gene tani
Paul Boddie wrote: > Juergen Kareta wrote: > > look at: > > http://www.crazy-compilers.com/decompyle/ > > > > it's only a online service. But if it works, it would be nice to have > > such a tool as standalone programm. > > And the next search result for decompyle on Google is... > > http://packag

Re: Still Loving Python

2005-12-14 Thread Mike Meyer
[EMAIL PROTECTED] (Bengt Richter) writes: > On Wed, 14 Dec 2005 10:07:04 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >>[EMAIL PROTECTED] (Bengt Richter) writes: >>> A single click compiles, links and runs the resulting independent windows >>> .exe in a fraction of a second >>> for the above, and

Re: Simple (?) question about print statement

2005-12-14 Thread TY
So I guess then my next question is why does adding comma to print statement cause buffering, but not when you don't have comma? -- http://mail.python.org/mailman/listinfo/python-list

Re: definition of 'polymorphism' and python

2005-12-14 Thread Mike Meyer
"gene tani" <[EMAIL PROTECTED]> writes: > Grant Edwards wrote: >> On 2005-12-14, Gabriel Zachmann <[EMAIL PROTECTED]> wrote: >> > I understand the Wikipedia article on Polymorphism ( >> > http://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29 >> > ) that it doesn't make sense to talk abou

Re: to write set of values to a file from python

2005-12-14 Thread muttu2244
thanks lawrence it did work. and i have one more question for you its printing the feilds name in the following way CompName IpAddr MacAddr that means each row its printing one field name, can i make it to print each one of the field in different columns, in this way CompName

Re: Simple (?) question about print statement

2005-12-14 Thread Dan M
On Wed, 14 Dec 2005 15:27:58 -0800, TY wrote: > So I guess then my next question is why does adding comma to print > statement cause buffering, but not when you don't have comma? Because of the line buffering. If you don't have a comma at the end, the print statement prints the numeric value and

Re: lambda (and reduce) are valuable

2005-12-14 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Christopher Subich wrote: > Chris Mellon wrote: >> functions with real names is crucial to maintainable code. The only >> reason to ever use a lamdba in Python is because you don't want to >> give a function a name, and that is just not a compelling use case for >> GUI even

bug? file.write('\n') produces a carriage return and a line feed

2005-12-14 Thread jcb
The following code in Python 2.3 f = file('t.txt', 'wt') f.write('\n') f.close() writes 0D0A to the file. Is this a bug or expected behavior? It sure took me by surprise. If it is not a bug, is this behavior documented? -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Trent Mick
[S.Chang wrote] > Anyone knows the difference(s) between the Python binaries from > ActiveState and Python.org? The responses to this thread so far gave most of the differences. In summary: - On Windows, ActivePython includes the PyWin32 extensions. - ActivePython rolls the core Python docs and

Re: bug? file.write('\n') produces a carriage return and a line feed

2005-12-14 Thread Heiko Wundram
[EMAIL PROTECTED] wrote: > ... > 0D0A to the file. > > Is this a bug or expected behavior? > It sure took me by surprise. You're running Windows, right? Then, this is expected behaviour, as Windows treats text and binary files different, extending \n to \r\n (as that is the Windows end of line

quick unicode Q

2005-12-14 Thread John Morey
I have a variable that contains a string which may or may not include unicode characters, I understand that I declare a unicode string like this u'whatever' , the question is that when that string is read in from an external source (in this case an id3 tag) how do I make the interpretter understan

Re: quick unicode Q

2005-12-14 Thread Erik Max Francis
John Morey wrote: > I have a variable that contains a string which may or may not include > unicode characters, I understand that I declare a unicode string like this > u'whatever' , the question is that when that string is read in from > an external source (in this case an id3 tag) how do I make

Re: bug? file.write('\n') produces a carriage return and a line feed

2005-12-14 Thread jcb
Thanks much. Yes, I am using Windows. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to get select label?

2005-12-14 Thread Dan M
On Wed, 14 Dec 2005 13:56:24 -0800, lli wrote: > I build web application. So I use CGI. I need to show select text in > the html page. Now I can only display select value such as '001'. But I > need to display its text 'AAA'. > > LLI I'm a Python newbie, so by all means verify this answer with m

Re: Still Loving Python

2005-12-14 Thread Paul Boddie
J�r�me Laheurte wrote: > > P.S. Why does Google Groups have to mangle J�r�me's name > > I didn't see anything wrong... Encoding problem ? The preview and subsequent re-editing page typically show trashed non-ASCII characters in Konqueror, which doesn't usually show such brokenness on the pages I v

Re: quick unicode Q

2005-12-14 Thread Heiko Wundram
Erik Max Francis wrote: > Read it as a string, and then decode it with the .decode method. You > specify what encoding it's in. Most probably, the OP is asking what to do with an UTF-8 encoded string. To decode that, just use: s.decode("utf-8") to get a unicode string object. Example: >>> s

Re: quick unicode Q

2005-12-14 Thread Erik Max Francis
Heiko Wundram wrote: > Most probably, the OP is asking what to do with an UTF-8 encoded string. > > To decode that, just use: > > s.decode("utf-8") > > to get a unicode string object. Flags in the ID3 tag specify the encoding. It is not always UTF-8. http://www.id3.org/id3v2.4.0-stru

Newbie question - deleting records from anydbm database

2005-12-14 Thread Dan M
I've been Googling like a mad fiend and flipping through my hard-copy Python books, but still haven't located the one little bit of info I need. I've put together a simple SMTP-after-IMAP script that gets the authorized IP info from the mail log (I know, it's not elegant but it works). All works f

Re: Bad marshal data

2005-12-14 Thread Michael McGarry
Pickle is working well for me. I do not need speed or small file size. Flexibility is more important for me. If speed was important I would write the app in C. -- http://mail.python.org/mailman/listinfo/python-list

Re: Horribly noobful string question

2005-12-14 Thread SeNTry
"Xavier Morel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Fredrik Lundh wrote: >> "SeNTry" wrote: >> >>> My first post here as I just begin to learn programming in general and >>> python in particular. I have all the noobie confused questions, but as >>> I >>> work thru the t

Re: Horribly noobful string question

2005-12-14 Thread SeNTry
SRY, that last bit of code got messed up. Hopefully it will look right now... #define two functions first, then use them. def loopfunc(looping): while looping: guess= input("guess a number. see if you can guess what I'm thinking") if guess == number: print "you got it!" looping=False playagain("

Test the system is despised.

2005-12-14 Thread James Stroud
I know this is despised, but I am actually testing this list with an email. If you knew the circles I've been running around trying to get UCLA to fix their news server for the c.l.python list, you would not blame me. The hours I've wasted on this. I just want to be able to use this list with a

Re: Test the system is despised.

2005-12-14 Thread James Stroud
James Stroud wrote: > I know this is despised, but I am actually testing this list with an > email. If you knew the circles I've been running around trying to get > UCLA to fix their news server for the c.l.python list, you would not > blame me. The hours I've wasted on this. I just want to be a

Re: writing a Mail Server

2005-12-14 Thread sujata
Thank you to everyone. Looks like, I have got reading to do. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie question - deleting records from anydbm database

2005-12-14 Thread Steve Holden
Dan M wrote: > I've been Googling like a mad fiend and flipping through my hard-copy > Python books, but still haven't located the one little bit of info I need. > > I've put together a simple SMTP-after-IMAP script that gets the authorized > IP info from the mail log (I know, it's not elegant but

Re: PHP = Perl Improved

2005-12-14 Thread Martin Christensen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > "Tin" == Tin Gherdanarra <[EMAIL PROTECTED]> writes: Tin> Xah Lee wrote: >> recently i got a project that involves the use of php. In 2 days, i >> read almost the entirety of the php doc. Finding it a breeze >> because it is roughly based on Per

Re: ?: in Python

2005-12-14 Thread Andy Leszczynski
Steven D'Aprano wrote: > On Wed, 14 Dec 2005 14:09:10 -0500, Andy Leszczynski wrote: > > >>How can do elegantly in Python: >> >>if condition: >>a=1 >>else: >>a=2 >> >>like in C: >> >>a=condition?1:2 > > > I thought you wanted to do it *elegantly*? > > Your first solution is perfectly e

Re: IsString

2005-12-14 Thread Tuvas
I don't know if I can help with this much, I'm still somewhat new to python, but it is my understanding that "simple" variable, ei, strings, ints, etc, although they don't have such names, behave like variables, ei, if you pass them to a function, the function will copy them into a new spot. Howeve

Re: access to preallocated block of memory?

2005-12-14 Thread Do Re Mi chel La Si Do
>>> vxworks tasks writes to a reserved area of memory. Is it compatible with the mmap module ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Xah's Edu Corner: Examples of Quality Technical Writing

2005-12-14 Thread javuchi
Why do you have such a need of being hating everything and everybody and expressing it so offen? Can you live without hate? Can you let others live without your hates? -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-14 Thread Mike Meyer
[Not sure if this attribution is correct.] > Alex Martelli wrote: > Because of course if other languages have 1 or two frameworks, python > needs a dozen. People keep talking about Python's wealth of web frameworks as if it were a bad thing. I just don't see it. Just like I like to have more than

iniciante

2005-12-14 Thread tetri
alguém recomenda algum material disponível na internet para iniciar os estudos em python? outra coisa, peço que brasileiros (ou ao menos aqueles que me entendem) se identifiquem, assim podemos começar discussões em português mesmo, o que acham? -- http://mail.python.org/mailman/listinfo/python-li

Re: ?: in Python

2005-12-14 Thread Steven Bethard
Andy Leszczynski wrote: > How can do elegantly in Python: > > if condition: >a=1 > else: >a=2 > > like in C: > > a=condition?1:2 Step (1): Wait for Python 2.5[1] Step (2): Write the code:: a = 1 if condition else 2 STeVe [1]http://www.python.org/peps/pep-0308.html -- http://mai

Re: Worthwhile to reverse a dictionary

2005-12-14 Thread Mike Meyer
Erik Max Francis <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: >> What is the difference between >> " d1 = {'A' : '1', 'B' : '2', 'C' : '3'} " >> and >> " d1 = dict(A = 1, B = 2, C = 3) " ? >> All of the dictionary examples I saw (python.org, >> aspn.activestate.com, >> Learning Python b

Re: IsString

2005-12-14 Thread Mike Meyer
Tom Anderson <[EMAIL PROTECTED]> writes: >> Python does call by reference, which means that it passes pointers >> to objects by value. > That's not what call by reference is - call by reference is passing > pointers to *variables* by value. In which case, Python can't do call-by-reference at all,

Python packages on OS X vs Windows

2005-12-14 Thread Kenneth McDonald
At the moment I'm doing most of my stuff on a Mac, but I've been considering also getting a Windows laptop. One of the reasons is that I've found it very difficult to get certain Python related things running on the Mac; for example, if one wants to use the most up-to-date Python on the mac,

Questions about working with character encodings

2005-12-14 Thread Kenneth McDonald
I am going to demonstrate my complete lack of understanding as to going back and forth between character encodings, so I hope someone out there can shed some light on this. I have always depended on the kindness of strangers... :-) I'm playing around with some very simplistic french to englis

Re: OO in Python? ^^

2005-12-14 Thread bonono
Donn Cave wrote: > Really, this kind of abstraction of data types is not only well > supported in Haskell, it can be almost a curse, at least for > someone like myself who has fairly superficial experience with > this kind of programming. After all the functions have been > zealously scrubbed cle

Re: IsString

2005-12-14 Thread Mike Meyer
Donn Cave <[EMAIL PROTECTED]> writes: > I would like to argue that "value" basically means the > computational effect. In "s = a + b", the value of "b" > is whatever ends up applied to that "+" operator. In > isolation, the value of some object is its computational > potential - the object isn't

Re: lambda (and reduce) are valuable

2005-12-14 Thread bonono
Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Christopher Subich wrote: > > > Chris Mellon wrote: > >> functions with real names is crucial to maintainable code. The only > >> reason to ever use a lamdba in Python is because you don't want to > >> give a function a name, and that is ju

Re: Online Ruby

2005-12-14 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Maybe a page like this for Python exists already, or it can be useful > to create it: > http://tryruby.hobix.com/ Working on it, in my spare time (~1hr/day). You can poke at it at http://www.mired.org/home/mwm/try_python/, but it's *very* much not ready for release.

Re: access to preallocated block of memory?

2005-12-14 Thread Grant Edwards
On 2005-12-15, Do Re Mi chel La Si Do <[EMAIL PROTECTED]> wrote: vxworks tasks writes to a reserved area of memory. > > Is it compatible with the mmap module ? I've never written a VxWorks module, but it would only take a dozen or two lines of code to write a Linux driver that would impliment

Re: Test the system is despised.

2005-12-14 Thread Grant Edwards
On 2005-12-15, James Stroud <[EMAIL PROTECTED]> wrote: > I know this is despised, but I am actually testing this list with an > email. If you knew the circles I've been running around trying to get > UCLA to fix their news server for the c.l.python list, you would not > blame me. The hours I've

Re: how to get select label?

2005-12-14 Thread Mike Meyer
Dan M <[EMAIL PROTECTED]> writes: > On Wed, 14 Dec 2005 13:56:24 -0800, lli wrote: >> I build web application. So I use CGI. I need to show select text in >> the html page. Now I can only display select value such as '001'. But I >> need to display its text 'AAA'. > I'm a Python newbie, so by all m

Re: newbie: generate a function based on an expression

2005-12-14 Thread Jacob Rael
Thanks for all the suggestions and comments!! I will try all those suggestions just to I can figure out how they work. For phase 1 of this project, I will probably go with the eval. thanks again, happy hacking... jr -- http://mail.python.org/mailman/listinfo/python-list

Re: IsString

2005-12-14 Thread bonono
Tuvas wrote: > I don't know if I can help with this much, I'm still somewhat new to > python, but it is my understanding that "simple" variable, ei, strings, > ints, etc, although they don't have such names, behave like variables, > ei, if you pass them to a function, the function will copy them i

Re: IsString

2005-12-14 Thread Mike Meyer
"Tuvas" <[EMAIL PROTECTED]> writes: > I don't know if I can help with this much, I'm still somewhat new to > python, but it is my understanding that "simple" variable, ei, strings, > ints, etc, although they don't have such names, behave like variables, > ei, if you pass them to a function, the fun

Re: Python packages on OS X vs Windows

2005-12-14 Thread Dan Sommers
On Wed, 14 Dec 2005 20:50:47 -0600, Kenneth McDonald <[EMAIL PROTECTED]> wrote: > ... I've found it very difficult to get certain Python related things > running on the Mac ... if one wants to go PyQT/wxPy/etc, it can get > even worse with trying to get all the compiling/linking to work. Have you

Re: Python packages on OS X vs Windows

2005-12-14 Thread Mike Meyer
Kenneth McDonald <[EMAIL PROTECTED]> writes: > At the moment I'm doing most of my stuff on a Mac, but I've been > considering also getting > a Windows laptop. One of the reasons is that I've found it very > difficult to get certain > Python related things running on the Mac; for example, if one wan

ANN: SPE 0.8.1.b Python IDE (complete rewrite for running files)

2005-12-14 Thread SPE - Stani's Python Editor
Release news from http://pythonide.stani.be This release is the result of a complete rewrite of the run system. It's now possible to run multi-threaded applications (like wxPython, gtk, ...) with SPE and still control them through the debugger. Also selected text can be executed in the shell. Rea

Re: Python packages on OS X vs Windows

2005-12-14 Thread SPE - Stani's Python Editor
With some good guidance, it goes much more smooth than I thought, even for a total Mac newbie like me. For example to install the latest Python 2.4.2 and wxPython2.6 on the Mac was very easy. You can find instructions in the SPE Python IDE manual and also how to install SPE on the Mac in case you w

Re: Xah's Edu Corner: Examples of Quality Technical Writing

2005-12-14 Thread Luc The Perverse
"javuchi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why do you have such a need of being hating everything and everybody > and expressing it so offen? > Can you live without hate? > Can you let others live without your hates? A person can live without hate, living love and wor

Re: Bad marshal data

2005-12-14 Thread Alex Martelli
Michael McGarry <[EMAIL PROTECTED]> wrote: > Pickle is working well for me. I do not need speed or small file size. > Flexibility is more important for me. If speed was important I would > write the app in C. Coding an app in C which writes very large text files would probably be the wrong choice

Re: How to get the local mac address?

2005-12-14 Thread bonono
Daniel Crespo wrote: > Hi, I tried: > > import ctypes > import socket > import struct > > def get_macaddress(host): > """ Returns the MAC address of a network host, requires >= WIN2K. > """ > > # Check for api availability > try: > SendARP = ctypes.windll.Iphlpapi.SendARP >

Re: Test the system is despised.

2005-12-14 Thread James Stroud
Grant Edwards wrote: > On 2005-12-15, James Stroud <[EMAIL PROTECTED]> wrote: > > >>I know this is despised, but I am actually testing this list with an >>email. If you knew the circles I've been running around trying to get >>UCLA to fix their news server for the c.l.python list, you would not

Re: Test the system is despised.

2005-12-14 Thread Robert Kern
James Stroud wrote: > This I don't know. Please elucidate. I guess I could find one by google, > eventually, but a recommendation from the list might save a lot of time > for me in terms of the testing cycle. E.g., I've already tested one that > should be bonafide and you know the result... I

Re: to write set of values to a file from python

2005-12-14 Thread Bengt Richter
On 14 Dec 2005 15:39:02 -0800, [EMAIL PROTECTED] wrote: >thanks lawrence >it did work. >and i have one more question for you > >its printing the feilds name in the following way > >CompName >IpAddr >MacAddr > >that means each row its printing one field name, can i make it to print >each one of the

Re: Python packages on OS X vs Windows

2005-12-14 Thread Alex Martelli
Kenneth McDonald <[EMAIL PROTECTED]> wrote: > At the moment I'm doing most of my stuff on a Mac, but I've been > considering also getting > a Windows laptop. One of the reasons is that I've found it very > difficult to get certain > Python related things running on the Mac; for example, if one

Re: Python packages on OS X vs Windows

2005-12-14 Thread Bugs
Have you tried the ActiveState version of Python? http://www.activestate.com/Products/Download/Download.plex?id=ActivePython -- http://mail.python.org/mailman/listinfo/python-list

Can I use win32 COM object in a thread?

2005-12-14 Thread Pelmen
When I try to call a method of COM object, it return error about "There wasn't 'CoInitialize' call", or if I use thread, I have to access COM object methods in other way? thanks for any help -- http://mail.python.org/mailman/listinfo/python-list

Re: Test the system is despised.

2005-12-14 Thread Grant Edwards
On 2005-12-15, James Stroud <[EMAIL PROTECTED]> wrote: >> Why insist on using broken news servers? There are plenty of >> free news servers that carry c.l.p, you know. > > This I don't know. Please elucidate. I guess I could find one > by google, eventually, but a recommendation from the list > mi

Re: Python packages on OS X vs Windows

2005-12-14 Thread BartlebyScrivener
> And on a somewhat related note, do people find ipython to be a decent > replacement > on Windows for the fact that the Windows shell is braindead? I'm curious about this part of the post. Any fluent Pythoners actually happy using Windows XP and, if so, do they use ipython as a kind of bash shell

Re: Python packages on OS X vs Windows

2005-12-14 Thread Scott David Daniels
BartlebyScrivener wrote: > I'm curious about this part of the post. Any fluent Pythoners actually > happy using Windows XP and, if so, do they use ipython as a kind of > bash shell substitute? Other alternatives to compensate for the widely > derided command line in windows? The widely derided comm

Re: Can I use win32 COM object in a thread?

2005-12-14 Thread Pelmen
Sorry for post, answer was near ... just do search 2. Ixokai From: "Ixokai" <[EMAIL PROTECTED]> Mon, 9 Feb 2004 11:05:08 -0800 Basically, adodbapi uses COM, and COM and threads require a bit of care, apparently. Your webkit thing may be using a thread to handle stuff. import pythoncom python

Re: Python packages on OS X vs Windows

2005-12-14 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Kenneth McDonald <[EMAIL PROTECTED]> wrote: . . . >And on a somewhat related note, do people find ipython to be a decent >replacement >on Windows for the fact that the Windows shell is brainde

<    1   2   3   4   >