Re: How to Convert a makefile to Python Script

2005-04-19 Thread rkoida
Thanks For Your Help Regards rkoida -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-19 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: > I would try right-clicking the shortcut icon and selecting > properties, then select the shortcut tab and edit the target string > with s/python/pythonw/ and then click ok. Thanks! I'll try that tomorrow. I never would have figured that out. -- http:/

Re: Why Python does *SLICING* the way it does??

2005-04-19 Thread Raymond Hettinger
<[EMAIL PROTECTED]> > Many people I know ask why Python does slicing the way it does. Half open intervals are just one way of doing things. Each approach has its own merits and issues. Python's way has some useful properties: * s == s[:i] + s[i:] * len(s[i:j]) == j-i # if s is long eno

Re: Refactoring in Python.

2005-04-19 Thread rkoida
Hello -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Tkinter...

2005-04-19 Thread hue
Hello -- http://mail.python.org/mailman/listinfo/python-list

Re: Encoding Questions

2005-04-19 Thread "Martin v. Löwis"
[EMAIL PROTECTED] wrote: > thanks for the replies. As for why I set my default encoding to utf-8 > in python, I did it a while ago and I think I did it because when I was > reading some strings from database in utf-8 it raised errors b/c there > were some chars it could recongnize in standard encod

Re: Why Python does *SLICING* the way it does??

2005-04-19 Thread Ganesan Rajagopal
> "[EMAIL PROTECTED]" == [EMAIL PROTECTED] navy mil <[EMAIL PROTECTED]> > writes: > Many people I know ask why Python does slicing the way it does. > Can anyone /please/ give me a good defense/justification??? Try http://www.everything2.com/index.pl?node_id=1409551 Ganesan -- Gane

Re: Enumerating formatting strings

2005-04-19 Thread Greg Ewing
Steve Holden wrote: I've been wondering whether it's possible to perform a similar analysis on non-mapping-type format strings, so as to know how long a tuple to provide, I just tried an experiment, and it doesn't seem to be possible. The problem seems to be that it expects the arguments to be in

Why Python does *SLICING* the way it does??

