Re: Why are there no ordered dictionaries?

2005-11-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Fredrik Lundh wrote: > > but you can easily generate an index when you need it: > > > > index = dict(d) > > > > name, type = index["pid"] > > print name > > > > the index should take less than a microsecond to create, and since it > > points to the members of

Re: setattr for secondary attribute

2005-11-20 Thread Fredrik Lundh
Alex wrote: > I apologize for asking maybe a very trivial question. > I have a new class object A with slots. One of the slots is, for > example, object spam. Object spam, in turn, also has slots and one of > them is attribute eggs. I need to assign a new value to eggs. In other > words, I need t

Re: ownership problem?

2005-11-20 Thread Fredrik Lundh
Jeffrey Schwab wrote: > > the problem isn't determining who owns it, the problem is determining > > who's supposed to release it. that's not a very common problem in a > > garbage-collected language... > > Yes it is. Memory is only one type of resource. Python's garbage collector deals with obj

Re: Aproximative string matching

2005-11-20 Thread Tim Roberts
"javuchi" <[EMAIL PROTECTED]> wrote: > >I'm searching for a library which makes aproximative string matching, >for example, searching in a dictionary the word "motorcycle", but >returns similar strings like "motorcicle". > >Is there such a library? There is an algorithm called Soundex that replace

Re: BaseHTTPServer module

2005-11-20 Thread Tim Roberts
"amfr" <[EMAIL PROTECTED]> wrote: > >>From the BaseHTTPServer module, how do i gget the POST or GET data sent >by the client? Is it stired the the file they requested? e.g. >objectname.path Did you check the documentation in the module? You need to derive your own class from BaseHTTPServer. In

about dictionary

2005-11-20 Thread Technical Support of Intercable Co
>>> b=dict.fromkeys(a) -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem printing in Win98

2005-11-20 Thread Tim Roberts
"Maravilloso" <[EMAIL PROTECTED]> wrote: > >I'm trying to automatically send a postscript file to be printed to the >default printer in a Win98 PC, by means of using the instrucction: > > win32api.ShellExecute (0, "print", "file.ps", None, ".", 0) > >but it raises an exception with the message: >

Re: check if com api is still available

2005-11-20 Thread Tim Roberts
Neil Hodgson <[EMAIL PROTECTED]> wrote: > >All running COM servers should be in the "Running Object Table" >(ROT). If you search the net for this term you will find code that can >show what is in the ROT, so there must be an API. If only. The Microsoft Office applications seem to be the onl

Re: Python under Citrix Metaframe

2005-11-20 Thread Tim Roberts
"Xaver Hinterhuber" <[EMAIL PROTECTED]> wrote: > >I wanted to use python under Citrix Metaframe. >After installation of the ActivePython 2.4.1 msi-File, printing under Citrix >Metaframe no longer worked. That seems incredible unlikely. Are you talking about printing to a printer on the server, o

Re: best cumulative sum

2005-11-20 Thread [EMAIL PROTECTED]
Erik Max Francis wrote: > Micah Elliott wrote: > > > On Nov 21, David Isaac wrote: > > > >> What's the good way to produce a cumulative sum? > > > import operator > x = 1,2,3 > reduce(operator.add, x) > > 6 > > Or just sum(x). > He seems to want scanl -- http://mail.python.org/

Re: Underscores in Python numbers

2005-11-20 Thread bearophileHUGS
Peter Hansen>Or maybe one should instead interpret this as "numeric literals need more bells and whistles, and I don't care which of these two we add, but we have to do *something*!". :-) The purpose of my words was: when you think about adding a new syntax/functionality to a language, you have to

Re: best cumulative sum

2005-11-20 Thread Robert Kern
Erik Max Francis wrote: > Micah Elliott wrote: > >>On Nov 21, David Isaac wrote: >>>What's the good way to produce a cumulative sum? >> >import operator >x = 1,2,3 >reduce(operator.add, x) >> >>6 > > Or just sum(x). That just gives you the tail end. The OP asked for a cumulative sum;

Re: ownership problem?

