passing arguments from a python program to other while executing it with exec() or spawn() in LINUX

2008-10-16 Thread gaurav kashyap
HI all, i have two python programs as 1.py and 2.py 1.py import os import sys processID=os.spawnl(os.P_WAIT,'/usr/local/bin/python','python','/ mywork/2.py ' + 'hi') 2.py import sys domain= str(sys.argv[1] ) print domain IN LINUX while executing 1.py,the argument 'hi' is not passed to the 2.py a

Re: IDE Question

2008-10-16 Thread Peter Anderson
I have been using the two following Python IDE's on both Windows and Ubuntu: * PyScripter - http://mmm-experts.com/ * DrPython - http://sourceforge.net/projects/drpython/ PyScripter is, I think, the better but both are nice editors and easy to use. Regards, Peter -- *Peter Anderson* The

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-16 Thread rustom
On Oct 16, 8:37 am, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Oct 14, 7:37 pm, [EMAIL PROTECTED] wrote: > > > If you're an Emacs user who has used both python-mode.el (the python mode > > code distributed with Python and XEmacs) and python.el (the python mode code > > distributed with GNU E

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-16 Thread rustom
On Oct 16, 12:54 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Lawrence D'Oliveiro a écrit : > > > I find Emacs modes just too confusing. I do all my editing in fundamental > > mode. > > Sounds like buying a cray supercomputer to end up doing computation by > hand... Reminds me of a funny s

Re: passing arguments from a python program to other while executing it with exec() or spawn() in LINUX

2008-10-16 Thread Peter Otten
gaurav kashyap wrote: > HI all, > i have two python programs as 1.py and 2.py > > 1.py > import os > import sys > processID=os.spawnl(os.P_WAIT,'/usr/local/bin/python','python','/ > mywork/2.py ' + 'hi') > > 2.py > import sys > domain= str(sys.argv[1] ) > print domain > > IN LINUX > while execu

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Helmut Jarausch
Martin v. Löwis wrote: What defines me as latin1-user? That your locale is based on Latin-1, e.g. because it is a German locale. How precisely that works depends on the operating system. So my system seems to be an ASCII system? At least that's what Python determined. If Python couldn't hav

Re: OOP books?

2008-10-16 Thread Bruno Desthuilliers
Asun Friere a écrit : On Oct 16, 7:12 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: [snip] Not a word about Python in it, but:http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-... A must-read if you want to understand OO (MHO of course). Yes, if only to see how many

Re: passing arguments from a python program to other while executing it with exec() or spawn() in LINUX

2008-10-16 Thread gaurav kashyap
Thanks for the help Peter.Its working fine now -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Martin v. Löwis
> Still, I wished it were possible call sys.setdefaultencoding > at the very beginning of a script. > > Why isn't that possible? The default encoding was used when combining byte-oriented text and unicode-oriented text. Such combination is no longer supported, hence the notion of a default encodi

install Django under PYTHONPATH

2008-10-16 Thread limas
please help me.. i want to install django under PYTHONPATH with out root permission. Can i do it without setup.py -- http://mail.python.org/mailman/listinfo/python-list

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-16 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, rustom wrote: > Reminds me of a funny story about one of our university profs. > At a time when we used DOS and unix (on terminals) he got a very high > end SGI workstation. > And promptly shouted at the sysads because he could not see his > C:> > prompt. The joke

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-16 Thread Alberto Griggio
Hello, > I second Bruno's points, the older python-mode.el is much > better, I agree too. I can't really say what's missing from python.el, but I'm much more comfortable with python-mode.el. The triple-quote highlight is better in python.el, but I was successful in porting it to python-mode.el a

Best way to spawn process on back end computer

2008-10-16 Thread sophie_newbie
Hi, I'm running a python cgi script on a frontend web server and I want it to spawn another script (that takes a long time to run) on a backend number crunching server thats connected to the same network. What do you think is the best way to do this? I have a few ideas but I'm sure there is a "bes

Acer Laptops 4520NWXMi Athlon LX.AHS0C.032

