Re: Modal value of an array

2007-03-28 Thread Alex Martelli
Ben Finney <[EMAIL PROTECTED]> wrote: ... > That's not the only case though. What do you expect to be returned for > an input of ["eggs", "beans", "beans", "eggs", "spam"] ? > > Assuming you want *a* mode value, and any one will do (e.g. any of > "spam", "eggs" or "beans" is okay), I'd write it

Re: which methods to use?

2007-03-28 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: ... > under what circumstances do we need to create a copy of a tuple :-> > "btuple = atuple[:]". tuples are immutable, so wouldn't it be "wasting > memory"? Nah -- btuple is atuple. The "copy" is a no-op, in this case. > another query, in the docs, list(a) and a[:]

Re: Finding User Profile path

2007-03-28 Thread Tim Golden
[EMAIL PROTECTED] wrote: > Hi, > > I am trying to query our domain to get a list of our users profile > locations. I thought I might be able to use WMI, but I can't get it to > work. Can you be a bit more specific: did WMI itself not work? Or the Python WMI module? What were the problems? (All t

Re: which methods to use?

2007-03-28 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: ... > In general: > > - use a list comprehension when you need to calculate the list items > > - use slicing when you are copying an actual list, or if you don't care > what type of object you get > > - use the list() function when your existing obje

Re: which methods to use?