2005-11-20 Thread elbertlev
Yes! Python uses auto garbage collection. As soon as the object reference count becomes 0 it is removed from existence. So the problem typical for C/C++: accessing pointers to already deleted objects does not exist in Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: best cumulative sum

2005-11-20 Thread Erik Max Francis
Micah Elliott wrote: > On Nov 21, David Isaac wrote: > >> What's the good way to produce a cumulative sum? > import operator x = 1,2,3 reduce(operator.add, x) > 6 Or just sum(x). -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20

Re: best cumulative sum

2005-11-20 Thread Micah Elliott
On Nov 21, David Isaac wrote: > What's the good way to produce a cumulative sum? >>> import operator >>> x = 1,2,3 >>> reduce(operator.add, x) 6 -- _ _ ___ |V|icah |- lliott <>< [EMAIL PROTECTED] " " """ -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are there no ordered dictionaries?

2005-11-20 Thread [EMAIL PROTECTED]
Ben Finney wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > [sort by] some other metadata that is not present in the data. > > [...] > > Of course, you may say, just put another column that represent > > this(some reporting programs I have seen do it this way) and that is > > an option bu

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Ben Finney
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > [sort by] some other metadata that is not present in the data. > [...] > Of course, you may say, just put another column that represent > this(some reporting programs I have seen do it this way) and that is > an option but not the only option. It's a

[ANN] Python API InformixDB-2.1 released

2005-11-20 Thread Carsten Haese
Hi everybody: I am proud to announce a new release of InformixDB, the IBM Informix implementation of the Python DB API. This release adds the following new features: * Scroll cursors and cursors with hold * Support for INTERVAL types * Support for Smart Large Objects * Support for User Defined T

Re: Why are there no ordered dictionaries?

2005-11-20 Thread [EMAIL PROTECTED]
Bengt Richter wrote: > On Sun, 20 Nov 2005 22:03:34 +0100, Christoph Zwerschke <[EMAIL PROTECTED]> > wrote: > >> Ordering the keys isn't the normal case, and can be done easily when > >> needed. > > > >That depends. Maybe I do not want the keys to be sorted alphabetically, > >but according to som

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Bengt Richter
On Sun, 20 Nov 2005 22:03:34 +0100, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >> Ordering the keys isn't the normal case, and can be done easily when >> needed. > >That depends. Maybe I do not want the keys to be sorted alphabetically, >but according to some criteria which cannot be derived

Re: Any royal road to Bezier curves...?

2005-11-20 Thread Robert Kern
Warren Francis wrote: > I'm fairly new to Python (2-3 months) and I'm trying to figure out a simple > way to implement Bezier curves... So far I've tried the following: > > http://runten.tripod.com/NURBS/ > ...which won't work because the only compiled binaries are for Windows 2000, > python 2.

setattr for secondary attribute

2005-11-20 Thread Alex
I apologize for asking maybe a very trivial question. I have a new class object A with slots. One of the slots is, for example, object spam. Object spam, in turn, also has slots and one of them is attribute eggs. I need to assign a new value to eggs. In other words, I need to perform the following

Any royal road to Bezier curves...?

2005-11-20 Thread Warren Francis
I'm fairly new to Python (2-3 months) and I'm trying to figure out a simple way to implement Bezier curves... So far I've tried the following: http://runten.tripod.com/NURBS/ ...which won't work because the only compiled binaries are for Windows 2000, python 2.1. I'm on Windows XP (for now), u

Re: about dictionary

2005-11-20 Thread Bengt Richter
On Sun, 20 Nov 2005 07:12:08 -0800, Shi Mu <[EMAIL PROTECTED]> wrote: >d is a dictionary. d >{0: [[0, 1], [0, 2]], 1: [[0, 1], [1, 2], [1, 3]], 2: [[0, 2], [1, 2], >[2, 3]], 3: [[1, 3], [2, 3]]} > >for the value under each key, if the possible connection is in the >dictionary, for example, un

Re: best cumulative sum