2008-10-16 Thread Shopping.homeshop
Based on the powerful and affordable AMD Turion 64 X2 Mobile Technology, the Aspire 4520 is well suited for any home computing environment. Featuring impressive graphics solutions from NVIDIA, a 14.1"Acer CrystalBrite display, ultra-realistic Dolby surround sound, they excel at video/audio playback

Re: urllib accept-language doesn't have any effect

2008-10-16 Thread Diez B. Roggisch
Martin Bachwerk wrote: > Hmm, thanks for the ideas, > > I've checked the requests in Firefox one more time after deleting all > the cookies and both google.com and gizmodo.com do indeed forward me to > the German site without caring about the browser settings. > > wget shows me that the server d

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Helmut Jarausch
Martin v. Löwis wrote: Still, I wished it were possible call sys.setdefaultencoding at the very beginning of a script. Why isn't that possible? The default encoding was used when combining byte-oriented text and unicode-oriented text. Such combination is no longer supported, hence the notion o

Re: Append a new value to dict

2008-10-16 Thread Pat
paul wrote: Pat schrieb: I know it's not "fair" to compare language features, but it seems to me (a Python newbie) that appending a new key/value to a dict in Python is awfully cumbersome. In Python, this is the best code I could come up with for adding a new key, value to a dict mytable.s

Re: how to get the recipients addresses of an outlook mail in python...

2008-10-16 Thread [EMAIL PROTECTED]
On Oct 16, 5:22 pm, Miki <[EMAIL PROTECTED]> wrote: > >         Can some one help me in obtaining the set of recipients email > > addresses from an outlook mail? I tried various options like ... > > message["To"] > message["Cc"] > > HTH, > -- > Mikihttp://pythonwise.blogspot.com Thanks for your re

Re: IDE Question

2008-10-16 Thread Tim Cook
On Oct 15, 2:19 pm, "Steve Phillips" <[EMAIL PROTECTED]> wrote: > Hi All, > I am just wondering what seems to be the most popular IDE. Well, you have already had many replies. For some context; I am an serious open source advocate. But for productivity I haven't been able to beat WingIDE. Thei

Re: Python equivalent to SharePoint?

2008-10-16 Thread Mike Hjorleifsson
On Oct 15, 11:17 am, Joe Strout <[EMAIL PROTECTED]> wrote: > We've got a client who has been planning to use SharePoint for   > managing their organization documents, but has recently dropped that   > idea and is looking for an alternative.  Is there any Python package   > with similar functionalit

Re: Best way to spawn process on back end computer

2008-10-16 Thread Robin Becker
sophie_newbie wrote: Hi, I'm running a python cgi script on a frontend web server and I want it to spawn another script (that takes a long time to run) on a backend number crunching server thats connected to the same network. What do you think is the best way to do this? I have a few ideas but I

Re: urllib accept-language doesn't have any effect

2008-10-16 Thread Philip Semanchuk
On Oct 16, 2008, at 6:50 AM, Martin Bachwerk wrote: Hmm, thanks for the ideas, I've checked the requests in Firefox one more time after deleting all the cookies and both google.com and gizmodo.com do indeed forward me to the German site without caring about the browser settings. wget s

Re: regular expression question (re module)

2008-10-16 Thread Pat
Faheem Mitha wrote: Hi, I need to match a string of the form capital_letter underscore capital_letter number against a string of the form anything capital_letter underscore capital_letter number some_stuff_not_starting with a number DUKE1_plateD_A12.CEL. Thanks in advance. Please cc

Re: Overloading operators

2008-10-16 Thread Mr . SpOOn
Thanks for the suggestion. I think I'm gonna try the multimethods way, that I didn't know about it. -- http://mail.python.org/mailman/listinfo/python-list

Finding the instance reference of an object

2008-10-16 Thread Astley Le Jasper
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob' -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib accept-language doesn't have any effect

2008-10-16 Thread Martin Bachwerk
Hey Philip, thanks for the snipplet, but I have tried that code already. It does indeed give me a swedish version.. of www.google.de :) That's the beauty about Google that they have all languages for all domains available. However if I try it with www.gizmodo.com (a tech blog in several lang

Re: [ANN] Data Plotting Library DISLIN 9.4

