-fno-strict-aliasing turned off when cross compiling

2008-01-16 Thread Squat'n Dive
Does anyone have an idea why -fno-strict-aliasing is turned off when cross compiling? in configure generated for 2.4.4: case $GCC in yes) # Python violates C99 rules, by casting between incompatible # pointer types. GCC may generate bad code as a result of that, # so use -fno-strict-a

Hebrew in idle ans eclipse (Windows)

2008-01-16 Thread iu2
Hi all, I'll realy appreciate your help in this: I read data from a database containg Hebrew words. When the application is run from IDLE a word looks like this, for example: \xe8\xe9\xe5 But when I run the same application from eclipse or the Windows shell I get the 'e's replaced with '8's: \x8

Re: Creating unique combinations from lists

2008-01-16 Thread Tim Chase
>> for a in range(5): > ... >>for z in range(5): > > means the inner loop runs 5**26 times so perhaps it's not only > unpythonic but also uncomputable... only if you're impatient ;) yes, it was a contrived pessimal example. It could be range(2) to generate boolean

Re: read_nonblocking error in pxssh

2008-01-16 Thread Sean DiZazzo
Just glanced at the docs, but it might be worth a shot... try: > >>> import pxssh > >>> s=pxssh.pxssh() > >>> s.login("myhost","root","mypass", auto_prompt_reset=False) Maybe??? Otherwise, I have used and modified this script with great success: (ssh_session.py) http://www.koders.com/python/f

Re: import from question

2008-01-16 Thread Tobiah
> Again, those aren't copies. There is only one instance of each value, > referenced by multiple names. Ok, I get it. I was locally importing a pointer to an integer which is really the same object as the module name points to, but the assignment changes that. The confusion for me centered aro

Re: Re: scope question in a switch mixin

2008-01-16 Thread browerg
John, Thanks for writing, and I'm sorry it's taken so long to get back to you. Python is fun for me -- dinner guests and my boss got in the way. >> The code ... is the result of noodling around with switches as a learning >> tool. I've played with python for a few years, but I'm self-taught, so

Re: ElementTree and namespaces in the header only