2005-11-20 Thread Steven D'Aprano
David (Alan) Isaac wrote: > What's the good way to produce a cumulative sum? > E.g., given the list x, > cumx = x[:] > for i in range(1,len(x)): > cumx[i] = cumx[i]+cumx[i-1] > > What's the better way? Is there something that this doesn't do, or something it does do that it shouldn't? You cou

Re: best cumulative sum

2005-11-20 Thread Robert Kern
David Isaac wrote: > What's the good way to produce a cumulative sum? > E.g., given the list x, > cumx = x[:] > for i in range(1,len(x)): > cumx[i] = cumx[i]+cumx[i-1] > > What's the better way? Define better. More accurate? Less code? -- Robert Kern [EMAIL PROTECTED] "In the fields of hell w

Re: Aproximative string matching

2005-11-20 Thread Steven D'Aprano
[EMAIL PROTECTED] wrote: > This algorithm is called soundex. Here is one implementation example. > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52213 > > here is another: > http://effbot.org/librarybook/soundex.htm Soundex is *one* particular algorithm for approximate string match

best cumulative sum

2005-11-20 Thread David Isaac
What's the good way to produce a cumulative sum? E.g., given the list x, cumx = x[:] for i in range(1,len(x)): cumx[i] = cumx[i]+cumx[i-1] What's the better way? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: about list

2005-11-20 Thread Jeffrey Schwab
[EMAIL PROTECTED] wrote: > Shi Mu wrote: > >>How to run a function to make [1,2,4] become [[1,2],1,4],[2,4]]? >>Thanks! > > > You want [[1,2],[1,4],[2,4]]? That is, all combinations of 2 items > from > the list? You might want to look at: > http://aspn.activestate.com/ASPN/Cookbook/Python/Reci

Re: Type-checking unpickled objects

2005-11-20 Thread Gordon Airporte
> I guess I'll > need a throwaway instance of the class to run type() on to get a usable > type object for comparison, but I'll work something out. Never mind - I can just pass the name of the class, as it should be. -- http://mail.python.org/mailman/listinfo/python-list

Re: Aproximative string matching

2005-11-20 Thread elbertlev
This algorithm is called soundex. Here is one implementation example. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52213 here is another: http://effbot.org/librarybook/soundex.htm -- http://mail.python.org/mailman/listinfo/python-list

How to install python2.4.2 on IRIX6.5 ?

2005-11-20 Thread Xiao Jianfeng
Hello, I am trying to install python2.4.2 on a SGI origin3200 machine running IRIX6.5. The native c compiler was used to compile python. "./configure --prefix=/my/path/to/install" runs ok, then, "smake OPT= " runs ok but "smake test" gets errors, here is the output: --

global definition

2005-11-20 Thread Shi Mu
I have a code here. I understand i can not draw lines without the global definition of lastX and lastY. But still confused by its use. when should we use global definition? from Tkinter import * root = Tk() c = Canvas(root, bg='#0e2e0e', height=500, width=1000) frame = c lastX="" lastY="" def cl

Re: Web-based client code execution

2005-11-20 Thread Paul Watson
John J. Lee wrote: > Paul Watson <[EMAIL PROTECTED]> writes: > > >>What are the options? >> >>The user to hits a web page, downloads code (Python I hope), execute it, >>and be able to return the results. It needs to be able to go through >>standard HTTP so that it could be run from behind a co

Re: Web-based client code execution

2005-11-20 Thread Kent Johnson
Paul Watson wrote: > Kent Johnson wrote: >> Stephen Kellett wrote: >>> ActiveState do a version of Python that can run in a script tag like >>> JavaScript and VBScript. This requires Windows Scripting Host. They >>> also do a similar thing for Perl, not sure about TCL. >> >> See >> http://groups.

Re: Type-checking unpickled objects

2005-11-20 Thread Gordon Airporte
isinstance! Now why didn't I know about that? Thanks you. I guess I'll need a throwaway instance of the class to run type() on to get a usable type object for comparison, but I'll work something out. As to the security considerations...this is a small enough program with a limited enough release

Re: Web-based client code execution