2008-10-16 Thread Helmut Michels
Méta-MCI (MVP) wrote: Hello! version 9.4 of DISLIN Thanks! I like Dislin. But... I don't found the release (binary/win) for Python 2.6... -- Michel Claveau Sorry, I have not compiled Dislin for Python 2.6 until yet. I will try it in the next time. Regards, Helmut -- http://mail.py

Re: How to transfer data structure or class from Python to C/C++?

2008-10-16 Thread Hongtian
Not exactly. In my C/C++ application, I have following function or flow: void func1() { call PyFunc(struct Tdemo, struct &Tdemo1); } I mean I want to invoke Python function 'PyFunc' and transfer a data structure 'Tdemo' to this function. After some process in Python, I want it return 'Td

Re: File management

2008-10-16 Thread Ronny Sonntag
erict1689 schrieb: def closeUp(): # Purpose: end of program housekeeping global empName, previousYTD, payRate, hoursWorked, recordCount, eof, payFile, \ payFileUpdated, newYTD, currentPay payFile.close() payFileUpdated.close() print "\nNumber of records in the

Re: Append a new value to dict

2008-10-16 Thread Boris Borcic
Kirk Strauser wrote: While we're on the subject, use keyword arguments to dict like: foo.update(dict(quux='blah', baz='bearophile', jdd='dict')) was *much* slower, at 11.8s. Presumably you would save half of that time by writing simply foo.update(quux='blah', baz='bearophile', jdd

Re: Best way to spawn process on back end computer

2008-10-16 Thread Paul Boddie
On 16 Okt, 15:51, Robin Becker <[EMAIL PROTECTED]> wrote: > sophie_newbie wrote: > > I'm running a python cgi script on a frontend web server and I want it > > to spawn another script (that takes a long time to run) on a backend > > number crunching server thats connected to the same network. What

how to get the recipients addresses of an outlook mail in python...

2008-10-16 Thread [EMAIL PROTECTED]
Hi all, Can some one help me in obtaining the set of recipients email addresses from an outlook mail? I tried various options like message.Recipient.Address message.To.Address message.Receiver.Address etc.. but I could get the senders address using message.Sender.Address. Thanks

Re: default value in __init__

2008-10-16 Thread bearophileHUGS
Chris Rebert: > Although primitive and likely somewhat flawed, you may find the > statistics in the "Compatibility Issues" section > ofhttp://mail.python.org/pipermail/python-3000/2007-February/005704.html > to be of interest. I am quite glad to see that I am not the only one that cares for such

Re: how to get the recipients addresses of an outlook mail in python...

2008-10-16 Thread Miki
>         Can some one help me in obtaining the set of recipients email > addresses from an outlook mail? I tried various options like ... message["To"] message["Cc"] HTH, -- Miki http://pythonwise.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

baffling memory usage

2008-10-16 Thread Tim Redfern
Hi I'm having an issue that is probably obvious to somebody here but its baffling me.. I'm using python (2.5.1) on an embedded linux sytem system (kernel 2.6.19 I think) with only 32MB memory (for an art project). My python code runs nicely when launched manually from a login shell, ps shows its

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Paul Boddie
On 16 Okt, 11:28, Helmut Jarausch <[EMAIL PROTECTED]> wrote: > > I meant setting the default encoding which is used by print (e.g.) when > outputting the internal unicode string to a file. > As far as I understood, currently I am fixed to setting either > the 'locale' or to switch settings for each

Re: Python equivalent to SharePoint?

2008-10-16 Thread Paul Boddie
On 15 Okt, 22:50, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: > In message <[EMAIL PROTECTED]>, Paul Boddie wrote: > > ... any absence of steep licensing costs isn't necessarily > > an advantage in the consulting business since such stuff usually gets > > passed onto the

Re: python debugger tips?

2008-10-16 Thread Pat
[EMAIL PROTECTED] wrote: Hi All, I'm switching to python from perl, and like the language a ton, but I find pdb and pydb to be vastly inferior debuggers to the perl version. In particular, I've grown very used to stepping into arbitrary functions interactively. For instance, in perl you can do

Re: Finding the instance reference of an object

