Re: Arrays? (Or lists if you prefer)

2006-10-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > What's the difference between xrange and range? range() creates a list object and fills it in up front, xrange() returns a sequence-like object that generates indexes on demand. for short loops, this difference doesn't really matter. for large loops, or if you usual

Re: Arrays? (Or lists if you prefer)

2006-10-22 Thread [EMAIL PROTECTED]
Andrea Griffini wrote: > Neil Cerutti wrote: > > > >>> b =[range(2), range(2)] > > I often happened to use > >b = [[0] * N for i in xrange(N)] > > an approach that can also scale up in dimensions; > for example for a cubic NxNxN matrix: > >b = [[[0] * N for i in xrange(N)] >

Re: Arrays? (Or lists if you prefer)

2006-10-22 Thread [EMAIL PROTECTED]
Niel Cerutti wrote: >Just build it up bit by bit, or build it all at once >using range() and then fill it in afterwards. >>>> b =[range(2), range(2)] >>>> b >[0, 1], [0, 1]] >>>> b[0][1] = "OK." >>>> b >[0, 'OK.'], [0, 1]] Interesting. Could I do . . . let's say b = [rang

Re: question about xmlrpc server: returning a list of lists to a Java client?

2006-10-22 Thread fortepianissimo
fortepianissimo wrote: > I have a simple xmlrpc server/client written in Python, and the client > throws a list of lists to the server and gets back a list of lists. > This runs without a problem. > > I then wrote a simple Java xmlrpc client and it calls the python > server. But I can't figure out

Re: Arrays? (Or lists if you prefer)

2006-10-22 Thread Andrea Griffini
Neil Cerutti wrote: > >>> b =[range(2), range(2)] I often happened to use b = [[0] * N for i in xrange(N)] an approach that can also scale up in dimensions; for example for a cubic NxNxN matrix: b = [[[0] * N for i in xrange(N)] for j in xrange(N)] Andrea -- htt

Re: Socket module bug on OpenVMS

2006-10-22 Thread Fredrik Lundh
Irmen de Jong wrote: > This also raises the question to what extent Python itself should > work around platform specific "peculiarities", such as this one. > There's another problem with socket code on Windows and VMS systems, > where you get strange exceptions when using a "too big" recv() buffer

ANN: wxPython 2.7.1.2 release

2006-10-22 Thread Robin Dunn
Announcing -- The 2.7.1.2 release of wxPython is now available for download at http://wxpython.org/download.php. This release is a quick-turnaround bugfix release designed to solve some problems found in the 2.7.1.1 release. Source and binaries are available for both Python 2.4 and 2.5 fo

Re: Python and CMS

2006-10-22 Thread johnf
Echo wrote: > I am going to start working on a church website. And since I like > python, I decided to use WSGI. However, I later found out about all > the different CMS's in php. So I wondered if there where any in > python. > > Sadly, I only found Plone, skeletonz, and PyLucid (If there is any

sigmaplot key

2006-10-22 Thread Jac
key for sigmaplot 10 please -- http://mail.python.org/mailman/listinfo/python-list

question about xmlrpc server: returning a list of lists to a Java client?

2006-10-22 Thread fortepianissimo
I have a simple xmlrpc server/client written in Python, and the client throws a list of lists to the server and gets back a list of lists. This runs without a problem. I then wrote a simple Java xmlrpc client and it calls the python server. But I can't figure out what type to cast the result (of t

Re: comp.lang.python, comp.sys.ibm.pc.games.rpg, comp.arch.embedded, comp.programming, comp.text.txt

2006-10-22 Thread Paul Rubin
[EMAIL PROTECTED] writes: > trying to find out where everyone else is buying/selling at other than > ebay, any recomendations? Yes, one thing for sure, those of us with sense don't buy from spammers like yourself. -- http://mail.python.org/mailman/listinfo/python-list

comp.lang.python, comp.sys.ibm.pc.games.rpg, comp.arch.embedded, comp.programming, comp.text.txt

2006-10-22 Thread vilebuzz
I sell on ebay alot and I'm starting to search online to find other options to sell computers. What I mainly do is buy used desktops and upgrade them w/ better/newer parts for resale. But do to ebays overwhelming fees racking up every month I've started to look else where. I have since found a s

Re: Problems trying to override __str__ on path class