2005-11-20 Thread Paul Watson
David Wahler wrote: > Steve wrote: > >>AJAX works because browsers can execute javascript. I don't know of a >>browser that can execute python. Basically your stuck with java or >>javascript because everything else really isn't cross platform > > > Don't jump to conclusions... > http://dwahler

Re: about list

2005-11-20 Thread rurpy
Shi Mu wrote: > How to run a function to make [1,2,4] become [[1,2],1,4],[2,4]]? > Thanks! You want [[1,2],[1,4],[2,4]]? That is, all combinations of 2 items from the list? You might want to look at: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465 >>> import * from xpermutations

Re: Underscores in Python numbers

2005-11-20 Thread Bengt Richter
On Sun, 20 Nov 2005 15:50:10 +0100, Eric Jacoboni <[EMAIL PROTECTED]> wrote: >Mike Meyer <[EMAIL PROTECTED]> writes: > >> I've seen at least one language (forget which one) that allowed such >> separators, but only for groups of three. So 123_456 would be valid, >> but 9_1 would be a syntax error.

Re: Web-based client code execution

2005-11-20 Thread Paul Watson
Kent Johnson wrote: > Stephen Kellett wrote: > >> In message <[EMAIL PROTECTED]>, >> Steve <[EMAIL PROTECTED]> writes >> >>> AJAX works because browsers can execute javascript. I don't know of a >>> browser that can execute python. Basically your stuck with java or >>> javascript because everyt

Re: Underscores in Python numbers

2005-11-20 Thread Bengt Richter
On Sun, 20 Nov 2005 15:50:10 +0100, Eric Jacoboni <[EMAIL PROTECTED]> wrote: >Mike Meyer <[EMAIL PROTECTED]> writes: > >> I've seen at least one language (forget which one) that allowed such >> separators, but only for groups of three. So 123_456 would be valid, >> but 9_1 would be a syntax error.

Re: Underscores in Python numbers

2005-11-20 Thread Bengt Richter
On Sun, 20 Nov 2005 15:37:40 +, Steve Holden <[EMAIL PROTECTED]> wrote: >David M. Cooke wrote: >> Peter Hansen <[EMAIL PROTECTED]> writes: >> >> >>>Steven D'Aprano wrote: >>> Dealing with numeric literals with lots of digits is a real (if not earth-shattering) human interface problem

Re: Why are there no ordered dictionaries?

2005-11-20 Thread [EMAIL PROTECTED]
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > > Using the same logic, we don't need types other than string in a DBMS > > as we can always convert a string field into some other types when it > > is needed. > > You mean, like SQLite does? (http://www.sqlite.org/datatypes.html) > Yup, they are

Aproximative string matching

