Problem printing in Win98

2005-11-20 Thread Maravilloso
Hi 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: error: (31, 'ShellExecute', 'A device attach

Re: Where can I find string.translate source?

2005-11-20 Thread Mike Meyer
[EMAIL PROTECTED] writes: > Inside the file string.py I couldn't find the source code for > translate. Where could it be? Object/stringmodule.c in the python source distribution. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for m

Re: Where can I find string.translate source?

2005-11-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The module string has a function called translate. I tried to find the > source code for that function. In: > > C:\Python24\Lib > > there is one file called > > string.py > > I open it and it says > > """A collection of string operations (most are no longer used

Re: PATH environment variable

2005-11-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Based on a search of other posts in this group, it appears as though > os.environ['PATH'] is one way to obtain the PATH environment variable. > > My questions: > 1) is it correct that os.environ['PATH'] contains the PATH environment > variable? yes. > 2) are there othe

Re: Underscores in Python numbers

2005-11-20 Thread Dan Bishop
Roy Smith wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > That's a tad unfair. Dealing with numeric literals with lots of digits is > > a real (if not earth-shattering) human interface problem: it is hard for > > people to parse long numeric strings. > > There are plenty of ways to make num

Re: Can a function access its own name?

2005-11-20 Thread Fredrik Lundh
"B Mahoney" wrote: > Decorate any function with @aboutme(), which > will print the function name each time the function is called. > > All the 'hello' stuff is in the aboutme() decorator code. > There is no code in the decorated functions themselves > doing anything to telling us the function name

Re: Can a function access its own name?

2005-11-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Look at the code below: > > # mystringfunctions.py > > def cap(s): > print s > print "the name of this function is " + "???" > > cap ("hello") > > > Running the code above gives the following output > > >>> > hello > the name of th

Re: Where can I find string.translate source?

2005-11-20 Thread bobueland
Thanks Mike and Fredrik. In my Python installation there is no directory called Objects. I use Windows and I downloaded Python from http://www.python.org/download/ As I looked closer I saw that the link # Python 2.4.2 Windows installer (Windows binary -- does not include source) which cl

Re: Problem printing in Win98

2005-11-20 Thread Roger Upole
According to MSDN, err code 31 from ShellExecute is SE_ERR_NOASSOC, meaning there's not an application registered for printing that file type. Roger "Maravilloso" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > > I'm trying to automatically send a postscript file to be

enum 0.2: Enumerations in Python

2005-11-20 Thread Ben Finney
Howdy all, I've uploaded enum 0.2 to the Cheeseshop. The main change is that enumeration values now export their enumtype, index, and key (the things that define each value) as attributes. Thanks to Bengt for making a convincing case in favour of this. So now it's easier to ask an enumeration va

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

2005-11-20 Thread Xiao Jianfeng
Steve Holden wrote: >Xiao Jianfeng wrote: > > >>Steven D'Aprano wrote: >> >> >> >> >>>On Sun, 20 Nov 2005 11:05:53 +0800, Xiao Jianfeng wrote: >>> >>> >>> >>> >>> >>> I have some other questions: when "fh" will be closed? >>>When all reference

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

2005-11-20 Thread [EMAIL PROTECTED]
Xiao Jianfeng wrote: > First, I must say thanks to all of you. And I'm really sorry that I > didn't > describe my problem clearly. > > There are many tokens in the file, every time I find a token, I have > to get > the data on the next line and do some operation with it. It should be easy

wxListBox and others after upgrade to MacOS X 10.4

2005-11-20 Thread ishtar
Hi I have strange problem... Background: I created some application using Linux which was intended to run on Mac OS X. There were few differences between Linux and Mac behavior of wxWidgets but finally after exchange of several screenshots i was able to finish it without even touching mac. BTW It

Re: How to convert a "long in a string" to a "long"?

2005-11-20 Thread ondekoza
Thank you, for all the good answers. Somehow I overlooked the 'radix' option in the docs. S -- http://mail.python.org/mailman/listinfo/python-list

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

2005-11-20 Thread Xiao Jianfeng
[EMAIL PROTECTED] wrote: >Xiao Jianfeng wrote: > > >> First, I must say thanks to all of you. And I'm really sorry that I >>didn't >> describe my problem clearly. >> >> There are many tokens in the file, every time I find a token, I have >>to get >> the data on the next line and do some oper

about dictionary

2005-11-20 Thread Shi Mu
I have have the following code: >>> a=[3,5,8,0] >>> b={} >>> How I can i assign each item in a as the key in the dictionary b simultaneously? that is, b={3:[],5:[],8:[],0:[]} Thanks! -- http://mail.python.org/mailman/listinfo/python-list

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

2005-11-20 Thread [EMAIL PROTECTED]
Xiao Jianfeng wrote: > I have compared the two methods, > (1). "for x in fh:" > (2). read all the file into memory firstly. > > I have tested the two methods on two files, one is 80M and the second > one is 815M. > The first method gained a speedup of about 40% for the first file, and >

Re: about dictionary

2005-11-20 Thread [EMAIL PROTECTED]
b = dict([(x,dict()) for x in a]) Shi Mu wrote: > I have have the following code: > >>> a=[3,5,8,0] > >>> b={} > >>> > How I can i assign each item in a as the key in the dictionary b > simultaneously? > that is, > b={3:[],5:[],8:[],0:[]} > Thanks! -- http://mail.python.org/mailman/listinfo/pytho

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

2005-11-20 Thread Xiao Jianfeng
[EMAIL PROTECTED] wrote: >Xiao Jianfeng wrote: > > >> I have compared the two methods, >> (1). "for x in fh:" >> (2). read all the file into memory firstly. >> >> I have tested the two methods on two files, one is 80M and the second >>one is 815M. >> The first method gained a speedup of abo

Re: about dictionary

2005-11-20 Thread Shi Mu
On 20 Nov 2005 02:59:30 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > b = dict([(x,dict()) for x in a]) > Shi Mu wrote: > > I have have the following code: > > >>> a=[3,5,8,0] > > >>> b={} > > >>> > > How I can i assign each item in a as the key in the dictionary b > > simultaneously? > > t

Re: combine doxygen and doc-strings?

2005-11-20 Thread Henk van Asselt
Gabriel Zachmann wrote: > Is there a way to combine doxygen comments, like this one > > > ## Documentation for a function. > # @var a - variable > # More details. > > def func( a ): > pass > > > with the doc strings, like this one > > > def func( a ): > """ Documentation for a func

Re: about dictionary

2005-11-20 Thread Ben Finney
Shi Mu <[EMAIL PROTECTED]> wrote: > I have have the following code: > >>> a=[3,5,8,0] > >>> b={} > >>> > How I can i assign each item in a as the key in the dictionary b > simultaneously? > that is, > b={3:[],5:[],8:[],0:[]} Explicit: a = [3, 5, 8, 0] b = {} for key in a: b[ke

Re: about dictionary

2005-11-20 Thread przemek drochomirecki
Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] I have have the following code: >>> a=[3,5,8,0] >>> b={} >>> How I can i assign each item in a as the key in the dictionary b simultaneously? that is, b={3:[],5:[],8:[],0:[]} Thanks! Other solution: b.fromkeys(a,

custom xml pretty print

2005-11-20 Thread akbar
Hi, I have Document. If I print it like this: print doc.toprettyxml(" ") I will get this: blablablabla What do I have to do if I want to print it like this: blablablabla Thank you. -- http://mail.python.org/mailman/listinfo/python-list

about polygon

2005-11-20 Thread Shi Mu
Why I got a black polygon in the following code? How can I make it no-color filled? Thanks! import Tkinter c = Tkinter.Canvas(width=220, height=220) c.pack() c.create_polygon(60,60,100,60,100,100,60,120) c.mainloop() -- http://mail.python.org/mailman/listinfo/python-list

Re: custom xml pretty print

2005-11-20 Thread Diez B. Roggisch
akbar wrote: > Hi, > > I have Document. If I print it like this: > > print doc.toprettyxml(" ") > > I will get this: > > > > blablablabla > > > > > What do I have to do if I want to print it like this: > > > blablablabla > > Use a SAX-Handler, parse it your

Re: about dictionary

2005-11-20 Thread Peter Otten
przemek drochomirecki wrote: > Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci > news:[EMAIL PROTECTED] > I have have the following code: a=[3,5,8,0] b={} > How I can i assign each item in a as the key in the dictionary b > simultaneously? > that is, > b={3:[],5:[],8:[]

Re: about dictionary

2005-11-20 Thread Shi Mu
On 11/20/05, Peter Otten <[EMAIL PROTECTED]> wrote: > przemek drochomirecki wrote: > > > Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci > > news:[EMAIL PROTECTED] > > I have have the following code: > a=[3,5,8,0] > b={} > > > How I can i assign each item in a as the key

Re: Web-based client code execution

2005-11-20 Thread Kent Johnson
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 everything else really isn't cross p

Re: about dictionary

2005-11-20 Thread Peter Otten
Shi Mu wrote: > how to do with it? Use Ben Finney's, not Przemek's approach if the values are mutables that you plan to modify. If that's what you are asking. Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: about polygon

2005-11-20 Thread Jan Voges
Hi! Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu: > Why I got a black polygon in the following code? > How can I make it no-color filled? Use create_line instead: c.create_line(60,60,100,60,100,100,60,120,60,60) Jan -- http://mail.python.org/mailman/listinfo/python-list

Re: about polygon

2005-11-20 Thread Peter Otten
Shi Mu wrote: > Why I got a black polygon in the following code? > How can I make it no-color filled? > Thanks! > > import Tkinter > > c = Tkinter.Canvas(width=220, height=220) > c.pack() > c.create_polygon(60,60,100,60,100,100,60,120) > c.mainloop() You can set the color explicitly (use "" to

Re: about polygon

2005-11-20 Thread Shi Mu
On 11/20/05, Jan Voges <[EMAIL PROTECTED]> wrote: > Hi! > > Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu: > > > Why I got a black polygon in the following code? > > How can I make it no-color filled? > > Use create_line instead: > c.create_line(60,60,100,60,100,100,60,120,60,60) > > Jan If so,

Why are there no ordered dictionaries?

2005-11-20 Thread Christoph Zwerschke
This is probably a FAQ, but I dare to ask it nevertheless since I haven't found a satisfying answer yet: Why isn't there an "ordered dictionary" class at least in the standard list? Time and again I am missing that feature. Maybe there is something wrong with my programming style, but I rather

Re: about polygon

2005-11-20 Thread Diez B. Roggisch
Shi Mu wrote: > On 11/20/05, Jan Voges <[EMAIL PROTECTED]> wrote: > >>Hi! >> >>Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu: >> >> >>>Why I got a black polygon in the following code? >>>How can I make it no-color filled? >> >>Use create_line instead: >>c.create_line(60,60,100,60,100,100,60,12

Re: Is there a way to create a button in either pygame or livewires?

2005-11-20 Thread Kent Johnson
Nathan Pinno wrote: > Hey all, > > Is there a way to create a button in either pygame or livewires, that is > able to be clicked and when clicked sends a command to restart the program? Maybe something here: http://www.pygame.org/wiki/gui Kent -- http://mail.python.org/mailman/listinfo/python-

Re: about polygon

2005-11-20 Thread Jan Voges
Hi Am Sun, 20 Nov 2005 04:45:52 -0800 schrieb Shi Mu: > If so, what is the difference between create_line and create_polygon? create_polygon only creates closed polygons. Jan -- http://mail.python.org/mailman/listinfo/python-list

Re: about dictionary

2005-11-20 Thread przemek drochomirecki
Uzytkownik "Peter Otten" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] > Shi Mu wrote: > > > how to do with it? > > Use Ben Finney's, not Przemek's approach if the values are mutables that you > plan to modify. If that's what you are asking. > > Peter Maybe he just want to use d

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

2005-11-20 Thread Ross Reyes
Yes, I have read this part readlines( [sizehint]) Read until EOF using readline() and return a list containing the lines thus read. If the optional sizehint argument is present, instead of reading up to EOF, whole lines totalling approximately sizehint bytes (possibly after rounding

Re: about dictionary

2005-11-20 Thread Shi Mu
On 11/20/05, przemek drochomirecki <[EMAIL PROTECTED]> wrote: > > Uzytkownik "Peter Otten" <[EMAIL PROTECTED]> napisal w wiadomosci > news:[EMAIL PROTECTED] > > Shi Mu wrote: > > > > > how to do with it? > > > > Use Ben Finney's, not Przemek's approach if the values are mutables that > you > > plan

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Ben Finney
Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > This is probably a FAQ, but I dare to ask it nevertheless since I > haven't found a satisfying answer yet: Why isn't there an "ordered > dictionary" class at least in the standard list? What answers have you received that have not been satisfactor

Re: Why are there no ordered dictionaries?

2005-11-20 Thread przemek drochomirecki
Uzytkownik "Christoph Zwerschke" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] > This is probably a FAQ, but I dare to ask it nevertheless since I > haven't found a satisfying answer yet: Why isn't there an "ordered > dictionary" class at least in the standard list? Time and agai

Re: about dictionary

2005-11-20 Thread przemek drochomirecki
Uzytkownik "Shi Mu" <[EMAIL PROTECTED]> napisal w wiadomosci news:[EMAIL PROTECTED] On 11/20/05, przemek drochomirecki <[EMAIL PROTECTED]> wrote: > > Uzytkownik "Peter Otten" <[EMAIL PROTECTED]> napisal w wiadomosci > news:[EMAIL PROTECTED] > > Shi Mu wrote: > > > > > how to do with it? > > > > Us

about sort and dictionary

2005-11-20 Thread Shi Mu
Got confused by the following code: >>> a [6, 3, 1] >>> b [4, 3, 1] >>> c {1: [[6, 3, 1], [4, 3, 1]], 2: [[6, 3, 1]]} >>> c[2].append(b.sort()) >>> c {1: [[6, 3, 1], [1, 3, 4]], 2: [[6, 3, 1], None]} #why c can not append the sorted b?? >>> b.sort() >>> b [1, 3, 4] -- http://mail.python.org/mailma

Re: Why are there no ordered dictionaries?

2005-11-20 Thread [EMAIL PROTECTED]
przemek drochomirecki wrote: > i am not sure what is the purpose of having ordered dictionaries built in > python, could u provide any examples? > > i use a contruction: > for x in sorted(d.keys()) > By ordered dict, one usually wants order that is arbitary which cannot be derived from the con

need help in how to make my script read arabic lang

2005-11-20 Thread enas khalil
hello , i want to know if yu please how can i use python code in tagging arabic text file my code is as follow : # -*- coding: cp1256 -*-import codecsfrom nltk.tagger import *from nltk.corpus import brownfrom nltk.tokenizer import WhitespaceTokenizerfrom nltk import *from nltk.tokenreader.tagge

about lambda

2005-11-20 Thread Shi Mu
what does the following code mean? It is said to be used in the calculation of the overlaid area size between two polygons. map(lambda x:b.setdefault(x,[]),a) Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: about sort and dictionary

2005-11-20 Thread [EMAIL PROTECTED]
Shi Mu wrote: > Got confused by the following code: > >>> a > [6, 3, 1] > >>> b > [4, 3, 1] > >>> c > {1: [[6, 3, 1], [4, 3, 1]], 2: [[6, 3, 1]]} > >>> c[2].append(b.sort()) > >>> c > {1: [[6, 3, 1], [1, 3, 4]], 2: [[6, 3, 1], None]} > #why c can not append the sorted b?? > >>> b.sort() > >>> b >

Re: about sort and dictionary

2005-11-20 Thread Eric Jacoboni
Shi Mu <[EMAIL PROTECTED]> writes: > #why c can not append the sorted b?? Because sort() doesn't return anything? According to the library reference: 7) The sort() and reverse() methods modify the list in place for economy of space when sorting or reversing a large list. To remind you that the

Re: about lambda

2005-11-20 Thread [EMAIL PROTECTED]
Shi Mu wrote: > what does the following code mean? It is said to be used in the > calculation of the overlaid area size between two polygons. > map(lambda x:b.setdefault(x,[]),a) The equivalent of : def oh_my_yet_another_function_name_why_not_use_lambda(x): b.setdefault(x,[]) map(oh_my_yet_an

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am writing a web applications(simple forms) which has a number of > fields. Each field naturally has a name and a number of > attributes(formatting etc.), like this : > > d = {'a':{...}, 'b':{}} > > This dict would be passed to the Kid template system which would l

Re: Type-checking unpickled objects

2005-11-20 Thread Fredrik Lundh
Gordon Airporte wrote: >I have this class, and I've been pickling it's objects as a file format > for my program, which works great. The problems are a.) how to handle > things when the user tries to load a non-pickled file, and b.) when they > load a pickled file of the wrong class. > > a. I can

Re: Why are there no ordered dictionaries?

2005-11-20 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I am writing a web applications(simple forms) which has a number of > > fields. Each field naturally has a name and a number of > > attributes(formatting etc.), like this : > > > > d = {'a':{...}, 'b':{}} > > > > This dict would be passed t

Re: Underscores in Python numbers

2005-11-20 Thread Peter Hansen
Dan Bishop wrote: > Roy Smith wrote: >>creditCardNumber = myInt ("1234 5678 9012 3456 789") > > Or alternatively, you could write: > > creditCardNumber = int('1234''5678''9012''3456''789') Or creditCardNumber = int("1234 5678 9012 3456 789".replace(' ','')) Or make a little function that does t

Re: PATH environment variable

2005-11-20 Thread Jeffrey Schwab
[EMAIL PROTECTED] wrote: > O/S: Win2K > Vsn of Python:2.4 > > Based on a search of other posts in this group, it appears as though > os.environ['PATH'] is one way to obtain the PATH environment variable. > > My questions: > 1) is it correct that os.environ['PATH'] contains the PATH environment >

Re: line order

2005-11-20 Thread Fredrik Lundh
Ben Bush wrote: > I run the following code and the red line and black line show at the > same time. is there anyway to show the red line first, then the black > line? for example, after I click the 'enter' key? > > from Tkinter import * > tk = Tk() > canvas = Canvas(tk, bg="white", bd=0, highlight

Re: Underscores in Python numbers

2005-11-20 Thread [EMAIL PROTECTED]
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. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-20 Thread Anton Vredegoor
Alex Martelli wrote: > Anton Vredegoor <[EMAIL PROTECTED]> wrote: >... > > Suppose I grant all your theories about optimal marketing strategies. I wish I hadn't done that :-) But seriously, I'm having trouble answering in detail all of your points (which doesn't mean I don't value them highly

Re: Underscores in Python numbers

2005-11-20 Thread Eric Jacoboni
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. Ada allows underscores in numeric literals since 1983, without enforcing any gro

Re: Why are there no ordered dictionaries?

2005-11-20 Thread Nicola Larosa
> You asked "why not" rather than "has anyone done this anyway"; if > you asked the latter of the Python Cookbook, you might find something > like this: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747> > > A little old, and pre-dates subclassable native types, but quite > s

Re: about lambda

2005-11-20 Thread Duncan Booth
Shi Mu wrote: > what does the following code mean? It is said to be used in the > calculation of the overlaid area size between two polygons. > map(lambda x:b.setdefault(x,[]),a) > > Thanks! Assuming b is a dict, it is roughly equivalent to the following (except that the variables beginning wit

Re: Underscores in Python numbers

2005-11-20 Thread Steve Holden
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: it is hard for >>>people to parse long numeric strings. >> >>I'm totally unconvince

Re: about lambda

2005-11-20 Thread Rick Wotnaz
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Shi Mu wrote: >> what does the following code mean? It is said to be used in the >> calculation of the overlaid area size between two polygons. >> map(lambda x:b.setdefault(x,[]),a) > > The equivalent of : > > def oh_

about dictionary

2005-11-20 Thread Shi Mu
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, under key 0. 1 and 2 were found to have a pair in some other places so get [0,1,

Re: Underscores in Python numbers

2005-11-20 Thread Roy Smith
"Dan Bishop" <[EMAIL PROTECTED]> wrote: > creditCardNumber = int('1234''5678''9012''3456''789') Wow, I didn't know you could do that. That's better than my idea. -- http://mail.python.org/mailman/listinfo/python-list

email separation

2005-11-20 Thread john boy
HeyI have signed up to receive emails from the python forum and the amount of emails I receive on any day is fairly numerous...Does anyone know if I can somehow separate all mails coming from the python forum from all of my other mail, so I can open it from another folder or something like that

Re: Underscores in Python numbers

2005-11-20 Thread D H
Steve Holden wrote: > 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 whe

Re: Underscores in Python numbers

2005-11-20 Thread [EMAIL PROTECTED]
D H wrote: > Steve Holden wrote: > > 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

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

2005-11-20 Thread Fredrik Lundh
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 line lengths; lengths at odd positions are drawn, lengths at even po

Re: email separation

2005-11-20 Thread Fredrik Lundh
"john boy" wrote: > Does anyone know if I can somehow separate all mails coming > from the python forum from all of my other mail, so I can open > it from another folder or something like that under the same > address...I have a yahoo account... look under "filters" on this page: http://help

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

2005-11-20 Thread Fredrik Lundh
Ross Reyes wrote: > Maybe I'm missing the obvious, but it does not seem to say what happens when > the input for readlines is too big. Or does it? readlines handles memory overflow in exactly the same way as any other operation: by raising a MemoryError exception: http://www.python.org/doc/cur

Re: PATH environment variable

2005-11-20 Thread mirandacascade
I observed something tangential to this topic, and that is the reason for this reply. I don't understand when os.environ gets updated. The '...captured the first time the os mdule is imported...' verbiage from the following link: http://www.python.org/dev/doc/newstyle/lib/os-procinfo.html provi

Re: PATH environment variable

2005-11-20 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Do these observations fit with what is stated in section 6.1.1 of the > Python Library Reference? yes. what part of your observations makes you think that the environment isn't "captured" (i.e. copied from the process environ- ment) when the os module is imported ? (h

Re: PATH environment variable

2005-11-20 Thread mirandacascade
Fredrik Lundh wrote: > what part of your observations makes you think that the environment isn't > "captured" (i.e. > copied from the process environment) when the os module is > imported ? Answer: the part that was informed by a fundamental misunderstanding on my part of how the os module obtai

Re: query domain registry from python?

2005-11-20 Thread Tim Williams (gmail)
On 19 Nov 2005 19:40:58 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:hi, does anyone know of a library that can query domain registry or any site that provide information to such an activity? as i want to build asimple domain name searching program for my own benefit.. thanks alot :D [TW]  

Re: Underscores in Python numbers

2005-11-20 Thread Peter Hansen
[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 saving where? Why would you have any cre

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

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

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

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

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

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

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

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

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

  1   2   >