Re: Self-awareness of imported modules? Do they know where they live?

2005-12-14 Thread Heiko Wundram
Martin M. wrote: > So how can I do this? In AppleScript I would try something like "path > to me", but this does not work for imported scripts in AppleScript, as > you then only get the path to the main script. But can this be done in > Python? Can modules know where they are currently located, whe

Re: IsString

2005-12-14 Thread Donn Cave
Quoth Mike Meyer <[EMAIL PROTECTED]>: | Donn Cave <[EMAIL PROTECTED]> writes: ... |> Historically, the way I remember it, there was a time not too |> long ago when GvR and his minions sort of dismissed the idea |> that you needed to understand the reference/object model from |> the outset. I mean,

Self-awareness of imported modules? Do they know where they live?

2005-12-14 Thread Martin M.
Hi, I have the following question: How can an imported module see/find the path to itself? Background: From my main script I import a module which needs a file (AppleScript) located in the same directory as the imported module. What I do not want is to tell the module the location of the AppleScr

Re: How to get the local mac address?

2005-12-14 Thread bonono
Frank Millman wrote: > [EMAIL PROTECTED] wrote: > > Sorry that I can't help you in any way but have a question myself. Is > > there an OS independent way to get this thing(regardless of how to > > format it) in Python ? I know this may not matter if all you want is > > Windows but there is just a

Re: How to get the local mac address?

2005-12-14 Thread Frank Millman
[EMAIL PROTECTED] wrote: > Sorry that I can't help you in any way but have a question myself. Is > there an OS independent way to get this thing(regardless of how to > format it) in Python ? I know this may not matter if all you want is > Windows but there is just another thread talking about one

Re: set & random.choice question

2005-12-14 Thread cgriddell
Oh duh. :) Thanks for pointing out the obvious without mocking... sc -- http://mail.python.org/mailman/listinfo/python-list

Re: Online Ruby

2005-12-14 Thread Paddy
That reminds me of TclTutor: http://www.msen.com/~clif/TclTutorTour.html TclTutor is a great Tk application that teaches Tcl/Tk by having all the lessons and examples set up waiting in the app. The examples can be edited/fixed and re-executed. I still bring up TclTutor when I delve into Tcl pro

Re: quick unicode Q

2005-12-14 Thread Heiko Wundram
Erik Max Francis wrote: > Flags in the ID3 tag specify the encoding. It is not always UTF-8. > > http://www.id3.org/id3v2.4.0-structure.txt Okay... Didn't know that, and I'm pretty sure with ID3V1 this was always utf-8 in case it was unicode (which was a non-standard extension anyway). Thanks fo

Re: Python packages on OS X vs Windows

2005-12-14 Thread Kenneth McDonald
If the amount of time it saved me justified it, I wouldn't hesitate to spend250 pounds. To put it in a more measurable manner, I've found myselfspending so much time attempting to get packages compiled underUNIXes (OS X, Linux, FreeBSD, etc.) that I would have no difficultywhatsoever in spending $5

Re: Python C/API - *arg,**kwds variable argumnents

2005-12-14 Thread [EMAIL PROTECTED]
thanks, I get it now. -- http://mail.python.org/mailman/listinfo/python-list

Re: OO in Python? ^^

2005-12-14 Thread bonono
Alex Martelli wrote: > <[EMAIL PROTECTED]> wrote: > > > Alex Martelli wrote: > > > <[EMAIL PROTECTED]> wrote: > > > > > > > > those convoluted templates that were added to the language as > > > > > an afterthought. > > > > I don't see this in Haskell. > > > > > > Well, historically templates HAVE

Re: Python packages on OS X vs Windows

2005-12-14 Thread Kenneth McDonald
I've often found the Linux world to be like falling off a log,specifically, a log above a deep chasm with sharp rocksat the bottom :-)Linux has its place (though I tended to use FreeBSD more),but it's been several years since I've wanted to actually knowhow to manage my own system. I'd suggest that

Re: Python packages on OS X vs Windows

2005-12-14 Thread Mike Meyer
Scott David Daniels <[EMAIL PROTECTED]> writes: > BartlebyScrivener wrote: > The tough part on Windows (for the Linux/Unix/*ix bigots) is that > each program scans the command line that invoked it in its own > inimitable way. This is not really the fault of the windows command > line processor; th

Re: OO in Python? ^^

2005-12-14 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Alex Martelli wrote: > > <[EMAIL PROTECTED]> wrote: > > > > > > those convoluted templates that were added to the language as > > > > an afterthought. > > > I don't see this in Haskell. > > > > Well, historically templates HAVE been added to Haskell "as an > > aftertho

Re: OO in Python? ^^

2005-12-14 Thread bonono
Alex Martelli wrote: > <[EMAIL PROTECTED]> wrote: > > > > those convoluted templates that were added to the language as > > > an afterthought. > > I don't see this in Haskell. > > Well, historically templates HAVE been added to Haskell "as an > afterthought" (well after the rest of the language wa

Re: OO in Python? ^^

2005-12-14 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > > those convoluted templates that were added to the language as > > an afterthought. > I don't see this in Haskell. Well, historically templates HAVE been added to Haskell "as an afterthought" (well after the rest of the language was done), and judging mostly from

Re: PHP = Perl Improved

2005-12-14 Thread John Bokma
Martin Christensen <[EMAIL PROTECTED]> wrote: > Perl, too, since he doesn't seem to understand it when people tell him > to bugger off in plain English. "It" buggers off if everybody ignores it. "It" posts because it knows that its actions pisses off so many people. -- John S

Re: ActivePython and Amara

2005-12-14 Thread alex23
Jay wrote: > [T]here are multiple items in channel, how do i tell it to > go to the next item and get that title?? channel = rssDigg.find('//channel') for item in channel.findall('item'): print item.find('title').text -alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I bind to scrollbar?

2005-12-14 Thread James Stroud
Nicholas Shewmaker wrote: > (I apologize if this posts twice. My AVG is being fussy.) > > From what I've read, MouseWheel is a very tricky event. I have > replaced my Python tcl84.dll and tk84.dll files with those in the > ActiveTcl distribution to fix the crashes caused by the event. Then, I

Re: ActivePython and Amara

2005-12-14 Thread Jay
really quick question, if you look at the XML doc of digg.com then you will see that there are multiple items in channel, how do i tell it to go to the next item and get that title?? title2 = rssDigg.find("//channel/item//title").text Didnt work title2 = rssDigg.find("//channel/item[1]/title"

Re: Optimize function similiar to dict.update() but adds common values

2005-12-14 Thread Gregory Piñero
OK, I ran Peter's add_freq3 and it ran four times on really large dictionaries in about 3000 seconds. So I'd say that at a minimum that's ten times faster than my original function since it ran all last night and didn't finish. Much obliged, Peter! -Greg On 12/14/05, Gregory Piñero <[EMAIL PRO

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

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 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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: 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

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 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

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: 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: 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: 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: 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: 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: 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: 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: 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: 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

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

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,

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,

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: ?: 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

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: 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

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: 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: 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: ?: 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: 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: 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: 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: 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

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: 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("

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: 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

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: 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

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: 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: 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: 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: 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

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: 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

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

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: 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

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: 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: 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: 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: 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: 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: 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: 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

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: 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

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: 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: 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: 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: 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 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: 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: ?: 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: "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

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

  1   2   3   4   >