2008-10-16 Thread Carsten Haese
Astley Le Jasper wrote: > Sorry for the numpty question ... > > How do you find the reference name of an object? > > So if i have this > > bob = modulename.objectname() > > how do i find that the name is 'bob' Why do you need to find that? You know that its name is 'bob'. -- Carsten Haese htt

Re: Finding the instance reference of an object

2008-10-16 Thread Michele Simionato
On Oct 16, 4:01 pm, Astley Le Jasper <[EMAIL PROTECTED]> wrote: > Sorry for the numpty question ... > > How do you find the reference name of an object? > > So if i have this > > bob = modulename.objectname() > > how do i find that the name is 'bob' This is a FAQ: http://www.python.org/doc/faq/p

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread Pat
Sean DiZazzo wrote: On Sep 29, 12:44 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: Sir, You are absolutely correct. I was praying to G_d I did not have to slaughter my project's source code in this manner. However, like life itself, I was given legacy source code (i.e. someone else erro

Re: Finding the instance reference of an object

2008-10-16 Thread Astley Le Jasper
On 16 Oct, 16:52, Carsten Haese <[EMAIL PROTECTED]> wrote: > Astley Le Jasper wrote: > > Sorry for the numpty question ... > > > How do you find the reference name of an object? > > > So if i have this > > > bob = modulename.objectname() > > > how do i find that the name is 'bob' > > Why do you nee

Re: install Django under PYTHONPATH

2008-10-16 Thread Bruno Desthuilliers
limas a écrit : please help me.. i want to install django under PYTHONPATH with out root permission. Can i do it without setup.py You don't need root permissions to edit your own PYTHONPATH. It's just an environment variable, you know ?-) -- http://mail.python.org/mailman/listinfo/python-

ZSI: Classless complexType didn't get dictionary

2008-10-16 Thread Heston James - Cold Beans
Guys, I'm in need of some help. I've got an array of objects I'm trying to send to a remote server using ZSI. I've defined my class and type codes as described in the documentation, and I pass the module containing the class/typecode definition into the 'typesmodule' parameter of the ServicePro

account balance checker

2008-10-16 Thread Support Desk
Hello all, I was wondering if it would be possible to make a script to grab my balance account balance a few times a day without having to login every time. I know I can use the urlib2 library, but not sure how to go about filling in the forms and submitting them. BOA has a mobile site th

Re: Best way to spawn process on back end computer

2008-10-16 Thread Simon Brunning
2008/10/16 sophie_newbie <[EMAIL PROTECTED]>: > I'm running a python cgi script on a frontend web server and I want it > to spawn another script (that takes a long time to run) on a backend > number crunching server thats connected to the same network. What do > you think is the best way to do thi

Re: account balance checker

2008-10-16 Thread Chris Rebert
You'd probably have to use something like mechanize (http://wwwsearch.sourceforge.net/mechanize/) to fill out the forms, but if BofA's website uses Javascript at all, you're probably out of luck. Cheers, Chris -- Follow the path of the Iguana... http://rebertia.com On Wed, Oct 15, 2008 at 8:09 A

Re: urllib accept-language doesn't have any effect

2008-10-16 Thread Martin Bachwerk
Hmm, thanks for the ideas, I've checked the requests in Firefox one more time after deleting all the cookies and both google.com and gizmodo.com do indeed forward me to the German site without caring about the browser settings. wget shows me that the server does a 302 redirect straight away..

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread J Kenneth King
Pat <[EMAIL PROTECTED]> writes: > Sean DiZazzo wrote: >> On Sep 29, 12:44 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> >> wrote: >>> Sir, >>> >>> You are absolutely correct. I was praying to G_d I did not have to >>> slaughter my project's source code in this manner. However, like life >>> itsel

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread Diez B. Roggisch
> Trust me. Sean is absolutely correct. I'm currently in the process of > converting a large Perl project to Python (and learning Python at the > same time) and the improvement in code is incredible. After you learn > Python, you'll come to despise Perl. +1 QOTW Diez -- http://mail.python.org/

Re: Finding the instance reference of an object