2005-11-20 Thread javuchi
I'm searching for a library which makes aproximative string matching, for example, searching in a dictionary the word "motorcycle", but returns similar strings like "motorcicle". Is there such a library? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Using the same logic, we don't need types other than string in a DBMS > as we can always convert a string field into some other types when it > is needed. You mean, like SQLite does? (http://www.sqlite.org/datatypes.html) -Peter -- http://mail.python.org/mailman/listi

Re: path module / class

2005-11-20 Thread Peter Hansen
Neil Hodgson wrote: >>> There is a cost to the change as there will be two libraries that >>> have to be known to understand code. ... >At that point I was thinking about os.path and path.py. Readers will > encounter code that uses both of these libraries. Okay, granted. I guess this is th

Re: Why are there no ordered dictionaries?

2005-11-20 Thread [EMAIL PROTECTED]
Alex Martelli wrote: > [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >... > > there are at least two behaviour. What I need is a "preferred order". > > Say if I have designed a web form(correspond to a database table), I > > just want say 3 fields that goes before anything else in the > > prese

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Mike Meyer
Christoph Zwerschke <[EMAIL PROTECTED]> writes: > Ben Finney wrote: >> Another possibility: ordered dictionaries are not needed when Python >> 2.4 has the 'sorted' builtin. > The 'sorted' function does not help in the case I have indicated, > where "I do not want the keys to be sorted alphabeticall

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Alex Martelli
Christoph Zwerschke <[EMAIL PROTECTED]> wrote: ... > The 'sorted' function does not help in the case I have indicated, where > "I do not want the keys to be sorted alphabetically, but according to > some criteria which cannot be derived from the keys themselves." Ah, but WHAT 'some criteria'?

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Alex Martelli
Christoph Zwerschke <[EMAIL PROTECTED]> wrote: ... > I have started the thread in the first place because I believed it is > pretty unabmiguous what an "ordered dictionary" is and how it should I think you're wrong here. People in the past who have requested or implemented stuff they called '

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: ... > there are at least two behaviour. What I need is a "preferred order". > Say if I have designed a web form(correspond to a database table), I > just want say 3 fields that goes before anything else in the > presentation. The rest I don't care as

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Christoph Zwerschke
[EMAIL PROTECTED] wrote: > Personally, I have needs for ordered dict but I don't think it should > be in standard library though, as different situation called for > different behaviour for "ordered" and skewing my code to a standard lib > way is no good. I have started the thread in the first pla

Re: Why are there no ordered dictionaries?

2005-11-20 Thread [EMAIL PROTECTED]
Christoph Zwerschke wrote: > [EMAIL PROTECTED] wrote: > > Personally, I have needs for ordered dict but I don't think it should > > be in standard library though, as different situation called for > > different behaviour for "ordered" and skewing my code to a standard lib > > way is no good. > > I

Re: about list

2005-11-20 Thread Adonis
Shi Mu wrote: > How to run a function to make [1,2,4] become [[1,2],1,4],[2,4]]? > Thanks! From what I gather try: a = [1,2,4] n = list() for i in a: index = a.index(i) + 1 for x in a[index:]: n.append([i, x]) print n more elegant ways to do this, but its a start. hope this h

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Christoph Zwerschke
Ben Finney wrote: > Without an example, it's hard to know what you want to do and whether > an ordered dictionary is the best way to do it. I have indicated an example, discussed in more detail in another subthread. >> There are already enough competing implementations. > Have they been sufficie

Re: about list

2005-11-20 Thread [EMAIL PROTECTED]
try to describe what you want as it is not very obvious, and has syntax error. Shi Mu wrote: > How to run a function to make [1,2,4] become [[1,2],1,4],[2,4]]? > Thanks! -- http://mail.python.org/mailman/listinfo/python-list

about list

2005-11-20 Thread Shi Mu
How to run a function to make [1,2,4] become [[1,2],1,4],[2,4]]? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are there no ordered dictionaries?

2005-11-20 Thread [EMAIL PROTECTED]
Ben Finney wrote: > Another possibility: ordered dictionaries are not needed when Python > 2.4 has the 'sorted' builtin. > What does sorted() have anythng to do with orders like insertion order, or some arbitary order that instead of a,b,c,d,e, I want it as e, c, b, d, a ? Personally, I have need

Re: path module / class

2005-11-20 Thread Neil Hodgson
Peter Hansen: >> There is a cost to the change as there will be two libraries that have >> to be known to understand code. > > Could you please clarify? Which two do you mean? At that point I was thinking about os.path and path.py. Readers will encounter code that uses both of these libr

Re: ownership problem?

2005-11-20 Thread Jeffrey Schwab
Fredrik Lundh wrote: > Jeffrey Schwab wrote: > > >>>Is it correct to say that the typical ownership problem, which >>>frequently arises in C++, does not occur normally in Python? >> >>What "typical ownership problem" do you feel frequently arises in C++? >>If you are referring to the sometimes di

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Christoph Zwerschke
Fredrik Lundh wrote: > if you restructure the list somewhat > d = ( > ('pid', ('Employee ID', 'int')), > ('name', ('Employee name', 'varchar')), > ('sal', ('Salary', 'float')) > ) > you can still loop over the list > ... > but you can easily generate an index whe

Re: Why are there no ordered dictionaries?