2007-03-28 Thread s99999999s2003
On Mar 29, 12:56 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Wed, 28 Mar 2007 18:16:31 -0700, ss2003 wrote: > > what do you mean by create new object when using list comprehensoin or > > list()? Does using slicing create a new object as well? > > Yes it does. > > >>> alist = [1, 2,

Re: Mastering Python

2007-03-28 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > On Wed, 28 Mar 2007 07:55:20 +0200, "Hendrik van Rooyen" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > Pretty obvious of course, as is the pronounciation of the > > name: "Cholmondely" > > > Is that a scottish "Ch" (as i

Re: socket read timeout

2007-03-28 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > > hg> My issue with that is the effect on write: I only want a timeout on > hg> read ... but anyway ... > > So set a long timeout when you want to write and short timeout when you want > to read. > Are sockets full duplex? I know Ethernet isn't. - Hend

BeautifulSoup vs. Microsoft

2007-03-28 Thread John Nagle
Here's a construct with which BeautifulSoup has problems. It's from "http://support.microsoft.com/contactussupport/?ws=support";. This is the original: http://www.microsoft.com/usability/enroll.mspx"; id="L_75998" title="". So all that following stuff is from what follows the next "-

Re: upgrading python (and other modules)

2007-03-28 Thread Astan Chee
Forget I asked this question. I've solved it using wxPython 2.6.3.3 Cheers Astan Chee wrote: > Hi, > I was once using python 2.4 in win2k with wxPython 2.4.2.4 (if im not > mistaken) with it. > Now i've upgraded to winXP and am using python 2.5 with wxPython 2.8.1.1. > The problem Im currently ha

Re: newbi question on python rpc server, how it works?

2007-03-28 Thread krishnakant Mane
hello all, I have downloaded the entire twisted library. I am also trying to read the documentation but I have a couple of problems right now. firstly, I did not find any thing in twisted documentation that specifically talks about xml rpc. am I missing some thing? secondly, if I am writing an ent

upgrading python (and other modules)

2007-03-28 Thread Astan Chee
Hi, I was once using python 2.4 in win2k with wxPython 2.4.2.4 (if im not mistaken) with it. Now i've upgraded to winXP and am using python 2.5 with wxPython 2.8.1.1. The problem Im currently having is that in my code: from wxPython.wx import * from wxPython.grid import * from wxPython.html impor

Re: which methods to use?

2007-03-28 Thread Steven D'Aprano
On Thu, 29 Mar 2007 04:49:17 +, Dennis Lee Bieber wrote: > On 28 Mar 2007 18:16:31 -0700, [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > >> what do you mean by create new object when using list comprehensoin or >> list()? Does using slicing create a new object as well?

Re: Modal value of an array

2007-03-28 Thread Paddy
On Mar 29, 4:40 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi > > How can I find out the modal value in an array. That is the value > which occurs maximum time in the sequence .. > > e.g. if my array has values like [2,3,2,2,2,4,2,2] definitely the > maximum time 2 occurs in the array.

Re: Modal value of an array

2007-03-28 Thread Steven D'Aprano
On Wed, 28 Mar 2007 20:40:22 -0700, [EMAIL PROTECTED] wrote: > Hi > > How can I find out the modal value in an array. That is the value > which occurs maximum time in the sequence .. > > e.g. if my array has values like [2,3,2,2,2,4,2,2] definitely the > maximum time 2 occurs in the array. so

Re: how can I clear a dictionary in python

2007-03-28 Thread Steven D'Aprano
On Thu, 29 Mar 2007 01:51:07 +0200, Bjoern Schliessmann wrote: > Aahz wrote: > >> Go back and read Christian's post, then post a followup explaning >> why his solution is better than yours. Your explanation should >> use id(). > > I wonder how you two seem to know exactly what the OP wants ...

Re: which methods to use?

2007-03-28 Thread Steven D'Aprano
On Wed, 28 Mar 2007 18:16:31 -0700, ss2003 wrote: > what do you mean by create new object when using list comprehensoin or > list()? Does using slicing create a new object as well? Yes it does. >>> alist = [1, 2, 4, 8, 16] >>> blist = alist # not a copy >>> id(alist) == id(blist) True >>

Long way around UnicodeDecodeError, or 'ascii' codec can't decode byte

2007-03-28 Thread Oleg Parashchenko
Hello, I'm working on an unicode-aware application. I like to use "print" to debug programs, but in this case it was nightmare. The most popular result of "print" was: UnicodeDecodeError: 'ascii' codec can't decode byte 0xXX in position 0: ordinal not in range(128) I spent two hours fixing it, a

Re: Fortran vs Python - Newbie Question

2007-03-28 Thread Mel Wilson
Terry Reedy wrote: > "Tim Roberts" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > | Once upon a time, > | Basic enthusiasts would have used the word "tokenized" to describe .pyc > files. > > Perhaps, but they would, I think, have been wrong. Tokenized Basic to the > best of my

Re: Modal value of an array

2007-03-28 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Hi > > How can I find out the modal value in an array. That is the value > which occurs maximum time in the sequence .. > > e.g. if my array has values like [2,3,2,2,2,4,2,2] definitely the > maximum time 2 occurs in the array. so this function s

gmpy floating point exception

2007-03-28 Thread Martin Manns
Hi, I am experiencing some trouble with gmpy v1.01. Multiplying an mpq with inf results in a floating point exception that exits python. Has this already been fixed in newer gmpy versions? ~ $ python Python 2.4.3 (#1, Mar 26 2007, 00:32:54) [GCC 4.1.1 (Gentoo 4.1.1-r3)] on linux2 Type "help", "

Modal value of an array

2007-03-28 Thread [EMAIL PROTECTED]
Hi How can I find out the modal value in an array. That is the value which occurs maximum time in the sequence .. e.g. if my array has values like [2,3,2,2,2,4,2,2] definitely the maximum time 2 occurs in the array. so this function should be able to return 2 as a result .. So is there any fun

Re: Hpw make lists that are easy to sort.

2007-03-28 Thread Terry Reedy
"Anton Vredegoor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Terry Reedy wrote: | | > One could generate the items in order in less space by doing, for instance, | > an m-way merge, in which only the lowest member of each of the m sublists | > is present at any one time. But

Re: Can't use class variable with private nested class

2007-03-28 Thread tron . thomas
On Mar 27, 10:08 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > > Forget all the naming silliness and use self.__class__.printOnce > instead. > > Alex I tried self.__class__.printOnce and that worked. Thanks for your help. -- http://mail.python.org/mailman/listinfo/python-list

Re: which methods to use?

2007-03-28 Thread s99999999s2003
On Mar 29, 8:25 am, Florian Leitner <[EMAIL PROTECTED]> wrote: > * [EMAIL PROTECTED] wrote, On 3/29/07 2:09 AM: > > > hi > > which is the best methods to use for list copying. using list() , [:] > > or create list through list comprehension. what are the differences > > between these ? > > thanks

Re: SimpleXMLRPCServer and Threading

2007-03-28 Thread Jeff McNeil
This is off of memory so I apologize if I don't get all of the details right. The base SimpleXMLRPCServer uses TCPServer as it's server component and SimpleXMLXMLRPCRequestHandler as it's handler. The handler is a subclass of BaseHTTPRequestHandler, which itself doesn't handle any multithreading.

Re: How can I find out the size of a file

2007-03-28 Thread momobear
On Mar 29, 6:09 am, [EMAIL PROTECTED] wrote: > Hi, > > How can I find out the size of a file in a disk in python? > > i try this, but it does not work: > size = open(inputFileNameDir + "/" + file, 'r').size() > > Thank for any help. os.stat(filename), see stat manual for detail.(st_size ) -- ht

Re: which methods to use?

2007-03-28 Thread Florian Leitner
* [EMAIL PROTECTED] wrote, On 3/29/07 2:09 AM: > hi > which is the best methods to use for list copying. using list() , [:] > or create list through list comprehension. what are the differences > between these ? > thanks > depends on what you intend to do: -create a new object: use a list comp

which methods to use?

2007-03-28 Thread s99999999s2003
hi which is the best methods to use for list copying. using list() , [:] or create list through list comprehension. what are the differences between these ? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I clear a dictionary in python

2007-03-28 Thread Aahz
In article <[EMAIL PROTECTED]>, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: >Aahz wrote: >> >> Go back and read Christian's post, then post a followup explaning >> why his solution is better than yours. Your explanation should >> use id(). > >I wonder how you two seem to know exactly what the

Re: how can I clear a dictionary in python

2007-03-28 Thread Bjoern Schliessmann
Aahz wrote: > Go back and read Christian's post, then post a followup explaning > why his solution is better than yours. Your explanation should > use id(). I wonder how you two seem to know exactly what the OP wants ... Regards, Björn -- BOFH excuse #335: the AA battery in the wallclock

Re: how can I clear a dictionary in python

2007-03-28 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi, > > I create a dictionary like this > myDict = {} > > and I add entry like this: > myDict['a'] = 1 > but how can I empty the whole dictionary? > > Thank you. > just point myDict to an empty dictionary again myDict={} Larry Bates -- http://mail.python.org/mail

Re: how can I clear a dictionary in python

2007-03-28 Thread Christian Tismer
On 29.03.2007, at 00:38, [EMAIL PROTECTED] wrote: > Hi, > > I create a dictionary like this > myDict = {} > > and I add entry like this: > myDict['a'] = 1 > but how can I empty the whole dictionary? Reading the Python docs might help. But before, I would try a dir(myDict). Maybe you will find an

Re: SimpleXMLRPCServer and Threading

2007-03-28 Thread Erik Johnson
"Achim Domma" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > is SimpleXMLRPCServer multithreaded or how does it handle multiple > clients? I want to implement a simple server which will be queried by > multiple processes for work to be done. The server will simply hold a > q

Re: Hpw make lists that are easy to sort.

2007-03-28 Thread Anton Vredegoor
Terry Reedy wrote: > One could generate the items in order in less space by doing, for instance, > an m-way merge, in which only the lowest member of each of the m sublists > is present at any one time. But I don't know if this (which is > O(m*n*log(m))) would be any faster (in some Python imp

Re: XML/encoding/prolog/python hell...

2007-03-28 Thread Diez B. Roggisch
fscked schrieb: > I am a beginning pythoner and I am having a terrible time trying to > figure out how to do something that (it would seeme to me) should be > fairly simple. Show us code. As concise as possible. Then we might be able to help you. Diez -- http://mail.python.org/mailman/listinfo/p

Re: XML/encoding/prolog/python hell...

2007-03-28 Thread Gabriel Genellina
En Wed, 28 Mar 2007 15:06:28 -0300, <[EMAIL PROTECTED]> escribió: > You could probably also use a combination of the csv module and the > pyxml module (links below). > > http://pyxml.sourceforge.net/topics/ Note the pyxml summary page on SourceForge: "PyXML is no longer maintained." -- Gabrie

Re: how can I clear a dictionary in python

2007-03-28 Thread Christian Tismer
On 29.03.2007, at 00:48, Larry Bates wrote: > [EMAIL PROTECTED] wrote: >> Hi, >> >> I create a dictionary like this >> myDict = {} >> >> and I add entry like this: >> myDict['a'] = 1 >> but how can I empty the whole dictionary? >> >> Thank you. >> > > just point myDict to an empty dictionary agai

Re: how can I clear a dictionary in python

2007-03-28 Thread Aahz
In article <[EMAIL PROTECTED]>, Larry Bates <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: >> >> I create a dictionary like this >> myDict = {} >> >> and I add entry like this: >> myDict['a'] = 1 >> but how can I empty the whole dictionary? > >just point myDict to an empty dictionary again

Re: how can I clear a dictionary in python

2007-03-28 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi, > > I create a dictionary like this > myDict = {} > > and I add entry like this: > myDict['a'] = 1 > but how can I empty the whole dictionary? >>> help(dict) Help on class dict in module __builtin__: class dict(object) (...) | Methods defined here: (...)

Re: Creating a new data structure while filtering its data origin.

2007-03-28 Thread Larry Bates
[EMAIL PROTECTED] wrote: > Hi everyone. > > I'm trying to work with very simple data structures but I'm stuck in the very > first steps. If someone has the luxury of a few minutes and can give an > advice how to resolve this, I'll really appreciate it. > > 1- I have a list of tuples like this:

how can I clear a dictionary in python

2007-03-28 Thread Marko . Cain . 23
Hi, I create a dictionary like this myDict = {} and I add entry like this: myDict['a'] = 1 but how can I empty the whole dictionary? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Hpw make lists that are easy to sort.

2007-03-28 Thread Terry Reedy
"Anton Vredegoor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Paul Rubin wrote: | | > Well there are various hacks one can think of, but is there an actual | > application you have in mind? | | Suppose both input lists are sorted. Then the product list is still not | sorted but

Re: How can I find out the size of a file

2007-03-28 Thread Irmen de Jong
[EMAIL PROTECTED] wrote: > How can I find out the size of a file in a disk in python? os.path.getsize(filename) -Irmen -- http://mail.python.org/mailman/listinfo/python-list

How can I find out the size of a file

2007-03-28 Thread Marko . Cain . 23
Hi, How can I find out the size of a file in a disk in python? i try this, but it does not work: size = open(inputFileNameDir + "/" + file, 'r').size() Thank for any help. -- http://mail.python.org/mailman/listinfo/python-list

Re: PDB does not allow jumping to first statement?

2007-03-28 Thread Chris Lasher
I have submitted this as a bug via SourceForge: or if munged The Python folks would like a test case and/or a patch. This is well beyond my ken as a humble Python user. Could anybody m

Re: manually implementing staticmethod()?

2007-03-28 Thread Michael Spencer
"7stud" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > Can someone show me how to manually implement staticmethod()? Here is > my latest attempt: > Raymond Hettinger can: http://users.rcn.com/python/download/Descriptor.htm#static-methods-and-class-methods

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Christian Tismer
On 28.03.2007, at 23:36, Jarek Zgoda wrote: > Carl Friedrich Bolz napisał(a): > >> Welcome to the PyPy 1.0 release - a milestone integrating the results >> of four years of research, engineering, management and sprinting >> efforts, concluding the 28 months phase of EU co-funding! > > So it took

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Carl Friedrich Bolz
Kay Schluehr wrote: > Nice to read that things are going on. I've still a PyPy 0.7 version > on my notebook. I guess I will upgrade :) > > A somewhat unrelated question. With Py3K Python gets optional type > annotations. Are you already architecting an annotation handler that > can process th

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Jarek Zgoda
Carl Friedrich Bolz napisał(a): > Welcome to the PyPy 1.0 release - a milestone integrating the results > of four years of research, engineering, management and sprinting > efforts, concluding the 28 months phase of EU co-funding! So it took 4 yars of work and over 2 yaers of consumption of EU fu

Creating a new data structure while filtering its data origin.

2007-03-28 Thread mmara
Hi everyone. I'm trying to work with very simple data structures but I'm stuck in the very first steps. If someone has the luxury of a few minutes and can give an advice how to resolve this, I'll really appreciate it. 1- I have a list of tuples like this: lista= [(162, 141, 3), (162, 141, 3), (

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Carl Friedrich Bolz
Hi! dmitrey wrote: > Hi! > Suppose I have a py-written module. > Is it possible somehow run PyPy on the whole module? > I didn't find it in documentation. > And if yes (or if just run in every module func) what will be after > computer restart? > Should I restart PyPy on the module once again? >

Re: XML/encoding/prolog/python hell...

2007-03-28 Thread fscked
[EMAIL PROTECTED] wrote: <---SNIP---> > I've never done this, but I found a recipe on the ActiveState website > that looks like it would be helpful: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/159100 I tried looking at that but couldn't figure out how to get the property file wor

Finding User Profile path

2007-03-28 Thread kyosohma
Hi, I am trying to query our domain to get a list of our users profile locations. I thought I might be able to use WMI, but I can't get it to work. I am using a Windows XP Pro workstation and Python 2.4 on a mixed environment of Debian Linux (with Samba) and Windows servers. We are in the process

manually implementing staticmethod()?

2007-03-28 Thread 7stud
Hi, Can someone show me how to manually implement staticmethod()? Here is my latest attempt: def smethod(func): def newFunc(): pass def newGet(): print "new get" newFunc.__get__ = newGet return newFunc class Tes

Re: SimpleXMLRPCServer and Threading

2007-03-28 Thread Jeff McNeil
I do it this way and it's always worked great for me. SimpleXMLRPCServer is based on SocketServer, so you can use the ForkingMixIn or ThreadingMixIn classe to create something to handle requests in parallel. from SocketServer import ThreadingMixIn import SimpleXMLRPCServer class ThreadedXMLRPCS

Re: Finding a module's sub modules at runtime

2007-03-28 Thread Joshua J. Kugler
On Wednesday 28 March 2007 12:04, [EMAIL PROTECTED] wrote: >> All works fine. However, when I import ModTest, I would like it to >> discover and store the names of the modules beneath it, and construct a >> list, say mod_list, that I can access later to find the names of the >> sub-modules in >> t

Re: Question about extending tuple

2007-03-28 Thread Georg Brandl
abcd schrieb: >> As an immutable type, tuple makes use of __new__. >> >> class MyTuple(tuple): >> def __new__(cls, *args): >> return tuple.__new__(cls, args) >> >> should work. >> >> Georg > > strange. not very consistent. On the contrary -- __new__ *and* __init__ exist for all typ

Re: newbi question on python rpc server, how it works?

2007-03-28 Thread Goldfish
> > I have a need where I need to create a layer of business logic that > > will connect to mysql database at one end and a wxpython based thin > > client at the other end. Spring Python offers something similar (http://springpython.python- hosting.com/wiki/DistributedRemoting) to link up clients

Re: Hpw make lists that are easy to sort.

2007-03-28 Thread Anton Vredegoor
Paul Rubin wrote: > Well there are various hacks one can think of, but is there an actual > application you have in mind? Suppose both input lists are sorted. Then the product list is still not sorted but it's also not completely unsorted. How can I sort the product? I want to know if it is n

SimpleXMLRPCServer and Threading

2007-03-28 Thread Achim Domma
Hi, is SimpleXMLRPCServer multithreaded or how does it handle multiple clients? I want to implement a simple server which will be queried by multiple processes for work to be done. The server will simply hold a queue with files to process. The clients will ask for the next file. Do I have to s

dynamic module does not define init function (initpsycopgmodule)

2007-03-28 Thread kickslop
Clearly I am doing something braindead here with psycopg 1.1.21 (psycopg2 is not an option). Any ideas? I get the same results when I build it with Red Hat's GCC 3.4.6 setup as well as our in-house GCC 3.3.5 setup. Linux rcf-temp3 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:32:02 EDT 2006 x86_64 x86_64

Re: Finding a module's sub modules at runtime

2007-03-28 Thread kyosohma
On Mar 28, 2:44 pm, "Joshua J. Kugler" <[EMAIL PROTECTED]> wrote: > [If this is documented somewhere, please just point me there. I googled on > the terms that made sense to me, and didn't find anything.] > > So, I have: > > ModTest > __init__.py > AModule.py > BModule.py >

Re: Question about extending tuple

2007-03-28 Thread abcd
> As an immutable type, tuple makes use of __new__. > > class MyTuple(tuple): > def __new__(cls, *args): > return tuple.__new__(cls, args) > > should work. > > Georg strange. not very consistent. -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about extending tuple

2007-03-28 Thread Lawrence Oluyede
abcd <[EMAIL PROTECTED]> wrote: > I wanted to extend tuple but ran into a problem. Here is what I > thought would work I think you should take a look at this to do it properly from the Python devs: http://svn.python.org/view/python/trunk/Lib/collections.py Look for NamedTuple -- Lawrence, oluy

Re: newbi question on python rpc server, how it works?

2007-03-28 Thread Jeff McNeil
I've built a bit of an account provisioning/support framework here based on SimpleXMLRPCServer (which is the one bundled w/ Python). Take a look at http://docs.python.org/lib/module-SimpleXMLRPCServer.html as it also includes a bit of a code example. It seems to work fine for my needs in that I

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread dmitrey
Hi! Suppose I have a py-written module. Is it possible somehow run PyPy on the whole module? I didn't find it in documentation. And if yes (or if just run in every module func) what will be after computer restart? Should I restart PyPy on the module once again? And are there any chances/intends fo

Finding a module's sub modules at runtime

2007-03-28 Thread Joshua J. Kugler
[If this is documented somewhere, please just point me there. I googled on the terms that made sense to me, and didn't find anything.] So, I have: ModTest __init__.py AModule.py BModule.py CModule.py All works fine. However, when I import ModTest, I would like i

Re: Question about extending tuple

2007-03-28 Thread Georg Brandl
abcd schrieb: > I wanted to extend tuple but ran into a problem. Here is what I > thought would work > > class MyTuple(tuple): > def __init__(self, *args): > tuple.__init__(self, args) > > x = MyTuple(1,2,3,4) > > That gives me... > > TypeError: tuple() takes at most 1 argument (4

Question about extending tuple

2007-03-28 Thread abcd
I wanted to extend tuple but ran into a problem. Here is what I thought would work class MyTuple(tuple): def __init__(self, *args): tuple.__init__(self, args) x = MyTuple(1,2,3,4) That gives me... TypeError: tuple() takes at most 1 argument (4 given). However, this call works: x

Re: newbi question on python rpc server, how it works?

2007-03-28 Thread Larry Bates
krishnakant Mane wrote: > hello, > searched a lot of places including google search but can't find > answers to python-rpc. I am also very new to rpc. I am very clear > about its meaning and where it is to be used, but not about how it is > done. > I have a need where I need to create a layer of

Re: very strange syntax errors

2007-03-28 Thread Peter Otten
Georg Brandl wrote: > Peter Otten schrieb: >> A guess: you may have mixed Unix ("\n") and Windows ("\r\n") newlines. >> Try to ensure that every line ends with "\r\n". > > That shouldn't be a problem since Python reads source files in universal > newline mode. Oops, I should have guessed /that/

newbi question on python rpc server, how it works?

2007-03-28 Thread krishnakant Mane
hello, searched a lot of places including google search but can't find answers to python-rpc. I am also very new to rpc. I am very clear about its meaning and where it is to be used, but not about how it is done. I have a need where I need to create a layer of business logic that will connect to

Re: Hpw make lists that are easy to sort.

2007-03-28 Thread Paul Rubin
Anton Vredegoor <[EMAIL PROTECTED]> writes: > Presorting the second sequence gains us more than three seconds. I > wonder if there is a way to generate the combined items in such a way > that sorting them is even faster? Is there some other sorting > algorithm that can specifically take advantage o

Re: very strange syntax errors

2007-03-28 Thread hg
Facundo Batista wrote: > hg wrote: > > >> I'v been facing some very strange errors lately: >> >> one example: > > You'll need to paste here the exact code and the traceback. > > Regards, > > -- > . Facundo > . > Blog: http://www.taniquetil.com.ar/plog/ > PyAr: http://www.python.org/ar/ Hi,

Re: XML/encoding/prolog/python hell...

2007-03-28 Thread kyosohma
On Mar 28, 12:40 pm, "fscked" <[EMAIL PROTECTED]> wrote: > I am a beginning pythoner and I am having a terrible time trying to > figure out how to do something that (it would seeme to me) should be > fairly simple. > > I have a CSV file of unknown encoding and I need to parse that file to > get the

Re: Hpw make lists that are easy to sort.

2007-03-28 Thread kyosohma
On Mar 28, 12:12 pm, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > Python's sorting algorithm takes advantage of preexisting order in a > sequence: > > #sort_test.py > import random > import time > > def test(): > n = 1000 > k = 2**28 > > L = random.sample(xrange(-k,k),n) > R = r

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread bearophileHUGS
Kay Schluehr: > RPython is heuristically defined as a subset of Python "static enough > to be translatable to C". So it is actually static analysis that is > done here, not on a local scale but on a simpler sublanguage. It is > not clear to me whether for a sufficiently annotated Py3K program the >

Re: very strange syntax errors

2007-03-28 Thread Georg Brandl
Peter Otten schrieb: > hg wrote: > >> I'v been facing some very strange errors lately: >> >> one example: >> >> def __init__(self): >> >> import my_info >> some_text = my_info.T_SOME_TEXT >> ^ syntax error >> >> >> I manage to get rid

Re: very strange syntax errors

2007-03-28 Thread Facundo Batista
hg wrote: > I'v been facing some very strange errors lately: > > one example: You'll need to paste here the exact code and the traceback. Regards, -- . Facundo . Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ -- http://mail.python.org/mailman/listinfo/python-lis

Re: pattern search

2007-03-28 Thread Fabian Braennstroem
Hi, Gabriel Genellina schrieb am 03/27/2007 10:09 PM: > En Tue, 27 Mar 2007 18:42:15 -0300, Diez B. Roggisch <[EMAIL PROTECTED]> > escribió: > >> Paul McGuire schrieb: >>> On Mar 27, 10:18 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: Fabian Braennstroem wrote: > wh

XML/encoding/prolog/python hell...

2007-03-28 Thread fscked
I am a beginning pythoner and I am having a terrible time trying to figure out how to do something that (it would seeme to me) should be fairly simple. I have a CSV file of unknown encoding and I need to parse that file to get the fields <--- DONE I need to create an xml document that has the prop

Re: very strange syntax errors

2007-03-28 Thread skip
>> I'v been facing some very strange errors lately: >> >> one example: >> >> def __init__(self): >> >> import my_info >> some_text = my_info.T_SOME_TEXT >>^ syntax error >> >> I manage to get rid of that

Re: very strange syntax errors

2007-03-28 Thread Peter Otten
hg wrote: > I'v been facing some very strange errors lately: > > one example: > > def __init__(self): > > import my_info > some_text = my_info.T_SOME_TEXT > ^ syntax error > > > I manage to get rid of that one by moving the import on t

Re: very strange syntax errors

2007-03-28 Thread David Nicolson
This might be stating the obvious, but have you detabbed your text, if you are using spaces? On 28/03/2007, at 8:18 PM, hg wrote: > hg wrote: > >> Hi, >> >> I'v been facing some very strange errors lately: >> >> one example: >> >> def __init__(self): >> >> import my_info >>

Re: very strange syntax errors

2007-03-28 Thread Terry Reedy
"hg" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I'v been facing some very strange errors lately: | one example: | | def __init__(self): | |import my_info |some_text = my_info.T_SOME_TEXT | ^ syntax error | | I manage to

Re: Why doesnt __getattr__ with decorator dont call __get_method in decorator

2007-03-28 Thread Arnaud Delobelle
On Mar 28, 3:47 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > glomde <[EMAIL PROTECTED]> wrote: > > Hi, > > > I tried to write a decorator for that should be for methods but for > > some reasons > > it doens seem to work when you try to do it on the __getattr__ method > > in a class. > > Could any

Re: very strange syntax errors

2007-03-28 Thread hg
hg wrote: > Hi, > > I'v been facing some very strange errors lately: > > one example: > > def __init__(self): > > import my_info > some_text = my_info.T_SOME_TEXT > ^ syntax error > > > I manage to get rid of that one by moving the im

Hpw make lists that are easy to sort.

2007-03-28 Thread Anton Vredegoor
Python's sorting algorithm takes advantage of preexisting order in a sequence: #sort_test.py import random import time def test(): n = 1000 k = 2**28 L = random.sample(xrange(-k,k),n) R = random.sample(xrange(-k,k),n) t = time.time() LR = [(i+j) for i in L for j i

Re: Fortran vs Python - Newbie Question

2007-03-28 Thread Terry Reedy
"Tim Roberts" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Well, I'm being a bit argumentative here, but it's hard to deny that the | use of "compiled" in the context of .pyc (or .javac) is very different from | the use of "compiled" in the context of running gcc. Besides the f

very strange syntax errors

2007-03-28 Thread hg
Hi, I'v been facing some very strange errors lately: one example: def __init__(self): import my_info some_text = my_info.T_SOME_TEXT ^ syntax error I manage to get rid of that one by moving the import on top of my file. Note: Python 2

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Kay Schluehr
On Mar 28, 4:34 pm, Paul Rubin wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > A somewhat unrelated question. With Py3K Python gets optional type > > annotations. Are you already architecting an annotation handler that > > can process these annotations? This featu

Re: Fortran vs Python - Newbie Question

2007-03-28 Thread Michael Tobis
I feel obligated to fan the flames a bit by pointing to http://www.fortranstatement.com/ a site which advocates discontinuing development of Fortran and does a good job of summarizing the problems with the contemporary development of that language. I am not convinced that a new high performance la

Re: Why doesnt __getattr__ with decorator dont call __get_method in decorator

2007-03-28 Thread 7stud
On Mar 28, 8:28 am, "glomde" <[EMAIL PROTECTED]> wrote: > Hi, > > I tried to write a decorator for that should be for methods but for > some reasons > it doens seem to work when you try to do it on the __getattr__ method > in a class. > Could anybody give some hints why this is? > All you have to

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Carl Friedrich Bolz
Hi Christian! Christian Tismer wrote: > On 28.03.2007, at 10:38, Carl Friedrich Bolz wrote: > >> Brain error on our side: the gc_pypy.dll is the dll of the Boehm >> garbage >> collector, which you would need to compile yourself (which makes >> precompiled binaries a bit useless :-) ). We update

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Kay Schluehr
On Mar 28, 2:54 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > On 28 Mar, 14:12, "Kay Schluehr" <[EMAIL PROTECTED]> wrote: > > > > > A somewhat unrelated question. With Py3K Python gets optional type > > annotations. > > No, I believe the consensus is that Python 3000 gets optional > annotations wh

Re: Numeric Soup

2007-03-28 Thread Harry George
"Erik Johnson" <[EMAIL PROTECTED]> writes: > "Robert Kern" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > http://www.scipy.org/History_of_SciPy > > > > numpy is the current array package and supercedes Numeric and numarray. > scipy > > provides a bunch of computational routin

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Christian Tismer
On 28.03.2007, at 10:38, Carl Friedrich Bolz wrote: > Brain error on our side: the gc_pypy.dll is the dll of the Boehm > garbage > collector, which you would need to compile yourself (which makes > precompiled binaries a bit useless :-) ). We updated the zip file, > would > you mind checking

Re: Python automatic testing: mocking an imported module?

2007-03-28 Thread Mark T
"Silfheed" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Heyas > > So we have the following situation: we have a testee.py that we want > to automatically test out and verifiy that it is worthy of being > deployed. We want our tester.py to test the code for testee.py > without ch

Re: Why doesnt __getattr__ with decorator dont call __get_method in decorator

2007-03-28 Thread glomde
On Mar 28, 4:47 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: > glomde <[EMAIL PROTECTED]> wrote: > > Hi, > > > I tried to write a decorator for that should be for methods but for > > some reasons > > it doens seem to work when you try to do it on the __getattr__ method > > in a class. > > Could any

Re: socket read timeout

2007-03-28 Thread hg
[EMAIL PROTECTED] wrote: > > hg> My issue with that is the effect on write: I only want a timeout > on > hg> read ... but anyway ... > > So set a long timeout when you want to write and short timeout when you > want to read. > > Skip Not bad .. thanks -- http://mail.python.org

  1   2   >