2008-10-16 Thread Steven D'Aprano
On Thu, 16 Oct 2008 08:04:23 -0700, Astley Le Jasper wrote: > I'm creating mulitple instances, putting them in a list, iterating > through the list to send them to some functions where process them with > some instance specific parameters. Something along the lines of: > > bob = someobject() > ha

Re: like using python

2008-10-16 Thread Gerhard Häring
[EMAIL PROTECTED] wrote: as the subject me2 -- http://mail.python.org/mailman/listinfo/python-list

Re: Finding the instance reference of an object

2008-10-16 Thread Diez B. Roggisch
Astley Le Jasper schrieb: On 16 Oct, 16:52, Carsten Haese <[EMAIL PROTECTED]> wrote: Astley Le Jasper wrote: Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob' Why do you need t

Re: Finding the instance reference of an object

2008-10-16 Thread Larry Bates
Astley Le Jasper wrote: Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob' Short answer is that you can't. This because Python's names (bob) are bound to objects (modulenam

RE: account balance checker

2008-10-16 Thread Support Desk
I was also looking at the ClientForm Library http://wwwsearch.sourceforge.net/ClientForm/ which can get me past the first username form, but I noticed it then goes to a challenge question form and im not sure how to take the resulting for and resubmit it with new information and then resubmit the

Re: Finding the instance reference of an object

2008-10-16 Thread Joe Strout
On Oct 16, 2008, at 10:59 AM, Larry Bates wrote: how do i find that the name is 'bob' Short answer is that you can't. This because Python's names (bob) are bound to objects (modulename.objectname()). They are NOT variables as they are in "other" programming languages. Which other progr

Re: default value in __init__

2008-10-16 Thread Steven D'Aprano
On Thu, 16 Oct 2008 17:05:40 +1300, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano > wrote: > >> On Thu, 09 Oct 2008 01:39:30 -0700, kenneth (a.k.a. Paolo) wrote: >> >>> On Oct 9, 10:14 am, Christian Heimes <[EMAIL PROTECTED]> wrote: >>> No, it always contains

Re: Finding the instance reference of an object

2008-10-16 Thread Astley Le Jasper
On 16 Oct, 18:53, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Astley Le Jasper schrieb: > > > > > On 16 Oct, 16:52, Carsten Haese <[EMAIL PROTECTED]> wrote: > >> Astley Le Jasper wrote: > >>> Sorry for the numpty question ... > >>> How do you find the reference name of an object? > >>> So if i

Re: Finding the instance reference of an object