2005-11-20 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > but you can easily generate an index when you need it: > > index = dict(d) > > name, type = index["pid"] > print name > > the index should take less than a microsecond to create, and since it > points to the members of the original dict, it doesn't use much memor

Re: what happens when the file begin read is too big for all lines tobe?read with "readlines()"

2005-11-20 Thread Mike Meyer
"Ross Reyes" <[EMAIL PROTECTED]> writes: > Yes, I have read this part > How does one tell exactly what the limitation is to the size of the > returned list of strings? There's not really a good platform-indendent way to do that, because you'll get memory until the OS won't give you any more.

Re: examining python objects

2005-11-20 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > Bruno Desthuilliers wrote: > >>[EMAIL PROTECTED] a écrit : >> >>>Is there a function/class/module/whatever I can use to >>>look at objects? I want something that will print the object's >>>value (if any) in pretty-printed form, and list all it's attributes >>>and their

Re: Underscores in Python numbers

2005-11-20 Thread [EMAIL PROTECTED]
Peter Hansen wrote: > [EMAIL PROTECTED] wrote: > > Peter Hansen wrote: > > > >>But why would anyone want to create numeric literals for credit card > >>numbers? > >> > > May be for space saving ? But storage space being so cheap, this is not > > a very good reason, but still a reason. > > Space sa

Re: HTML generation vs PSP vs Templating Engines

2005-11-20 Thread riplin
>> Using templates means that the code can work with different templates, >> and this should be seamless, it also means that different code can be >> used with the templates, for example if different languages are used. > This seems to contradict your statement that you dislike 'embedding > code o

Re: How to draw a dash line in the Tkinter?

2005-11-20 Thread Shi Mu
On 11/20/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Ben Bush wrote: > > > How to draw a dash line in the Tkinter? > > use the dash option. e.g. > >canvas.create_line(xy, fill="red", dash=(2, 4)) >canvas.create_line(xy, fill="red", dash=(6, 5, 2, 4)) > > (the tuple contains a number of

Re: combine doxygen and doc-strings?

2005-11-20 Thread Diez B. Roggisch
Gabriel Zachmann wrote: > Is there a way to combine doxygen comments, like this one If you are not tied to doxygen, you might consider epydoc - it uses the docstrings, and restructured text which is friendly to the eye. Regards, Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] need a tutorial in tokens ,different types

2005-11-20 Thread Alan Gauld
> could any one suggest me tutorials in different tokenizations and > clear describtion of how can i use token type and assign diff attributes > to tokens What kind of tokens? Are we talking l;exical tokens in a parser or security tokens or what? > also good tutorials in diff data types in

Re: Underscores in Python numbers

2005-11-20 Thread Bruno Desthuilliers
Raymond Hettinger a écrit : > Gustav Hållberg wrote: > >>I tried finding a discussion around adding the possibility to have >>optional underscores inside numbers in Python. This is a popular option >>available in several "competing" scripting langauges, that I would love >>to see in Python. >> >>E

Re: ownership problem?

2005-11-20 Thread Fredrik Lundh
Jeffrey Schwab wrote: > > Is it correct to say that the typical ownership problem, which > > frequently arises in C++, does not occur normally in Python? > > What "typical ownership problem" do you feel frequently arises in C++? > If you are referring to the sometimes difficult task of determining

Re: Ajax for the Developers

2005-11-20 Thread John J. Lee
"Sabin.A.K, Bangalore" <[EMAIL PROTECTED]> writes: [...] > 1. Changing state with links (GET requests) > 2.Asynchronously performing batch operations I don't understand those two. > 3.Breaking the back button [...] http://en.wikipedia.org/wiki/AJAX Also of interest: http://www.mozillazine.or

Re: Underscores in Python numbers

2005-11-20 Thread Steven D'Aprano
On Sun, 20 Nov 2005 15:52:29 -0500, Roy Smith wrote: > You have described, if memory serves, a Taylor series, and those > coefficients are 1/3!, 1/5!, 1/7!, etc. What I would do, rather than > embedding the numeric constants in the code, is embed the formula and have > the machine compute the

Re: Underscores in Python numbers