2008-01-16 Thread Peter Bengtsson
On Jan 15, 5:22 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Peter Bengtsson wrote: > > root = Element('feed', xmlns='http://www.w3.org/2005/Atom') > > root.set('xmlns:se', NS_URL) > > entry = SubElement(root, 'entry') > > SubElement(root, 'title').text = 'Title' > > SubElement(entry, SEN('catego

Re: Python too slow?

2008-01-16 Thread Jaimy Azle
"Paul Boddie" <[EMAIL PROTECTED]> wrote: > I think the benefits of running Java on CPython are significantly less > than those had by running Python on the Java VM (or another VM). > Firstly, who wants to write statically typed code which then runs on a > virtual machine that can't take advantage

next line (data parsing)

2008-01-16 Thread robleachza
Hi there, I'm struggling to find a sensible way to process a large chuck of data--line by line, but also having the ability to move to subsequent 'next' lines within a for loop. I was hoping someone would be willing to share some insights to help point me in the right direction. This is not a file,

Re: anti-spam policy for c.l.py?

2008-01-16 Thread Dustan
On Jan 16, 11:31 am, _wolf <[EMAIL PROTECTED]> wrote: > On Jan 16, 3:11 pm, Bruno Desthuilliers > [EMAIL PROTECTED]> wrote: > > Jeroen Ruigrok van der Werven a écrit : > > > > -On [20080116 12:51], Bruno Desthuilliers ([EMAIL PROTECTED]) wrote: > > &

Re: next line (data parsing)

2008-01-16 Thread Paul McGuire
On Jan 16, 6:54 pm, [EMAIL PROTECTED] wrote: > Hi there, > I'm struggling to find a sensible way to process a large chuck of > data--line by line, but also having the ability to move to subsequent > 'next' lines within a for loop. I was hoping someone would be willing > to share some insights to he

Re: import from question

2008-01-16 Thread Steven D'Aprano
On Wed, 16 Jan 2008 15:31:54 -0800, Tobiah wrote: >> Again, those aren't copies. There is only one instance of each value, >> referenced by multiple names. > > > Ok, I get it. I was locally importing a pointer to an integer Really? What language were you using? Python doesn't have pointers.

Re: handlers.SocketHandler and exceptions

2008-01-16 Thread Mark Tolonen
"writeson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > On our Linux systems at work I've written a Twisted logging server > that receives log messages from multiple servers/processes to post > them to a log file, essentially serializing all the process log > messages

examples of logger using smtp

2008-01-16 Thread DwBear75
I am hoping to find some simple examples of how to create a logger instance using smtphandler. I don't want to create a separate ini file. I just want to sent the smtphost, from, to right in the code when I instantiate the logger. I can't seem to find simple code on how to do this. Any pointers ? -

assigning values in python and perl

2008-01-16 Thread J. Peng
I just thought python's way of assigning value to a variable is really different to other language like C,perl. :) Below two ways (python and perl) are called "pass by reference", but they get different results. Yes I'm reading 'Core python programming', I know what happened, but just a little con

Re: assigning values in python and perl

2008-01-16 Thread J. Peng
May I ask, python's pass-by-reference is passing the object's reference to functions, but perl, or C's pass-by-reference is passing the variable itself's reference to functions. So althought they're all called pass-by-reference,but will get different results.Is it? On Jan 17, 2008 11:34 AM, J. Pen

Re: assigning values in python and perl

2008-01-16 Thread Steven D'Aprano
On Thu, 17 Jan 2008 11:40:59 +0800, J. Peng wrote: > May I ask, python's pass-by-reference is passing the object's reference > to functions, but perl, or C's pass-by-reference is passing the variable > itself's reference to functions. So althought they're all called > pass-by-reference,but will ge

Re: next line (data parsing)

2008-01-16 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Hi there, > I'm struggling to find a sensible way to process a large chuck of > data--line by line, but also having the ability to move to subsequent > 'next' lines within a for loop. I was hoping someone would be willing > to share some insights to help point me in the r

Re: -fno-strict-aliasing turned off when cross compiling

2008-01-16 Thread Martin v. Löwis
> Does anyone have an idea why -fno-strict-aliasing is turned off when > cross compiling? Because detection of -fno-strict-aliasing is made through running the compiler output (AC_TRY_RUN, see configure.in instead). For cross-compilation, running the program isn't actually possible, so a default m

Re: Hebrew in idle ans eclipse (Windows)

2008-01-16 Thread Martin v. Löwis
> What do I need to do run my app like IDLE does? Can you please show the fragment of your program that prints these strings? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Thinking of your next holiday

2008-01-16 Thread magicalnepal
Are you planning for vacation, holiday? We would like you to spare your valuable time! Visit our website www.magical-nepal.com for information on Nepal, Tibet and Bhutan. Thanking you in advance visiting and look forward to assist you. Regards, Rath Nepal Tours and Travels P O Box 10691, 2nd Flo

Re: Creating unique combinations from lists

2008-01-16 Thread Martin v. Löwis
> The main emphasis was to show that there was a pattern unfolding that > should have been translated into more pythonic code than just > hard-coding nested loops. Practicality beats purity. That you would solve a more general problem in a more general way doesn't mean that you shouldn't solve the

Re: assigning values in python and perl

2008-01-16 Thread George Sakkis
On Jan 16, 10:34 pm, "J. Peng" <[EMAIL PROTECTED]> wrote: > I just thought python's way of assigning value to a variable is really > different to other language like C,perl. :) > > Below two ways (python and perl) are called "pass by reference", but > they get different results. > > (snipped) Pyt

Re: next line (data parsing)

2008-01-16 Thread George Sakkis
On Jan 17, 12:01 am, Scott David Daniels <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi there, > > I'm struggling to find a sensible way to process a large chuck of > > data--line by line, but also having the ability to move to subsequent > > 'next' lines within a for loop. I was hopi

Re: next line (data parsing)

2008-01-16 Thread George Sakkis
On Jan 17, 12:42 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jan 17, 12:01 am, Scott David Daniels <[EMAIL PROTECTED]> > wrote: > > > > > [EMAIL PROTECTED] wrote: > > > Hi there, > > > I'm struggling to find a sensible way to process a large chuck of > > > data--line by line, but also having

Re: assigning values in python and perl

2008-01-16 Thread Mel
J. Peng wrote: > May I ask, python's pass-by-reference is passing the object's > reference to functions, but perl, or C's pass-by-reference is passing > the variable itself's reference to functions. So althought they're all > called pass-by-reference,but will get different results.Is it? > > On Ja

Re: assigning values in python and perl

2008-01-16 Thread Christian Heimes
George Sakkis wrote: > Python's parameter passing is like passing a pointer in C/C++. [snip] It's not (I repeat NOT) like passing a pointer in C. Please read http://effbot.org/zone/call-by-object.htm Christian -- http://mail.python.org/mailman/listinfo/python-list

Re: assigning values in python and perl

2008-01-16 Thread J. Peng
On Jan 17, 2008 2:03 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > Python's parameter passing is like passing a pointer in C/C++. > [snip] > > It's not (I repeat NOT) like passing a pointer in C. Please read > http://effbot.org/zone/call-by-object.htm > Yes I agree. No

Re: assigning values in python and perl

2008-01-16 Thread J. Peng
On Jan 17, 2008 1:54 PM, Mel <[EMAIL PROTECTED]> wrote: > > test(a) (along with def test(x)) takes the object named 'a' in the > current namespace and binds it with the name 'x' in function test's > local namespace. So, inside test, the name 'x' starts by referring to >the list that contains [

Re: assigning values in python and perl

2008-01-16 Thread Paddy
On Jan 17, 3:34 am, "J. Peng" <[EMAIL PROTECTED]> wrote: > I just thought python's way of assigning value to a variable is really > different to other language like C,perl. :) > > Below two ways (python and perl) are called "pass by reference", but > they get different results. > Yes I'm reading 'C

Re: assigning values in python and perl

2008-01-16 Thread George Sakkis
On Jan 17, 1:03 am, Christian Heimes <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > Python's parameter passing is like passing a pointer in C/C++. > > [snip] > > It's not (I repeat NOT) like passing a pointer in C. Please > readhttp://effbot.org/zone/call-by-object.htm > > Christian Posti

Re: assigning values in python and perl

2008-01-16 Thread Christian Heimes
George Sakkis wrote: > Posting a counter-example where the difference is clearly shown would > be more vastly useful than referring to a list of long obscure usenet > posts with practically no examples. C/C++ are not even mentioned in > that page. I am not claiming you are wrong, I just don't find

Re: assigning values in python and perl

2008-01-16 Thread Hrvoje Niksic
"J. Peng" <[EMAIL PROTECTED]> writes: > $ cat t1.py > def test(x): > x = [4,5,6] > > a=[1,2,3] > test(a) > print a > > $ python t1.py > [1, 2, 3] > > $ cat t1.pl > sub test { > my $ref = shift; > @$ref = (4,5,6); > } @$ref = (4, 5, 6) intentionally assigns to the same list pointed to

Re: assigning values in python and perl

2008-01-16 Thread J. Peng
On Jan 17, 2008 2:55 PM, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > > @$ref = (4, 5, 6) intentionally assigns to the same list pointed to by > the reference. That would be spelled as x[:] = [4, 5, 6] in Python. > What Python does in your example is assign the same as Perl's $ref = > [4, 5, 6]. So

Re: Parsing links within a html file.

2008-01-16 Thread Hai Vu
On Jan 14, 9:59 am, Shriphani <[EMAIL PROTECTED]> wrote: > Hello, > I have a html file over here by the name guide_ind.html and it > contains links to other html files like guides.html#outline . How do I > point BeautifulSoup (I want to use this module) to > guides.html#outline ? > Thanks > Shripha

Extending the readline module?

2008-01-16 Thread Casey Rodarmor
Hi everyone, I'm writing a little curses-mode utility for renaming files using regexes, and I want to use GNU readline to get user input. However, it looks like the readline module doesn't support all of readline's functionality. I've looked around, and it looks like the best thing to do would be

<    1   2