2005-04-19 Thread [EMAIL PROTECTED]
Many people I know ask why Python does slicing the way it does. Can anyone /please/ give me a good defense/justification??? I'm referring to why mystring[:4] gives me elements 0, 1, 2 and 3 but *NOT* mystring[4] (5th element). Many people don't like idea that 5th element is not invited. (BT

Re: pre-PEP: Simple Thunks

2005-04-19 Thread Steven Bethard
Greg Ewing wrote: Brian Sabbey wrote: do f in with_file('file.txt'): print f.read() I don't like this syntax. Try to read it as an English sentence: "Do f in with file 'file.txt'". Say what??? To sound right it would have to be something like with_file('file.txt') as f do: print f.read()

Re: def a((b,c,d),e):

2005-04-19 Thread Greg Ewing
AdSR wrote: if you haven't done so yet. It appears that you can specify a function explicitly to take n-tuples as arguments. Has anyone actually used it in real code? Yes. In PyGUI I have some point and rectangle manipulation utilities that do things like def add_pt((x1, y1), (x2, y2)): retur

Re: packages

2005-04-19 Thread Greg Ewing
tiissa wrote: There is: see PEP 8. http://www.python.org/peps/pep-0008.html However, I understood there was no definitive convention hence various common styles. I think this is a relatively recent development. At the time the tutorial was written, and the older parts of the standard library, ther

Re: How to get a Function object from a Frame object

2005-04-19 Thread Greg Ewing
Steven Bethard wrote: Gigi wrote: I need access to a function object that corresponds to a frame object in a certain case from inside the function. Can you look up the code's co_name in the previous frame's locals? You probably also need to check the previous frame's globals... And there are pro

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-19 Thread Steven Bethard
Ron wrote: How about using ***name in the same way as *name, and **name are used? It extends the current argument options in a consistent manner and 'I believe' is easy to explain and visually says something different is happening here. This builds on the already present arg, *arg, **arg, and

Re: Behaviour of str.split

2005-04-19 Thread Greg Ewing
Will McGugan wrote: Hi, I'm curious about the behaviour of the str.split() when applied to empty strings. "".split() returns an empty list, however.. "".split("*") returns a list containing one empty string. Both of these make sense as limiting cases. Consider >>> "a b c".split() ['a', 'b', 'c']

Re: newbie question

2005-04-19 Thread M.E.Farmer
You might want to look at PyGame. http://pygame.org/ Newbies can go far using PyGame but the maths can be a bit complex no matter what language or package you use. For an alternative try Blender 3d. http://blender.org Blender is a 3d suite that can do it all and then some , it's free ,and it uses

Re: ANN: Python 2.3.2 for PalmOS available

2005-04-19 Thread Erik Max Francis
RM wrote: I get odd results when trying to use exponents. For example: 4^2 6 Someone else already pointed out that ** is exponentiation. ^, on the other hand, bitwise exclusive or. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && A

Re: How to Convert a makefile to Python Script

2005-04-19 Thread Bengt Richter
On 19 Apr 2005 20:49:31 -0700, [EMAIL PROTECTED] wrote: >Hello All > I am working on a Problem to convert makefile in to a python script. >Are there any Modules? Please try to comment. > >Thanks >rkoida > IIUC, the scons project came to be to implement make functionality in python, so I'd try to

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-19 Thread Bengt Richter
On 19 Apr 2005 20:49:56 -0700, Paul Rubin wrote: >Dumb question from a Windows ignoramus: > >I find myself needing to write a Python app (call it myapp.py) that >uses tkinter, which as it happens has to be used under (ugh) Windows. >That's Windows XP if it makes any diff

Re: Importing some functions from a py file

2005-04-19 Thread Anthony Liu
O, sorry, I did have main() at the very end of code1.py. Sorry for this confusion. --- John Machin <[EMAIL PROTECTED]> wrote: > On Tue, 19 Apr 2005 20:17:06 -0700 (PDT), Anthony > Liu > <[EMAIL PROTECTED]> wrote: > > >The choice is (b): > > > >(b) you do have "def main()" as per my example, b

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-19 Thread Tim Peters
[Paul Rubin] > Dumb question from a Windows ignoramus: > > I find myself needing to write a Python app (call it myapp.py) that > uses tkinter, which as it happens has to be used under (ugh) Windows. > That's Windows XP if it makes any difference. Nope, the Windows flavor doesn't matter. > I put a

Re: How to run Python in Windows w/o popping a DOS box?

2005-04-19 Thread Leif B. Kristensen
Paul Rubin skrev: > Question: is there any simple way to arrange to launch the app from > the desktop, without also launching a DOS box? Just use the .pyw extension instead of .py, and the DOS box automagically disappears -- or so I have been told ... -- Leif Biberg Kristensen http://solumslekt.

Re: Importing some functions from a py file

2005-04-19 Thread John Machin
On Tue, 19 Apr 2005 20:17:06 -0700 (PDT), Anthony Liu <[EMAIL PROTECTED]> wrote: >The choice is (b): > >(b) you do have "def main()" as per my example, but >you have an unguarded "main()" at the top level > >Below is exactly what I have: > >def func1(): >do_sth_1() > >def func2(): >do_sth_

How to run Python in Windows w/o popping a DOS box?

2005-04-19 Thread Paul Rubin
Dumb question from a Windows ignoramus: I find myself needing to write a Python app (call it myapp.py) that uses tkinter, which as it happens has to be used under (ugh) Windows. That's Windows XP if it makes any difference. I put a shortcut to myapp.py on the desktop and it shows up as a little g

How to Convert a makefile to Python Script

2005-04-19 Thread rkoida
Hello All I am working on a Problem to convert makefile in to a python script. Are there any Modules? Please try to comment. Thanks rkoida -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Simple Thunks

2005-04-19 Thread Greg Ewing
Brian Sabbey wrote: do f in with_file('file.txt'): print f.read() I don't like this syntax. Try to read it as an English sentence: "Do f in with file 'file.txt'". Say what??? To sound right it would have to be something like with_file('file.txt') as f do: print f.read() But, while that wo

Re: Importing some functions from a py file

2005-04-19 Thread Anthony Liu
The choice is (b): (b) you do have "def main()" as per my example, but you have an unguarded "main()" at the top level Below is exactly what I have: def func1(): do_sth_1() def func2(): do_sth_2() def main(): do sth_m() #end of code1.py So, you suggest that if I add to the end of

Re: Importing some functions from a py file

2005-04-19 Thread John Machin
On Tue, 19 Apr 2005 19:13:13 -0700 (PDT), Anthony Liu <[EMAIL PROTECTED]> wrote: >I think I got confused by the python import facility. >Say, in code1.py I have func1, func2, func3 and main. >In code2.py, I *only* want to use func2 from code1.py. >So, I did > >from code1 import func2 > >But every t

Re: Importing some functions from a py file

2005-04-19 Thread Anthony Liu
Hmm,thanks a lot. I still don't quite get it. So, instead of defining a main like def main(): do things here I should do something like below in both modules? if __name__ == "__main__": call the functions you defined here. --- Michael Soulier <[EMAIL PROTECTED]> wrote: > On 4/19/05,

Re: Refactoring in Python.

2005-04-19 Thread Terry Reedy
"Peter Hansen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry Reedy wrote: >> Another specifically helpful reference might be Beck's (author?) book on >> Test-Driven Development. Part 1 uses an example in Java, I believe. >> Part 2, I know, uses an example in Python. Ther

Re: Importing some functions from a py file

2005-04-19 Thread Michael Soulier
On 4/19/05, Anthony Liu <[EMAIL PROTECTED]> wrote: > > You are certainly right, because I don't know how to > protect the main functions. Where do I put > > if __name__ == '__main__': main() I just glanced in the modules section of the python documentation and surprisingly this is not mentioned

Re: Importing some functions from a py file

2005-04-19 Thread Anthony Liu
--- Michael Soulier <[EMAIL PROTECTED]> wrote: > On 4/19/05, Anthony Liu <[EMAIL PROTECTED]> > wrote: > > But every time, I run code2.py, the main() of > code1.py > > is run. > > You probably did not protect your main function in > both modules. > > ie. > > if __name__ == '__main__': main() >

Python Debugger with source code tracking ability

2005-04-19 Thread Tran Tuan Anh
Hi all, I am new to Python and desperated to look for a good Python debugger. I mean a debugger with source coding tracking. For C/C++, emacs and gud offers execellent development env. The source code tracking is extremely useful for recursive functions. I have spent time Googling but not found a

Re: Writing to stdout and a log file

2005-04-19 Thread Jeff Epler
In that case, it looks like you won't be able to get what you want without modifying CPython. PRINT_ITEM calls PyFile_SoftSpace, PyFile_WriteString, and PyFile_WriteObject, which all use PyFile_Check(). It might be as simple as changing these to PyFile_CheckExact() calls in PyFile_WriteString / P

Re: Importing some functions from a py file

2005-04-19 Thread Michael Soulier
On 4/19/05, Anthony Liu <[EMAIL PROTECTED]> wrote: > But every time, I run code2.py, the main() of code1.py > is run. You probably did not protect your main function in both modules. ie. if __name__ == '__main__': main() Mike -- Michael P. Soulier <[EMAIL PROTECTED]> http://www.digitaltorqu

Authentication

2005-04-19 Thread cameron
I am new to Python so please excuse my ignorance. Are there a nice set of libraries/modules that abstract authentication in a platform independent manner? I am working on an application that would like to be able to hook into the native authentication mechanisms on Linux and OpenBSD. I would lik

Re: eval function not working how i want it dag namn

2005-04-19 Thread Greg Ewing
robcarlton wrote: thanks. I'll use the getattr function now, and I think I understand where I went wrong with eval. I was thinking in Lisp where the lexical scope would mean that obj is defined The full story is actually more subtle. The name 'obj' *is* accessible from a nested scope if you do some

Importing some functions from a py file

2005-04-19 Thread Anthony Liu
Hi, I think I got confused by the python import facility. Say, in code1.py I have func1, func2, func3 and main. In code2.py, I *only* want to use func2 from code1.py. So, I did from code1 import func2 But every time, I run code2.py, the main() of code1.py is run. I don't know why. Any hint

Entry Value won't get updated...Help please

2005-04-19 Thread Clara
I tried to print the value of my entry widget by passing the result of controlvariable.get() in Tkinter to a function. However, I kept printing empty string (eventhough I've written something inside the entry widget). But if I first set the value of the entry widget using .set,...I can get the val

Writing to stdout and a log file

2005-04-19 Thread Mike
I would like my 'print' statements to send its output to the user's screen and a log file. This is my initial attempt: class StdoutLog(file): def __init__(self, stdout, name='/tmp/stdout.log', mode='w',bufsize=-1): super(StdoutLog, self).__init__(name,mode,bufsize) self.stdout

Re: Writing to stdout and a log file

2005-04-19 Thread Mike
Thanks. I should've mentioned I want StdoutLog to subclass the 'file' type because I need all the file attributes available. I could add all the standard file methods and attributes to StdoutLog without subclassing 'file' but I'd rather avoid this if I can. -- http://mail.python.org/mailman/li

Re: poll: does name conventions in python matters?

2005-04-19 Thread Michael Hoffman
Peter Hansen wrote: If all the above fail, use "names_like_this" or "namesLikeThis". If you really need somebody else to tell you what to use: use the latter, because I told you to. ;-) No, no. Use the former, because *I* told you to. ;-) -- Michael Hoffman -- http://mail.python.org/mailman/listin

Re: The value of the entry widget doesn't get updated

2005-04-19 Thread Clara
Yes that solves my problem all right...THanks a bunch to both of you -- http://mail.python.org/mailman/listinfo/python-list

Re: Array of Chars to String

2005-04-19 Thread Bengt Richter
On Tue, 19 Apr 2005 17:00:02 -0700, Michael Spencer <[EMAIL PROTECTED]> wrote: >Michael Spencer wrote: >> Bengt Richter wrote: >> > I think this will be worth it if your string to modify is _very_ long: >> >>> >>> >>> def some_func(s, letters, table=''.join([chr(i) for i in >>> xrange(256)])):

Re: Writing to stdout and a log file

2005-04-19 Thread Jeff Epler
This variation works: # class Tee: def __init__(self, *args): self.files = args def write(self, data): for f in self.files: result = f.write(data) return result def writelines(s

Thanks

2005-04-19 Thread Clara
Yes that solves my problem all right...THanks a bunch to both of you -- http://mail.python.org/mailman/listinfo/python-list

Re: The value of the entry widget doesn't get updated

2005-04-19 Thread [EMAIL PROTECTED]
Yes that solves my problem all right...THanks a bunch to both of you -- http://mail.python.org/mailman/listinfo/python-list

Re: poll: does name conventions in python matters?

2005-04-19 Thread vegetax
Peter Hansen wrote: > vegetax wrote: >> in python it is common to see naming >> inconsistencies ,methods,modules,packages,classes with names in every >> posible style: >> thisisalongmethod >> ThisIsALongMethod >> thisIsALongMethod >> this_is_a_long_method >> and even This_Is_A_Long_Method >> All o

Python SSL Socket issue

2005-04-19 Thread lauras
Hello, We are having an issue with Python SSL sockets using Apache and mod_python. When we try to get an SSL connection using the following code: con = httplib.HTTPSConnection( self.HOST, self.PORT ) #con.set_debuglevel(10) con.putrequest( "POST", "" )

Re: Array of Chars to String

2005-04-19 Thread Michael Spencer
Michael Spencer wrote: Bengt Richter wrote: > I think this will be worth it if your string to modify is _very_ long: >>> def some_func(s, letters, table=''.join([chr(i) for i in xrange(256)])): ... return s.translate(table, ...''.join([chr(i) for i in xrange(256) if chr(i) not

Re: Array of Chars to String

2005-04-19 Thread Michael Spencer
Bengt Richter wrote: > I think this will be worth it if your string to modify is _very_ long: >>> def some_func(s, letters, table=''.join([chr(i) for i in xrange(256)])): ... return s.translate(table, ...''.join([chr(i) for i in xrange(256) if chr(i) not in letters])) ... >>>

Re: Variables variable

2005-04-19 Thread Ivan Van Laningham
Hi All-- Cameron Laird wrote: > . > I have a few comments on this: Python can do essentially what > PHP does. One means is the getattr() Reinhold cites. > > HOWEVER, it's generally always a mistake to do so. Dictionaries > are simply better. AND THAT'S TRUE IN PHP, too. I

Re: Array of Chars to String

2005-04-19 Thread Bengt Richter
On Tue, 19 Apr 2005 13:33:17 -0700, James Stroud <[EMAIL PROTECTED]> wrote: >Hello, > >I am looking for a nice way to take only those charachters from a string that >are in another string and make a new string: > astr = "Bob Carol Ted Alice" letters = "adB" some_func(astr,letters)

Re: build flow? SCons? AAP? process creation?

2005-04-19 Thread Steve Christensen
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > Hey guys, here's a little question. I'm looking for something like a > build system, where I can set up a bunch of jobs with dependencies, and > have them run in parallel. Ideally, I'd like a system where jobs can > be run in parallel, al

Re: Utah Python Users Group

2005-04-19 Thread Steve Christensen
In article <[EMAIL PROTECTED]>, Ivan Van Laningham wrote: > Hi All-- > > Matthew Thorley wrote: >> >> lugal wrote: >> > Is anyone aware if there's a Utah-based Python User Group? If not, does >> > any else from Utah have any interest in forming a Utah-based Python >> > User Group? >> > >> I'm in

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-19 Thread Ron
Kay Schluehr wrote: Steven Bethard wrote: So the object of a "where" is then always an ordered dict? Yes. If so, then I guess I like this proposal best so far. However, it does seem to have the problem that you can't have any additional local variables so, for example, list comprehensions are pr

Re: def a((b,c,d),e):

2005-04-19 Thread Bengt Richter
On 19 Apr 2005 01:10:11 -0700, "George Sakkis" <[EMAIL PROTECTED]> wrote: >Fran=E7ois Pinard wrote: > >> The most useful place for implicit tuple unpacking, in my experience, >> is likely at the left of the `in' keyword in `for' statements (and >> it is even nicer when one avoids extraneous paren

1993 Van Rossum Python Web Robot

2005-04-19 Thread Jonathan Vance
I am looking for a python robot that Van Rossum released with python 0.9.8. It may have been the first web robot (see http://www.webhistory.org/www.lists/www-talk.1993q1/0060.html). I've had no luck finding the code for the robot or the 0.9.8 tarball. Can anyone help me out? Thanks. -- http://

Re: email: Content-Disposition and linebreaks with long filenames

2005-04-19 Thread David Bolen
Martin Körner <[EMAIL PROTECTED]> writes: > I am using email module for creating mails with attachment (and then > sending via smtplib). > > If the name of the attachment file is longer than about 60 characters > the filename is wrapped in the Content-Disposition header: > > Content-Disposition:

Re: newbie question

2005-04-19 Thread Tiziano Bettio
Just a few days earlier someone posted me the link to panda3d (www.panda3d.org) This is actually a gamengine/renderingengine on which u can develop games in python. If u want to achieve high performance you'd rather use c++ and directly access libs like nvidias cg, ms directx or opengl... for

Re: Variables variable

2005-04-19 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: >Adriano Monteiro wrote: >> Hi folks, >> >> Someone know how to make variables variable like in PHP? >> It's something like this: >> >> $a = 'hi' >> $$a = 'testing' >> echo $hi >> 'testing' > >You are most certainly w

Re: newbie question

2005-04-19 Thread Lonnie Princehouse
What is usually meant when Python is mentioned in the context of game scripting is that it's relatively easy for a game's developers to embed a Python interpreter into the game. Python would then be used to control higher-level gameplay elements like artificial intelligence while the game's native

Re: Refactoring in Python.

2005-04-19 Thread QuotesViewer
Investigate the CVS histories of the few 1000s python projects available at www.sourceforge.net enjoy -- http://mail.python.org/mailman/listinfo/python-list

newbie question

2005-04-19 Thread bektek
I heard that python or other script languages can be used as game scripting.. Actually It's so hard to understand what that means for newbies like me? What's mean being used as game script? Could show me simple example like 'hello world'? I'll be appreciated.. -- http://mail.python.org/mailman/l

Re: poll: does name conventions in python matters?

2005-04-19 Thread Peter Hansen
vegetax wrote: in python it is common to see naming inconsistencies ,methods,modules,packages,classes with names in every posible style: thisisalongmethod ThisIsALongMethod thisIsALongMethod this_is_a_long_method and even This_Is_A_Long_Method All over the place,even within one module! You certainl

Re: python

2005-04-19 Thread Peter Hansen
James Stroud wrote: python.org Combined with a bit of Google and just the slightest touch of whatever the opposite of laziness is, for a start... On Tuesday 19 April 2005 12:09 pm, waqar wrote: I am new to python. I need some information on following specifically: - Background & Evolution of python

Re: Refactoring in Python.

2005-04-19 Thread Peter Hansen
Terry Reedy wrote: Another specifically helpful reference might be Beck's (author?) book on Test-Driven Development. Part 1 uses an example in Java, I believe. Part 2, I know, uses an example in Python. There at least used to be a copy online. The online copy was merely a draft, never brought

Re: How to compile ScientificPython-2.4.9 under XP cygwin environment?

2005-04-19 Thread Jason Tishler
Zhuanshi, On Sun, Apr 17, 2005 at 08:48:31AM -0700, Zhuanshi He wrote: > I try to compile ScientificPython-2.4.9 > (http://starship.python.net/~hinsen/ScientificPython/) under Windows > XP cygwin environment using python 2.3.3 ,and gcc (GCC) 3.3.3 (cygwin > special). > > The information shows as

Re: Array of Chars to String

2005-04-19 Thread rbt
James Stroud wrote: Hello, I am looking for a nice way to take only those charachters from a string that are in another string and make a new string: astr = "Bob Carol Ted Alice" letters = "adB" some_func(astr,letters) "Bad" astr = "Bob Carol Ted Alice" letters = "adB" both = [x for x in astr if

Re: Array of Chars to String

2005-04-19 Thread Facundo Batista
On 4/19/05, James Stroud <[EMAIL PROTECTED]> wrote: > astr = "Bob Carol Ted Alice" > letters = "adB" > > import sets > alist = [lttr for lttr in astr if lttr in Set(letters)] > newstr = "" > for lttr in alist: > newstr += lttr >>> astr = "Bob Carol Ted Alice" >>> letters = "adB" >>> s1 = set(a

Re: Array of Chars to String

2005-04-19 Thread Alexander Schmolck
James Stroud <[EMAIL PROTECTED]> writes: > But this seems ugly. I especially don't like "newstr += lttr" because it > makes > a new string every time. I am thinking that something like this has to be a > function somewhere already or that I can make it more efficient using a > built-in tool.

Re: Extending base class methods

2005-04-19 Thread Sizer
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: > Any ideas why this does not work? I get the error "TypeError: unbound > method printer() must be called with Field_Collection instance as > first argument (got MSD instance instead)"): > > > #===

Re: Array of Chars to String

2005-04-19 Thread Michael Spencer
James Stroud wrote: Hello, I am looking for a nice way to take only those charachters from a string that are in another string and make a new string: astr = "Bob Carol Ted Alice" letters = "adB" some_func(astr,letters) "Bad" I can write this like this: astr = "Bob Carol Ted Alice" letters = "adB

Re: poll: does name conventions in python matters?

2005-04-19 Thread David Fraser
vegetax wrote: in python it is common to see naming inconsistencies ,methods,modules,packages,classes with names in every posible style: thisisalongmethod ThisIsALongMethod thisIsALongMethod this_is_a_long_method and even This_Is_A_Long_Method All over the place,even within one module! classic stat

Array of Chars to String

2005-04-19 Thread James Stroud
Hello, I am looking for a nice way to take only those charachters from a string that are in another string and make a new string: >>> astr = "Bob Carol Ted Alice" >>> letters = "adB" >>> some_func(astr,letters) "Bad" I can write this like this: astr = "Bob Carol Ted Alice" letters = "adB" imp

Re: def a((b,c,d),e):

2005-04-19 Thread George Sakkis
"François Pinard" wrote: > > > keywords may be abbreviated, and much more hairy, > > > Hmm.. -1 on this. It may save a few keystrokes, but it's not good for > > readability and maintenability. > > That was my first impression too. Yet, interactively, I found that > feature very convenient. Alread

poll: does name conventions in python matters?

2005-04-19 Thread vegetax
in python it is common to see naming inconsistencies ,methods,modules,packages,classes with names in every posible style: thisisalongmethod ThisIsALongMethod thisIsALongMethod this_is_a_long_method and even This_Is_A_Long_Method All over the place,even within one module! classic static languages d

Re: The value of the entry widget doesn't get updated

2005-04-19 Thread tiissa
Clara wrote: self.loginButton = Button(self, text='Login', command = VerifyProcessor(self.x.get(), self.y.get()) ) class VerifyProcessor: def __init__(self, thename, thepass): self.username = thename self.password = thepass def __cal

Re: Twisted for online games

2005-04-19 Thread Terry Reedy
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > There is also an active, focused pygame mailing list (also accessible via > gmane). I believe some posters there have mentioned using twisted. In fact there is a current thread 'Threads' on pygame, twisted, and thread

Re: Encoding Questions

2005-04-19 Thread jalil
thanks for the replies. As for why I set my default encoding to utf-8 in python, I did it a while ago and I think I did it because when I was reading some strings from database in utf-8 it raised errors b/c there were some chars it could recongnize in standard encoding. When I made the change, the

Re: fpectl

2005-04-19 Thread Sébastien Boisgérault
Good ! And thanks for the link. I had not noticed the warning "fpectl module is dangerous" before. I am a bit sad that the floating-point issue is disappearing from the *active topics* list ... Cheers, SB -- http://mail.python.org/mailman/listinfo/python-list

Re: The value of the entry widget doesn't get updated

2005-04-19 Thread Martin Franklin
Clara wrote: Hi, can somebody help me,..I have an assignment due next week but now I'm stuck with this problem I tried to get values from entry widget using the widgetcontrolvariable.get(),..but it seems that it won't work I can't print the value I input in the entry widget...However when I

Python dtrace

2005-04-19 Thread Grzegorz Dostatni
I am wondering if there is anyone else as excited about Sun's dtrace as I am. Having seen it in action, and actually used it a couple of times I am really impressed. Still, this is not meant as an advert for Sun. I am considering doing some work at adding Dtrace probes into python. That would onl

Re: Twisted for online games

2005-04-19 Thread Terry Reedy
"Petri Lankoski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "sir.shz" <[EMAIL PROTECTED]> writes: >> Hi, I'm just starting to play with Twisted, and planning to use it for >> sone online games (e.g., casino games, etc.), have people done that >> before, are there any pointers?

Re: Refactoring in Python.

2005-04-19 Thread Terry Reedy
"Peter Dembinski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Peter> I am trying to write Master Thesis on refactoring Python > Peter> code. Where should I look for information? As best I remember, there has been little posted here over several years other than genera

RE: MessageBox ONOK?

2005-04-19 Thread Jimmy Retzlaff
Ali wrote: > How do i connect the onOK of a win32ui MessageBox with the Ok button so > that I get to know when the user clicks the Ok button? win32ui.MessageBox returns the ID of the button that was clicked to dismiss the message box. There are constants in win32con you can use to compare to that

Re: Name/ID of removable Media: how?

2005-04-19 Thread Claudio Grondi
Maybe the function below can help? I suppose WMI returns same values as FSO (File System Object): def strDriveHexSerialNumberFromFSOintRetVal(intDriveSerialNumberByFSO): """Supplied with an integer representing a drive serial number returns the number in same format as \>dir command does (i.e

Re: python

2005-04-19 Thread James Stroud
python.org On Tuesday 19 April 2005 12:09 pm, waqar wrote: > I am new to python. I need some information on following specifically: > > - Background & Evolution of python > - current application areas > - future trend. > > Kindly any one provide me such information or tell websites for that > purp

python

2005-04-19 Thread waqar
I am new to python. I need some information on following specifically: - Background & Evolution of python - current application areas - future trend. Kindly any one provide me such information or tell websites for that purpose. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Adriano Ferreira
>but why does it hava not private methods? Because it does not need them, ain't it? >Private stuff always makes programming much easier. Does it? Sometimes contortion is needed to get rid of declarations that restrain access, for example, when writing tests. I think the point-of-view of Python is

Re: XML-RPC -- send file

2005-04-19 Thread codecraig
stefan: i added, "return 1" to my sendFile method on the server...took care of the error, thanks. f. petitjean: i cleaned up my code by closing the file, however, when i tried your exact code above...i got stuck an infinite loop and my PC speaker beeped over and over :) thanks. -- http://mail.

Re: whitespace , comment stripper, and EOL converter

2005-04-19 Thread MrJean1
Attached is another version of the stripper.py file. It contains my change which seem to handle docstring correctly (at least on itself). /Jean Brouwers ## # Python source stripper / cleaner ;) ###

Re: Encoding Questions

2005-04-19 Thread "Martin v. Löwis"
Kent Johnson wrote: > Something like > data = urllib.url_open(...).read() > unicodeData = data.decode('gb2312') > utf8Data = unicodeData.encode('utf-8') > > You may want to supply the errors parameter to decode() or encode(); see > the docs for details. > http://docs.python.org/lib/string-methods.

Re: gc.DEBUG_LEAK and gc.garbage

2005-04-19 Thread "Martin v. Löwis"
Cesar wrote: > I have set the DEBUG_LEAK flag with the GC and in the program cycle > printed the length of the garbage list. Is this enough to determine if > there is a leak in the python code? (the value rises). Well, define "a leak". It could mean a number of things: - an object that is not us

Re: Encoding Questions

2005-04-19 Thread vincent wehren
<[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] | 1. I download a page in python using urllib and now want to convert and | keep it as utf-8? I already know the original encoding of the page. | What calls should I make to convert the encoding of the page to utf8? | For example,

Re: def a((b,c,d),e):

2005-04-19 Thread François Pinard
[George Sakkis] > Allowing non-default arguments after *varargs doesn't make sense, In R, one may use the ... format argument anywhere in the argument list, but may later test if a non-default argument was provided or not. I tend to write R a bit like I would write Python, but hopefully, I'll ev

Re: Encoding Questions

2005-04-19 Thread Kent Johnson
[EMAIL PROTECTED] wrote: 1. I download a page in python using urllib and now want to convert and keep it as utf-8? I already know the original encoding of the page. What calls should I make to convert the encoding of the page to utf8? For example, let's say the page is encoded in gb2312 (simple chi

Re: XML-RPC -- send file

2005-04-19 Thread F. Petitjean
Le 19 Apr 2005 11:02:47 -0700, codecraig a écrit : > Experient I have been :) > > Here is what I am getting now > > CLIENT > --- > d = xmlrpclib.Binary(open("C:\\somefile.exe").read()) open the file with mode "rb" fin = open(r'C:\somefile.exe', 'rb') contents = fin.read() fin.close()

Re: XML-RPC -- send file

2005-04-19 Thread Stefan Behnel
codecraig schrieb: CLIENT --- d = xmlrpclib.Binary(open("C:\\somefile.exe").read()) server.sendFile(d) SERVER -- def sendFile(tmp): print "FILE:", tmp This returns None. Don't know what XML-RPC expects, but you may either try to return something else from the function or ma

Re: Refactoring in Python.

2005-04-19 Thread Peter Dembinski
Skip Montanaro <[EMAIL PROTECTED]> writes: > Peter> I am trying to write Master Thesis on refactoring Python > Peter> code. Where should I look for information? > > I'm not sure, but one piece of code to check out would probably > be Bicycle Repair Man, a early-stage prototype refactorin

  1   2   3   >