2005-11-20 Thread Steven D'Aprano
On Sun, 20 Nov 2005 09:27:28 -0500, Peter Hansen wrote: > But why would anyone want to create numeric literals for credit card > numbers? Credit card numbers is not a sensible usage case. Neither are books' ISBNs, or tax file numbers, or telephone numbers -- these are all instances where it mak

Re: Delays getting data on sys.stdin.readline() ?

2005-11-20 Thread Fredrik Lundh
Christian Convey wrote: > So here's what I don't get: If "producer" was retaining its output for > a while for the sake of efficiency, I would expect to see that effect > when I just run "producer" on the command line. That is, I would > expect the console to not show any output from "producer" un

Re: ownership problem?

2005-11-20 Thread Jeffrey Schwab
Gabriel Zachmann wrote: > Is it correct to say that the typical ownership problem, which > frequently arises in C++, does not occur normally in Python? What "typical ownership problem" do you feel frequently arises in C++? If you are referring to the sometimes difficult task of determining whic

Re: ownership problem?

2005-11-20 Thread Ben Finney
Gabriel Zachmann <[EMAIL PROTECTED]> wrote: > Is it correct to say that the typical ownership problem, which > frequently arises in C++, does not occur normally in Python? Could you explain what you mean by "the typical ownership problem"? -- \ "Jealousy: The theory that some other fellow h

Re: Is Python weak on the web side?

2005-11-20 Thread Ravi Teja
Too many options. Google: python web frameworks The first couple of links will point you to enough resources. -- http://mail.python.org/mailman/listinfo/python-list

Re: Web-based client code execution

2005-11-20 Thread John J. Lee
Paul Watson <[EMAIL PROTECTED]> writes: > What are the options? > > The user to hits a web page, downloads code (Python I hope), execute it, > and be able to return the results. It needs to be able to go through > standard HTTP so that it could be run from behind a corporate firewall > withou

Re: ownership problem?

2005-11-20 Thread Bruno Desthuilliers
Gabriel Zachmann a écrit : > Is it correct to say that the typical ownership problem, which > frequently arises in C++, does not occur normally in Python? What is this "typical ownership problem" ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Fredrik Lundh
Christoph Zwerschke wrote: > The example above is a bit misleading, because using 'a', 'b' as keys > can give the impression that you just have to sort() the keys to have > what you want. So let's make it more realistic: > > d = { 'pid': ('Employee ID', 'int'), >'name': ('Employee name', 'varc

Re: Is Python weak on the web side?

2005-11-20 Thread Simon Brunning
On 19/11/05, Michael Goettsche <[EMAIL PROTECTED]> wrote: > On Sunday 20 November 2005 00:24, Tony wrote: > > If I'd like to learn Python for web-development, what are the options > > available? > > A nice framework is CherryPy: http://www.cherrypy.org > or Turbogears, which is based on CherryPy: h

Re: Is Python weak on the web side?

2005-11-20 Thread Bruno Desthuilliers
Tony a écrit : > If I'd like to learn Python for web-development, what are the options > available? There are too many *good* options for web developpement in Python. > Thanks. tony -- http://mail.python.org/mailman/listinfo/python-list

ownership problem?

2005-11-20 Thread Gabriel Zachmann
Is it correct to say that the typical ownership problem, which frequently arises in C++, does not occur normally in Python? Best regards, Gabriel. -- /---\ | Any intelligent fool can make things bigger, more complex,

Re: Web-based client code execution

2005-11-20 Thread Robin Becker
David Wahler wrote: > Steve wrote: > >>AJAX works because browsers can execute javascript. I don't know of a >>browser that can execute python. Basically your stuck with java or >>javascript because everything else really isn't cross platform > > > Don't jump to conclusions... > http://dwahler

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Ben Finney
[restored my attribution line so we know who said what] Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Ben Finney wrote: > > In what cases do you find yourself needing a dict that preserves > > its key order? Can you present a use case that would be improved > > by an ordered dict? > > There ar

Re: func(*params)