2008-10-16 Thread Astley Le Jasper
Thanks for all the responses. That helps. Ta ALJ -- http://mail.python.org/mailman/listinfo/python-list

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-16 Thread Carl Banks
On Oct 14, 1:05 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > - a slightly less but still annoying problem (I wouldn't call it a bug) > is the handling of indentation for nested litteral dicts/lists/tuples. The python-mode.el on Subversion (python-mode's Subversion on source forge, not the

twisted and py2exe

2008-10-16 Thread Linnorm
I've written an app using twisted to create an ssh forwarding tunnel for our erp app. When I run it with the interpreter it works perfectly, but when I package it up with py2exe it looks like the tunnel never gets created. I don't get any exceptions during the build, but I do get the following:

ImportError in python 2.5 in C API DLL

2008-10-16 Thread Henrik
Hi, We are upgrading from Python 2.3 to verion 2.5 and when we recompile we get ImportError. To test we took the spam example from the web documentation and compiled it with Py23 and it imports without a problem. Changing the libs in visual studio 2008 to point to Py25 and we get: >>> import spa

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-16 Thread Bruno Desthuilliers
Carl Banks a écrit : On Oct 14, 1:05 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: - a slightly less but still annoying problem (I wouldn't call it a bug) is the handling of indentation for nested litteral dicts/lists/tuples. The python-mode.el on Subversion (python-mode's Subversion o

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-16 Thread Bruno Desthuilliers
rustom a écrit : (snip) I am interested in knowing which mode supports better the use of pdb inside emacs? Since you mention this, I think I remember having a couple issues here with python-mode.el - but that was a long time ago, and I usually don't use pdb within the emacs-python-shell (mos

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-16 Thread Carl Banks
On Oct 16, 12:21 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Carl Banks a écrit : > > > On Oct 14, 1:05 pm, Bruno Desthuilliers > > <[EMAIL PROTECTED]> wrote: > >> - a slightly less but still annoying problem (I wouldn't > > call it a bug) > >> is the handling of indentation for nested lit

Re: Finding the instance reference of an object

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 12:25 pm, Astley Le Jasper <[EMAIL PROTECTED]> wrote: > Thanks for all the responses. That helps. > > Ta > > ALJ If you're sure it's unique, why not just scan through the pairs in locals()? for k, v in locals(): if v is the_object_im_looking_for: name_im_looking_for= k This meth

Re: default value in __init__

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 1:05 am, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 15, 2008 at 9:43 PM, Aaron Castironpi Brady > > > > <[EMAIL PROTECTED]> wrote: > > On Oct 15, 11:33 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Aaron "Castironpi" Brady wrote: > > >> [about how default argument behavio

Re: default value in __init__

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 12:23 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Thu, 16 Oct 2008 17:05:40 +1300, Lawrence D'Oliveiro wrote: > > In message <[EMAIL PROTECTED]>, Steven D'Aprano > > wrote: > > >> On Thu, 09 Oct 2008 01:39:30 -0700, kenneth (a.k.a. Paolo) wrote: > > >>> On Oct

Re: default value in __init__

2008-10-16 Thread David C. Ullrich
In article <[EMAIL PROTECTED]>, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > David C. Ullrich a écrit : > > In article <[EMAIL PROTECTED]>, > > Bruno Desthuilliers <[EMAIL PROTECTED]> > > wrote: > > > >> David C. Ullrich a écrit : > (snip) > >>> Seems to me that people often site the "imp

fcgi.py on windows?

2008-10-16 Thread bryan rasmussen
As per the subject, anyone know of a version of fcgi.py out there somewhere that works on windows yet. Best Regards, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

xor incongruences

2008-10-16 Thread Michele
Hi, I write a simple encoder in python and Java; they do the same computations, with the same inputs: however they won't produce the same output. Let me explain with code. First of all, you need a test file for input: $ dd if=/dev/urandom of=test.img bs=1048576 count=1 I have attached the code. A

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Helmut Jarausch
Paul Boddie wrote: On 16 Okt, 11:28, Helmut Jarausch <[EMAIL PROTECTED]> wrote: I meant setting the default encoding which is used by print (e.g.) when outputting the internal unicode string to a file. As far as I understood, currently I am fixed to setting either the 'locale' or to switch setti

Re: del and sets proposal

2008-10-16 Thread Henk . van . Asselt
"Life was like a box of chocolates. You never know what you're gonna get." Regardless of how it is implemented, mathematically a set is a collection of items. The order does not matter, an item is part of a set, or is not part of a set. Period. Henk -- http://mail.python.org/mailman/listinfo/py

Re: xor incongruences

2008-10-16 Thread bearophileHUGS
Michele: > in Java this block has an hash which is different from the Python one. Note that integer numbers in Python are multiprecision by default, this may cause differences. You can put some prints in various stages of the data flow (or breakpoints for your debuggers, etc) to spot where the va

Dictionary of Dicts question

2008-10-16 Thread John Townsend
I'm working with a Dictionary of Dicts. Something like this: myDict = { 'TestName': { 'FileName':{ 'ct_in

Re: Dictionary of Dicts question

2008-10-16 Thread Chris Rebert
On Thu, Oct 16, 2008 at 12:19 PM, John Townsend <[EMAIL PROTECTED]> wrote: > I'm working with a Dictionary of Dicts. Something like this: > > myDict = { > 'TestName': { > 'FileName':{ > >

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread Joshua Kugler
Pat wrote: >> Rewrite everything in python. Save yourself now...while you still >> can. >> >> ~Sean > > Trust me. Sean is absolutely correct. I'm currently in the process of > converting a large Perl project to Python (and learning Python at the > same time) and the improvement in code is incred

Re: Overloading operators

2008-10-16 Thread Lie Ryan
On Wed, 15 Oct 2008 14:34:14 +0200, Mr.SpOOn wrote: > Hi, > in a project I'm overloading a lot of comparison and arithmetic > operators to make them working with more complex classes that I defined. > > > What is the best way to do this? Shall I use a lot of "if...elif" > statements inside the ov

Re: Dictionary of Dicts question

2008-10-16 Thread William Purcell
I believe that myDict['TestName'] = {'NewFileName': {}, } should be myDict['TestName']['NewFileName'] = {} -Bill On Thu, Oct 16, 2008 at 3:44 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > On Thu, Oct 16, 2008 at 12:19 PM, John Townsend <[EMAIL PROTECTED]> > wrote: > > I'm working with a Dictiona

RE: Dictionary of Dicts question

2008-10-16 Thread John Townsend
Joe had a good point! Let me describe what problem I'm trying to solve and the list can recommend some suggestions. I have two text files. Each file contains data like this: Test file 1234 4567 8975 I want to compare the numbers in each text file. The data set (i.e. the numbers) has a unique i

Re: How to transfer data structure or class from Python to C/C++?

2008-10-16 Thread Aaron "Castironpi" Brady
On Oct 16, 9:10 am, Hongtian <[EMAIL PROTECTED]> wrote: > Not exactly. > > In my C/C++ application, I have following function or flow: > > void func1() > { >     call PyFunc(struct Tdemo, struct &Tdemo1); > > } > > I mean I want to invoke Python function 'PyFunc' and transfer a data > structure

Re: xor incongruences

2008-10-16 Thread Peter Otten
Michele wrote: > Hi, > I write a simple encoder in python and Java; they do the same > computations, with the same inputs: however they won't produce the same > output. > Let me explain with code. > > First of all, you need a test file for input: > $ dd if=/dev/urandom of=test.img bs=1048576 coun

Re: xor incongruences

2008-10-16 Thread John Machin
On Oct 17, 7:02 am, Michele <[EMAIL PROTECTED]> wrote: > Hi, > I write a simple encoder in python and Java; they do the same > computations, with the same inputs No they don't. > however they won't produce the same > output. > Let me explain with code. You have a strange understanding of the wor

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread J Kenneth King
Joshua Kugler <[EMAIL PROTECTED]> writes: > Pat wrote: >>> Rewrite everything in python. Save yourself now...while you still >>> can. >>> >>> ~Sean >> >> Trust me. Sean is absolutely correct. I'm currently in the process of >> converting a large Perl project to Python (and learning Python at th

Re: Overloading operators

2008-10-16 Thread Mr . SpOOn
On Thu, Oct 16, 2008 at 10:54 PM, Lie Ryan <[EMAIL PROTECTED]> wrote: > On Wed, 15 Oct 2008 14:34:14 +0200, Mr.SpOOn wrote: > Something that is more pythonic is something that doesn't use > multimethods. It's just an elaborated way to do type checking. In python, > you usually avoid type checking a

RE: Dictionary of Dicts question

2008-10-16 Thread John Townsend
Here are some sample lines. Text file 1 contains: DescribeImage AllAdjustments.psd 0.66812636 0.046 0.426 0.06475 0.06475 0.005875 DescribeImage All_Options_Multi.psd 0.552750021219 0.046 0.355875 0.01525 0.0171250.0 DescribeImage All_Options_Quad.psd

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Martin v. Löwis
> I meant setting the default encoding which is used by print (e.g.) when > outputting the internal unicode string to a file. Having such a thing would be conceptually wrong. What encoding should be used depends on the file - different files may have different encodings. When opening a file, you n

Re: Emacs users: feedback on diffs between python-mode.el and python.el?

2008-10-16 Thread Malte Helmert
[EMAIL PROTECTED] wrote: > If you're an Emacs user who has used both python-mode.el (the python mode > code distributed with Python and XEmacs) and python.el (the python mode code > distributed with GNU Emacs), I'd like to get your impressions on how they > compare and where you feel the bugs lie.

Re: ImportError in python 2.5 in C API DLL

2008-10-16 Thread Matimus
On Oct 16, 10:58 am, Henrik <[EMAIL PROTECTED]> wrote: > Hi, > > We are upgrading from Python 2.3 to verion 2.5 and when we recompile > we get ImportError. > > To test we took the spam example from the web documentation and > compiled it with Py23 and it imports without a problem. Changing the > li

Re: ImportError in python 2.5 in C API DLL

2008-10-16 Thread Martin v. Löwis
> Would really appreciate any assistance. You should change your project to create a .pyd file instead of a .dll file. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Trying to install module, No module named scipy_distutils.core (but i have scipy)

2008-10-16 Thread process
trying to install PyKF-0.1 (Kalman Filters) http://pykf.sourceforge.net/ I have Numpy, Scipy, Matplotlib installed an have successfully installed other packages using them. $ setup.py Traceback (most recent call last): File "./setup.py", line 2, in from scipy_distutils.core import setup

Re: Trying to install module, No module named scipy_distutils.core (but i have scipy)

2008-10-16 Thread Benjamin Kaplan
On Thu, Oct 16, 2008 at 8:28 PM, process <[EMAIL PROTECTED]> wrote: > trying to install PyKF-0.1 (Kalman Filters) > http://pykf.sourceforge.net/ > > > > I have Numpy, Scipy, Matplotlib installed an have successfully > installed other packages using them. > > > $ setup.py > Traceback (most recent c

Unicode File Names

2008-10-16 Thread Jordan
I've got a bunch of files with Japanese characters in their names and os.listdir() replaces those characters with ?'s. I'm trying to open the files several steps later, and obviously Python isn't going to find '01-.jpg' (formally '01-ひらがな.jpg') because it doesn't exist. I'm not sure where in th

Re: default value in __init__

2008-10-16 Thread Steven D'Aprano
On Thu, 16 Oct 2008 12:18:49 -0700, Aaron \"Castironpi\" Brady wrote: [snip] >> If Python re-evaluated the default value i=i at runtime, the above >> would break. > > Not with a mere extra lambda. Not so. It has nothing to do with lambda, lambda just happens to be a convenient example. Here's

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Terry Reedy
Helmut Jarausch wrote: I have always worked with latin-1 strings with an US locale under python-2.x with x < 6 (I haven't tried 2.6, though). I hope to switch to 3.0 as soon as possible. Having the luxury of not needing 3rd party extensions for my current work, I already have, and love it.

Re: Unicode File Names

2008-10-16 Thread John Machin
On Oct 17, 11:43 am, Jordan <[EMAIL PROTECTED]> wrote: > I've got a bunch of files with Japanese characters in their names and > os.listdir() replaces those characters with ?'s. I'm trying to open > the files several steps later, and obviously Python isn't going to > find '01-.jpg' (formally '0

Re: Unicode File Names

2008-10-16 Thread Seun Osewa
Try Python 3. Python 3 strings are native by default, so the os.listdir() in Python 3 should support the Japanese characters. On Oct 17, 1:43 am, Jordan <[EMAIL PROTECTED]> wrote: > I've got a bunch of files with Japanese characters in their names and > os.listdir() replaces those characters with

Re: Finding the instance reference of an object

2008-10-16 Thread Steven D'Aprano
On Thu, 16 Oct 2008 11:24:28 -0600, Joe Strout wrote: > On Oct 16, 2008, at 10:59 AM, Larry Bates wrote: > >>> how do i find that the name is 'bob' >> >> Short answer is that you can't. This because Python's names (bob) are >> bound to objects (modulename.objectname()). They are NOT variables a

Re: Finding the instance reference of an object

2008-10-16 Thread Steven D'Aprano
On Thu, 16 Oct 2008 11:51:43 -0700, Aaron \"Castironpi\" Brady wrote: > If you're sure it's unique, why not just scan through the pairs in > locals()? > > for k, v in locals(): > if v is the_object_im_looking_for: > name_im_looking_for= k > > This method can sometimes return more than one

Re: Unicode File Names

2008-10-16 Thread Jordan
On Oct 16, 9:20 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Oct 17, 11:43 am, Jordan <[EMAIL PROTECTED]> wrote: > > > I've got a bunch of files with Japanese characters in their names and > > os.listdir() replaces those characters with ?'s. I'm trying to open > > the files several steps later,

  1   2   >