2006-10-22 Thread Mike Krell
Peter Otten <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I get > > np: "overridden __str__: c:/mbk/test" > str(np): "overridden __str__: c:/mbk/test" > overridden __str__: overridden __str__: c:/mbk/test/appendtest Hmmm. I guess you're not running under windows, since normpath() co

Re: Arrays? (Or lists if you prefer)

2006-10-22 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Pythonic lists are everything I want in a one dimensional array . . . > but I'm trying to do a text adventure and simplify the proces by > creating a grid as opposed to a tedious list of rooms this room > connects to. > > Way to do SIM

Re: Arrays? (Or lists if you prefer)

2006-10-22 Thread Neil Cerutti
On 2006-10-23, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Pythonic lists are everything I want in a one dimensional array > . . . but I'm trying to do a text adventure and simplify the > proces by creating a grid as opposed to a tedious list of rooms > this room connects to. Not to chase you

Re: Arrays? (Or lists if you prefer)

2006-10-22 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Way to do SIMPLE array, either internally or externally, with Python, Maybe you want to use a dictionary: a = {} a[(3,5)] = 2 -- http://mail.python.org/mailman/listinfo/python-list

Arrays? (Or lists if you prefer)

2006-10-22 Thread [EMAIL PROTECTED]
Pythonic lists are everything I want in a one dimensional array . . . but I'm trying to do a text adventure and simplify the proces by creating a grid as opposed to a tedious list of rooms this room connects to. So I want to know a good way to do a SIMPLE two dimensional array. Python's lists are

Re: Customize the effect of enumerate()?

2006-10-22 Thread Steve Holden
Simon Forman wrote: > Dustan wrote: > >>Can I make enumerate(myObject) act differently? >> >>class A(object): >> def __getitem__(self, item): >> if item > 0: >> return self.sequence[item-1] >> elif item < 0: >> return self.sequence[i

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-22 Thread Peter Decker
On 22 Oct 2006 17:26:55 -0700, alex23 <[EMAIL PROTECTED]> wrote: > Can you also tell when you're wrong? > > I checked out Wax last week for the first time; I hit a snag and got an > answer from the lead developer within a day, along with a pointer to > the latest dev version. > > But don't let com

Re: Attempting to parse free-form ANSI text.

2006-10-22 Thread Paul McGuire
"Michael B. Trausch" <"mike$#at^&nospam!%trauschus"> wrote in message news:[EMAIL PROTECTED] > Alright... I am attempting to find a way to parse ANSI text from a > telnet application. However, I am experiencing a bit of trouble. > > What I want to do is have all ANSI sequences _removed_ from the

Re: PSF Infrastructure has chosen Roundup as the issue tracker for Python development [repost]

2006-10-22 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > [my initial post through python-list never seemed to reach c.l.py; > reposting] It did reach us, but in an ugly mass of text with no paragraph breaks. This one is more readable, thanks. > Well, the community stepped up to the challenge and we got

multythreading app memory consumption

2006-10-22 Thread Roman Petrichev
Hi folks. I've just faced with very nasty memory consumption problem. I have a multythreaded app with 150 threads which use the only and the same function - through urllib2 it just gets the web page's html code and assigns it to local variable. On the next turn the variable is overritten with an

Re: pylint: What's wrong with the builtin map()

2006-10-22 Thread Robert Kern
Tuomas wrote: > #!/usr/bin/python > """test pydev_0.9.3/../pylint""" > __revision__ = "test_mod 0.1 by TV 06/10/22" > > lst = ['aaa', ' bbb', '\tccc\n'] > lst = map(lambda x: x.strip(), lst) > > result = """ > No config file found, using default configuration > * Module test_mod > W:

Re: Customize the effect of enumerate()?

2006-10-22 Thread Simon Forman
Dustan wrote: > Can I make enumerate(myObject) act differently? > > class A(object): > def __getitem__(self, item): > if item > 0: > return self.sequence[item-1] > elif item < 0: > return self.sequence[item] > elif

Re: Socket module bug on OpenVMS

2006-10-22 Thread Irmen de Jong
Jean-Paul Calderone wrote: > On Sun, 22 Oct 2006 19:58:44 +0200, Irmen de Jong > <[EMAIL PROTECTED]> wrote: >> Jean-Paul Calderone wrote: >>> I think everyone can agree that Python shouldn't crash. >> >> Well, it doesn't really crash in a bad way, in my example: >> it doesn't work because it simpl

Re: Is x.f() <==>MyClass.f(x) a kind of algebraic structure?

2006-10-22 Thread Simon Forman
steve wrote: > I thought that when read Guido van Rossum' Python tutorial.What can we > think that? What? -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-22 Thread alex23
Peter Decker wrote: > When you've worked with lots of open > source projects, you can tell which are actively being developed and > which are dead or comatose; you can tell which have a growing > community and which are stagnant; you can tell which are worth > investing your time into learning and/

Re: Python and CMS

2006-10-22 Thread Bruno Desthuilliers
Echo a écrit : (snip) > As for working with WSGI, I have found > Colubrid(http://wsgiarea.pocoo.org/colubrid/) and > Paste(http://pythonpaste.org/). I was wondering if anyone knew of any > other libraries that make working with WSGI easier. Pylons (www.pylonshq.com). It's a rail-like framework ba

sending vim text through Python filter

2006-10-22 Thread BartlebyScrivener
Hello, I'm sure this is my fault or some Windows snafu. But using gvim 7.0 on Windows XP, I can't seem to get gvim to successfully filter text through a Python script. I also use NoteTab and have no problems running text from NoteTab through the same Python script. Any vimmers help with this? I'

Re: Python and CMS

2006-10-22 Thread Duncan Booth
Echo <[EMAIL PROTECTED]> wrote: > Sadly, I only found Plone, skeletonz, and PyLucid (If there is any > more, please let me know). Of those three, only PyLucid supports WSGI > and it didn't look very nice to me. > Both Plone and skeletonz looked very nice. However, they can't be > hosted on a regul

Re: Python and CMS

2006-10-22 Thread Kjell Magne Fauske
I recommend taking a look at Django [1]. It is not a CMS right out of the box, but writing one using the Django framework is not that difficult. [1] http://www.djangoproject.com/ - Kjell Magne Fauske Echo wrote: > I am going to start working on a church website. And since I like > python, I deci

Scrolling On IDLE

2006-10-22 Thread Julio Ng
Hello, I am using the IDLE (v1.2) for Mac OS X, and realized that scrolling with the mouse doesn't work. Do I need to configure anything to enable that feature? Thanks, Julio -- http://mail.python.org/mailman/listinfo/python-list

Re: Altering the way exceptions print themselves

2006-10-22 Thread Peter Otten
Irmen de Jong wrote: > I want to alter the way exceptions print themselves. > More specifically, I'd like to extend the __str__ method of > the exception's class so that it is printed in a different way. > > I used to replace the __str__ method on the exception object's > class by a custom method

Re: Python and CMS

2006-10-22 Thread johnzenger
For a free out of the box solution, look at MoinMoin. It is wiki software, but nothing stops you from turning off user signups, locking down the whole site, and just using it as a CMS. It's very easy to set up, can run as a CGI, and requires no database backend. Echo wrote: > I am going to start

ElementSOAP tutorial / HTTPClient

2006-10-22 Thread mirandacascade
Operating system: Windows XP Home Version of Python: 2.4 While looking through the tutorial on ElementSOAP at the following link: http://effbot.org/zone/element-soap.htm I observed sample code that included: from HTTPClient import HTTPClient When I get into Pythonwin and attempt the import sta

Re: pylint: What's wrong with the builtin map()

2006-10-22 Thread Georg Brandl
Tuomas wrote: > Georg Brandl wrote: >> Some people think that all occurences of map() must be replaced >> by list comprehensions. The designer of pylint seems to be >> one of those. > > So it seems, but why? See Fredrik's post. There's no error in the expression with map(), it's just less effecti

Re: Problems trying to override __str__ on path class

2006-10-22 Thread Peter Otten
Mike Krell wrote: > I'm running into problems trying to override __str__ on the path class > from Jason Orendorff's path module > (http://www.jorendorff.com/articles/python/path/src/path.py). > > My first attempt to do this was as follows: > > ''' > class NormPath(path): > def __str__(self): > r

Re: print dos format file into unix format

2006-10-22 Thread Simon Forman
[EMAIL PROTECTED] wrote: > Suppose I have a dos format text file. The following python code will > print ^M at the end. I'm wondering how to print it in unix format. > > fh = open(options.filename) > for line in fh.readlines() > print line, > > Thanks, > Peng Python ships with two utility script

Re: Socket module bug on OpenVMS

2006-10-22 Thread Jean-François Piéronne
Irmen de Jong a écrit : > Jean-François Piéronne wrote: > >> Which Python version, OpenVMS version, IP stack and stack version? > > OpenVMS 7.3-2, Python 2.3.5, no idea about IP stack version. > Thanks, may be upgrade to Python 2.5 will solve the problem. >> If you think this is a Python on Ope

Re: pylint: What's wrong with the builtin map()

2006-10-22 Thread Fredrik Lundh
Tuomas wrote: > lst = map(lambda x: x.strip(), lst) list comprehensions are more efficient than map/lambda combinations; the above is better written as: lst = [x.strip() for x in lst] in general, map() works best when the callable is an existing function (especially if it's a built-in).

Re: Socket module bug on OpenVMS

2006-10-22 Thread Irmen de Jong
Jean-François Piéronne wrote: > Which Python version, OpenVMS version, IP stack and stack version? OpenVMS 7.3-2, Python 2.3.5, no idea about IP stack version. > If you think this is a Python on OpenVMS problem, send me a small > reproduced anf I will take a look. I don't have any small case ly

Problems trying to override __str__ on path class

2006-10-22 Thread Mike Krell
I'm running into problems trying to override __str__ on the path class from Jason Orendorff's path module (http://www.jorendorff.com/articles/python/path/src/path.py). My first attempt to do this was as follows: ''' class NormPath(path): def __str__(self): return 'overridden __str__

Re: ElementSOAP tutorial / HTTPClient

2006-10-22 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > 2) how should I have constructed my searches when attempting to resolve > this issue such that I wouldn't have had to post this question? maybe reading the highlighted "Note" at the top of each page in that article series could have helped? "Note: A distribution

Re: How to print a file in binary mode

2006-10-22 Thread Fredrik Lundh
Lucas wrote: > # How can I display a.jpg's binary code? looks like you're confusing binary numbers with binary files: http://en.wikipedia.org/wiki/Binary_numeral_system http://en.wikipedia.org/wiki/Binary_file you don't really need the former to encrypt the contents of the file; algorithms ten

pylint: What's wrong with the builtin map()

2006-10-22 Thread Tuomas
#!/usr/bin/python """test pydev_0.9.3/../pylint""" __revision__ = "test_mod 0.1 by TV 06/10/22" lst = ['aaa', ' bbb', '\tccc\n'] lst = map(lambda x: x.strip(), lst) result = """ No config file found, using default configuration * Module test_mod W: 6: Used builtin function 'map' E:

Re: PSF Infrastructure has chosen Roundup as the issue tracker for Python development

2006-10-22 Thread Ron Adam
Kay Schluehr wrote: > Anna Ravenscroft wrote: > >> Interestingly enough, the quote of the day from Google on this email was: >> >> Never doubt that a small group of thoughtful, committed citizens can >> change the world; indeed, it's the only thing that ever has. >> Margaret Mead > > Commitment.

Re: Socket module bug on OpenVMS

2006-10-22 Thread Irmen de Jong
Jean-Paul Calderone wrote: > I think everyone can agree that Python shouldn't crash. Well, it doesn't really crash in a bad way, in my example: it doesn't work because it simply raises a socket exception all the time. > Whether Python should propagate other kinds of errors from the underlying > p

Re: Socket module bug on OpenVMS

2006-10-22 Thread Jean-Paul Calderone
On Sun, 22 Oct 2006 19:58:44 +0200, Irmen de Jong <[EMAIL PROTECTED]> wrote: >Jean-Paul Calderone wrote: >> I think everyone can agree that Python shouldn't crash. > >Well, it doesn't really crash in a bad way, in my example: >it doesn't work because it simply raises a socket exception all the time

Re: pylint: What's wrong with the builtin map()

2006-10-22 Thread Georg Brandl
Tuomas wrote: > #!/usr/bin/python > """test pydev_0.9.3/../pylint""" > __revision__ = "test_mod 0.1 by TV 06/10/22" > > lst = ['aaa', ' bbb', '\tccc\n'] > lst = map(lambda x: x.strip(), lst) > > result = """ > No config file found, using default configuration > * Module test_mod > W:

Re: Socket module bug on OpenVMS

2006-10-22 Thread Jean-François Piéronne
> Hi, > > Recently I was bitten by an apparent bug in the BSD socket layer > on Open VMS. Specifically, it appears that VMS defines MSG_WAITALL > in socket.h but does not implement it (it is not in the documentation). > And I use the socket.MSG_WAITALL flag on my recv() calls... and > then they cr

Altering the way exceptions print themselves

2006-10-22 Thread Irmen de Jong
Hello, I want to alter the way exceptions print themselves. More specifically, I'd like to extend the __str__ method of the exception's class so that it is printed in a different way. I used to replace the __str__ method on the exception object's class by a custom method, but that breaks my code

Re: pylint: What's wrong with the builtin map()

2006-10-22 Thread Tuomas
Georg Brandl wrote: > Some people think that all occurences of map() must be replaced > by list comprehensions. The designer of pylint seems to be > one of those. So it seems, but why? Formally spoken we ase "using variable 'x' before assigment" in the comprehension too. #!/usr/bin/python """tes

Re: Socket module bug on OpenVMS

2006-10-22 Thread Jean-Paul Calderone
On Sun, 22 Oct 2006 19:00:22 +0200, Irmen de Jong <[EMAIL PROTECTED]> wrote: >Hi, > >Recently I was bitten by an apparent bug in the BSD socket layer >on Open VMS. Specifically, it appears that VMS defines MSG_WAITALL >in socket.h but does not implement it (it is not in the documentation). >And I u

Socket module bug on OpenVMS

2006-10-22 Thread Irmen de Jong
Hi, Recently I was bitten by an apparent bug in the BSD socket layer on Open VMS. Specifically, it appears that VMS defines MSG_WAITALL in socket.h but does not implement it (it is not in the documentation). And I use the socket.MSG_WAITALL flag on my recv() calls... and then they crash on OpenVMS

Current stackdepth outside PyEval_EvalFrameEx

2006-10-22 Thread Fabiano Sidler
Hi folks! I'm trying to implement a python function that returns the current stack depth of its frame. Unfortunately, I don't see any possibility to get this value outside of PyEval_EvalFrameEx. Inside of it, I'd use the STACK_LEVEL macro. How do I do it? Greetings, Fips -- http://mail.python.or

[ANN] Movable IDLE 0.1.0

2006-10-22 Thread Fuzzyman
There is now an experimental version of **Movable IDLE** available, this is an off-shoot of the `Movable Python `_ project. **Movable IDLE**, version 0.1.0 can be downloaded (free) from : `Movable IDLE Download

Re: PSF Infrastructure has chosen Roundup as the issue tracker for Python development

2006-10-22 Thread Kay Schluehr
Anna Ravenscroft wrote: > Interestingly enough, the quote of the day from Google on this email was: > > Never doubt that a small group of thoughtful, committed citizens can > change the world; indeed, it's the only thing that ever has. > Margaret Mead Commitment. Some individuals do the actual ch

Re: How to print a file in binary mode

2006-10-22 Thread Lucas
I am sorry my english is not good! strList = ['1010010100','11101000100'] fileWrite = open('a.jpg','ab') for item in strList: fileWrite.write(item) fileWrite.close() # I don't know whether or not I succeed fileRead = open('a.jpg','rb') b = fileRead.read() fileRead.close() print b #it is w

Re: implementation of "in" that returns the object.

2006-10-22 Thread Paul McGuire
"Jorge Vargas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > > I need to check if an object is in a list AND keep a reference to the > object I have done it this way but is there a better one? > def inplusplus(value,listObj): > ... for i in listObj: > ...

Re: How to print a file in binary mode

2006-10-22 Thread Fredrik Lundh
Lucas wrote: > well, if I just open the file in binary mode, and write a string,e.g > '660', how do i read the result? I means I need print the binary in > screen. I'm afraid that the more you write, the less sense you make. > do these? > > fileWrite = open('a.jpg','ab') > fileWrite.write('660

Re: Screen capture on Linux

2006-10-22 Thread Theerasak Photha
On 22 Oct 2006 09:06:53 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Paolo Pantaleo wrote: > > Hi, > > > > I need to capture a screen snapshot in Linux. PIL has a module > > IageGrab, but in the free version it only works under Windows. Is > > there any package to capture the screen on Lin

Re: How to print a file in binary mode

2006-10-22 Thread Lucas
well, if I just open the file in binary mode, and write a string,e.g '660', how do i read the result? I means I need print the binary in screen. do these? fileWrite = open('a.jpg',''ab') fileWrite.write('660') fileWrite.close() fileRead = open('a.jpg','rb') b = fileRead.read() fileRead.close()

Re: Screen capture on Linux

2006-10-22 Thread [EMAIL PROTECTED]
Paolo Pantaleo wrote: > Hi, > > I need to capture a screen snapshot in Linux. PIL has a module > IageGrab, but in the free version it only works under Windows. Is > there any package to capture the screen on Linux? xwd comes with the X server. man xwd Most useful is "xwd -root" or similar. You

Re: Why I cannot Exit python shell ??

2006-10-22 Thread Fredrik Lundh
Jia Lu wrote: > After using python shell (IDLE) for a while, I typed commands below > to exit . But error ocurred. > raise SystemExit > > Traceback (most recent call last): > File "", line 1, in > raise SystemExit > SystemExit sys.exit(0) > > Traceback (most recent call last)

Why I cannot Exit python shell ??

2006-10-22 Thread Jia Lu
Hi all. After using python shell (IDLE) for a while, I typed commands below to exit . But error ocurred. >>> raise SystemExit Traceback (most recent call last): File "", line 1, in raise SystemExit SystemExit >>> sys.exit(0) Traceback (most recent call last): File "", line 1, in

PSF Infrastructure has chosen Roundup as the issue tracker for Python development [repost]

2006-10-22 Thread [EMAIL PROTECTED]
[my initial post through python-list never seemed to reach c.l.py; reposting] At the beginning of the month the PSF Infrastructure committee announced that we had reached the decision that JIRA was our recommendation for the next issue tracker for Python development. Realizing, though, that it was

Re: implementation of "in" that returns the object.

2006-10-22 Thread Fredrik Lundh
Marc 'BlackJack' Rintsch wrote: > def inplusplus(value,listObj): >> ... for i in listObj: >> ... if i is value: >> ... return value >> ... return False >> ... > > def my_in(value, sequence): > if value in sequence: > return value > else:

Re: How to print a file in binary mode

2006-10-22 Thread Fredrik Lundh
Lucas wrote: > I do it because I want to encrypt a string into a picture using RSA > algorithm. what does "into" mean? are you supposed to encrypt the binary data representing the JPEG image, or embed a message into the actual image? > so I first convert the string to binary,and then saving t

Re: implementation of "in" that returns the object.

2006-10-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Jorge Vargas wrote: > I need to check if an object is in a list AND keep a reference to the > object I have done it this way but is there a better one? But you already *have* a reference to that object!? def inplusplus(value,listObj): > ... for i in listObj: > ..

Re: How to print a file in binary mode

2006-10-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Lucas wrote: > thanks for your answer. > > I known how to do it. > read() return a string. so > 1) bytes = read(1) #read the file by bit. This reads a byte, not a bit. > 2) chrString = ord(bytes) #convert the string to ASCII. Converts the byte into an integer with valu

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-22 Thread sturlamolden
Wektor wrote: > I ment in the GUI context , a widget-based api where you can put > buttons, labels etc. on a form. You mean GTK? GTK 2.8 uses an abstraction layer for drawing widgets called "Cairo". Cairo can use OpenGL or Quartz as backends (still experimental). Thus, you can get a hardware-ac

implementation of "in" that returns the object.

2006-10-22 Thread Jorge Vargas
Hi I need to check if an object is in a list AND keep a reference to the object I have done it this way but is there a better one? >>> def inplusplus(value,listObj): ... for i in listObj: ... if i is value: ... return value ... return False ... >>> l = [1,2

Re: How to print a file in binary mode

2006-10-22 Thread Felipe Almeida Lessa
22 Oct 2006 06:33:50 -0700, Lucas <[EMAIL PROTECTED]>: I known how to do it.read() return a string. so1) bytes = read(1) #read the file by bit.2) chrString  = ord(bytes) #convert the string to ASCII.3) print numberToBinary(chrString) #convert the ASCII to Binary using my function.4) Loop[numberToBi

Re: How to print a file in binary mode

2006-10-22 Thread Lucas
thanks for your answer. I known how to do it. read() return a string. so 1) bytes = read(1) #read the file by bit. 2) chrString = ord(bytes) #convert the string to ASCII. 3) print numberToBinary(chrString) #convert the ASCII to Binary using my function. 4) Loop I do it because I want to encrypt

Re: Screen capture on Linux

2006-10-22 Thread Theerasak Photha
On 10/21/06, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2006-10-21, Sai Krishna M <[EMAIL PROTECTED]> wrote: > > On 10/21/06, Paolo Pantaleo <[EMAIL PROTECTED]> wrote: > >> Hi, > >> > >> I need to capture a screen snapshot in Linux. PIL has a module > > ImageMagick has a command-line program nam

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-22 Thread Peter Decker
On 22 Oct 2006 02:40:17 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > With some cleaning and improving, I think wax > (http://zephyrfalcon.org/labs/wax.html ) can become good too. I looked at Wax, but the author doesn't seem to be too involved with it. It looks like a cool idea that he de

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-22 Thread Neil Cerutti
On 2006-10-22, Wektor <[EMAIL PROTECTED]> wrote: > I ment in the GUI context , a widget-based api where you can put > buttons, labels etc. on a form. > Not an advanced 3D stuff which is useless for such application. > Something like : > and sdl based > http://www.paragui.org/ > > but none have Pyth

Re: How to print a file in binary mode

2006-10-22 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Lucas wrote: > I need print a file in binary mode . > > f = f.open('python.jpg','rb') > bytes = f.read() > f.close() > > print(bytes) > > I can't get any binary code. What do you mean by "binary code"? If you use ``print repr(bytes)`` everything outside ASCII will be p

Re: Py 2.5: Bug in sgmllib

2006-10-22 Thread Martin v. Löwis
Michael Butscher schrieb: > Is this a bug or is SGMLParser not meant to be used for unicode strings > (it should be documented then)? In a sense, SGML itself is not meant to be used for Unicode. In SGML, the document character set is subject to the SGML application. So what specific character a c

How to print a file in binary mode

2006-10-22 Thread Lucas
I need print a file in binary mode . f = f.open('python.jpg','rb') bytes = f.read() f.close() print(bytes) I can't get any binary code. how to do it? Thank you very much! -- http://mail.python.org/mailman/listinfo/python-list

Re: Debugging

2006-10-22 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Saturday 21 October 2006 19:40, Gregor Horvath wrote: > Small snippets of code are developed in the interpreter and when they > are working assembled in the editor. If something goes wrong a print on

Re: The fastest search

2006-10-22 Thread Fulvio
*** Your mail has been scanned by InterScan MSS. *** On Saturday 21 October 2006 19:09, Steven D'Aprano wrote: > So for searches that succeed, dicts are much faster than lists. Very precious advice. Thank you, indeed. The lesson was good :-) I'd only lik

Python and CMS

2006-10-22 Thread Echo
I am going to start working on a church website. And since I like python, I decided to use WSGI. However, I later found out about all the different CMS's in php. So I wondered if there where any in python. Sadly, I only found Plone, skeletonz, and PyLucid (If there is any more, please let me know)

Re: Py 2.5: Bug in sgmllib

2006-10-22 Thread Fredrik Lundh
Michael Butscher wrote: > if I execute the following two lines in Python 2.5 (to feed in a > *unicode* string): > > import sgmllib > sgmllib.SGMLParser().feed(u'') source documents are encoded byte streams, not decoded Unicode sequences. I suggest reading up on how Python's Unicode string ty

Py 2.5: Bug in sgmllib

2006-10-22 Thread Michael Butscher
Hi, if I execute the following two lines in Python 2.5 (to feed in a *unicode* string): import sgmllib sgmllib.SGMLParser().feed(u'') I get the exception: Traceback (most recent call last): File "", line 1, in sgmllib.SGMLParser().feed(u'') File "C:\Programme\Python25\Lib\sgmllib.py

Re: question: script to input data into a webpage and then retrieve the result?

2006-10-22 Thread [EMAIL PROTECTED]
Christoph Haas 写道: > On Sunday 22 October 2006 08:06, mxywp wrote: > > Could someone help me with this or share an example script with me? > > > > Here is what I want to accomplish: > > (1) input 3 values into 3 boxes on a web page > > (2) there is an authentication code each time you access this

Re: help with my first use of a class

2006-10-22 Thread bruno de chez modulix en face
Fulvio a écrit : > *** > Your mail has been scanned by InterScan MSS. > *** > > > On Saturday 21 October 2006 02:01, James Stroud wrote: > > I think the trick is to identify when a class would make more sense than > > a collection of subroutines > > I do be

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-22 Thread Wektor
sturlamolden wrote: > > Its also a pity that no one didnt do something based on OpenGL with > > python (or maybe im wrong) it could be cool and really cross-platform. > > You are wrong. There are PyOpenGL and there is cross-platform GUI and > game development platforms that use it (PyGTK, wxPython

Re: ANN compiler2 : Produce bytecode from Python 2.5 Abstract Syntax Trees

2006-10-22 Thread Georg Brandl
Michael Spencer wrote: > Announcing: compiler2 > - > > For all you bytecode enthusiasts: 'compiler2' is an alternative to the > standard > library 'compiler' package, with several advantages. Is this a rewrite from scratch, or an improved stdlib compiler package? In the la

Re: A very nice free browser to try...

2006-10-22 Thread Ben Finney
[EMAIL PROTECTED] writes: > There's a very nice browser Please don't spam about products unrelated to Python here. -- \ "A celebrity is one who is known by many people he is glad he | `\ doesn't know." -- Henry L. Mencken | _o__)

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-22 Thread bearophileHUGS
Peter Decker: > Now that I've discovered Dabo, which wraps wxPython, hiding the C++ > ugliness under a very Pythonic API, I have the best of both worlds. I > get to code naturally, and the results look great. With some cleaning and improving, I think wax (http://zephyrfalcon.org/labs/wax.html ) ca

Re: A Comparison Of Dynamic and Static Languiges

2006-10-22 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: > > >>Since network 127 is reserved in its entirety for loopback (local >>process) use, it would seem that any DNS name that maps to an address in >>that space with the single exception of "localhost" should be treated as >>a spammer. > > > countrie

Re: How to upgrade python from 2.4.3 to 2.4.4 ?

2006-10-22 Thread Steve Holden
Tony Meyer wrote: >> At the moment SourceForge is only listing one (UK) mirror for mingw, and >> that seems to be down. I'm guessing something is broken, since I know it >> used to be much more widely available. > > > Only one mirror (Kent) is available for any project. It's been like > this

Re: Attempting to parse free-form ANSI text.

2006-10-22 Thread Frederic Rentsch
Michael B. Trausch wrote: > Alright... I am attempting to find a way to parse ANSI text from a > telnet application. However, I am experiencing a bit of trouble. > > What I want to do is have all ANSI sequences _removed_ from the output, > save for those that manage color codes or text presentatio

Re: A Comparison Of Dynamic and Static Languiges

2006-10-22 Thread Fredrik Lundh
Steve Holden wrote: > Since network 127 is reserved in its entirety for loopback (local > process) use, it would seem that any DNS name that maps to an address in > that space with the single exception of "localhost" should be treated as > a spammer. countries.nerd.dk is a DNS blackhole system

Re: How to upgrade python from 2.4.3 to 2.4.4 ?

2006-10-22 Thread Tony Meyer
> At the moment SourceForge is only listing one (UK) mirror for > mingw, and > that seems to be down. I'm guessing something is broken, since I > know it > used to be much more widely available. Only one mirror (Kent) is available for any project. It's been like this for nearly a day now, a

a question about MS Windows Clipboard to decrease cpu usage.

2006-10-22 Thread [EMAIL PROTECTED]
hello, I want to record the content of windows'clipboad, after search c.l.p. I got some practical answer such as http://groups.google.com/group/comp.lang.python/browse_thread/thread/57318b87e33e79b0/a7c5d5fcbd4eb58a I have create my small script, it can get clipboard preliminary. but now i had a tr

Re: Fwd: Re: How to upgrade python from 2.4.3 to 2.4.4 ?

2006-10-22 Thread Steve Holden
Martin v. Löwis wrote: > Kenneth Long schrieb: > >>> Okay if one builds such from sources... but us poor >>>Windows flunkies >>>without a build environment have to wait for some >>>kindly soul to build >>>the installer compatible with the new Python >>>version. >>> >> >>especially since I have

Re: A Comparison Of Dynamic and Static Languiges

2006-10-22 Thread Steve Holden
sturlamolden wrote: > Gerrit Holl wrote: > > >>This newsgroup is mirrored by a mailing-list, so many people use their real >>address. The solution to spam is spamfiltering (spambayes), not hiding ones >>address on the internet. > > > The answer to spam here in Norway is incredibly simple. It se

A very nice free browser to try...

2006-10-22 Thread bj_private
Hi Guys, There's a very nice browser that is called Smart Bro. I think this browser is the best browser in the market. It has: 1. Very nice and clean interface. 2. Tabbed browsing. 3. History Cleaner. 4. Popup killer. 5. Form filler. 6. RSS reader. 7. Flash filter. And best of all it's free. I t

  1   2   >