2005-11-20 Thread Fredrik Lundh
David Duerrenmatt wrote: > For some reasons, I've to use Python 1.5.2 and am looking for a workaround: > > In newer Python versions, I can call a function this way: > > func = some_function > func(*params) > > Then, the list/tuple named params will automatically be "expanded" and > n=len(params) a

Re: Command line

2005-11-20 Thread Fredrik Lundh
"amfr" wrote: > Hoe would I call something on the command line from python, e.g. "ls > -la"? os.system(cmd), or some relative: http://docs.python.org/lib/os-process.html http://docs.python.org/lib/os-newstreams.html#os-newstreams or http://docs.python.org/lib/module-subprocess.html

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Christoph Zwerschke
[EMAIL PROTECTED] schrieb: > By ordered dict, one usually wants order that is arbitary which cannot > be derived from the content, say insertion order(most ordered dict I > saw use this order). > I am writing a web applications(simple forms) which has a number of > fields. Each field naturally has

BaseHTTPServer module

2005-11-20 Thread amfr
>From the BaseHTTPServer module, how do i gget the POST or GET data sent by the client? Is it stired the the file they requested? e.g. objectname.path -- http://mail.python.org/mailman/listinfo/python-list

BaseHTTPServer module

2005-11-20 Thread amfr
>From the BaseHTTPServer module, how do i gget the POST or GET data sent by the client? Is it stired the the file they requested? e.g. objectname.path -- http://mail.python.org/mailman/listinfo/python-list

Re: Web-based client code execution

2005-11-20 Thread Robert Kern
Paul Watson wrote: > I have read some about AJAX. Is there an APAX coming for Python? Not until browsers have embedded Python interpreters. There's been talk about doing this in Mozilla, but I don't think the talk has turned into usable code, yet. -- Robert Kern [EMAIL PROTECTED] "In the fiel

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Christoph Zwerschke
> What answers have you received that have not been satisfactory? I googled a little bit and haven't found many answers at all. Some were in the posting I mentioned: Stuff should go into the standard lib only when it is mature and "right" enough. However, we are already at Python 2.4 and there

Re: Delays getting data on sys.stdin.readline() ?

2005-11-20 Thread Christian Convey
On 11/19/05, Mike Meyer <[EMAIL PROTECTED]> wrote: > Christian Convey <[EMAIL PROTECTED]> writes: > > I've got a program that (ideally) perpetually monitors sys.stdin for > > lines of text. As soon as a line comes in, my program takes some > > action. > > The problem is, it seems like a very large

Re: Speeding up multiple regex matches

2005-11-20 Thread Fredrik Lundh
"Talin" wrote: > I've run in to this problem a couple of times. Say I have a piece of > text that I want to test against a large number of regular expressions, > where a different action is taken based on which regex successfully > matched. The naive approach is to loop through each regex, and sto

Re: Underscores in Python numbers

2005-11-20 Thread Roy Smith
[EMAIL PROTECTED] (David M. Cooke) wrote: > One example I can think of is a large number of float constants used > for some math routine. In that case they usually be a full 16 or 17 > digits. It'd be handy in that case to split into smaller groups to > make it easier to match with tables where th

Re: Command line

2005-11-20 Thread Diez B. Roggisch
amfr wrote: > Hoe would I call something on the command line from python, e.g. "ls > -la"? Use the module subprocess - otherwise maybe popen2 or os. Regards, Diez -- http://mail.python.org/mailman/listinfo/python-list

need a tutorial in tokens ,different types

2005-11-20 Thread enas khalil
hello all could any one suggest me tutorials in different tokenizations and clear describtion of how can i use token type and assign diff attributes to tokens  ,also good tutorials in diff data types in python thanks every body enas Yahoo! FareChase - Search multiple travel sites in one clic

Re: Command line

2005-11-20 Thread avnit
What OS are you using. I'm not sure about anything else but on a mac it's: >>import os >>os.system("ls -la") -- http://mail.python.org/mailman/listinfo/python-list

Command line

2005-11-20 Thread amfr
Hoe would I call something on the command line from python, e.g. "ls -la"? -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >