Re: Using non-ascii symbols

2006-01-24 Thread Giovanni Bajo
Robert Kern wrote: >> I can't find "?, ?, or ?" on my keyboard. > > Get a better keyboard? or OS? > > On OS X, > > ? is Alt-, > ? is Alt-. > ? is Alt-= > > Fewer keystrokes than <= or >= or !=. Sure, but I can't find OS X listed as a prerequisite for using Python. So, while I don't give a damn if

Re: wxPython layout problem

2006-01-24 Thread Tim Roberts
"py" <[EMAIL PROTECTED]> wrote: > >I have the following code: >... >there are two problems. >1) i want the sizer (that is returned from buildTopPanel()) to fill the >screen wide/tall. now the text control in it is very small in the >upper-left corner. > >2) the scroll bars and borders on the t

Re: os.unlink() AND win32api.DeleteFile()

2006-01-24 Thread Tim Roberts
rbt <[EMAIL PROTECTED]> wrote: > >Can someone detail the differences between these two? On Windows which >is preferred? os.unlink() calls unlink() in the C run-time library. In VC++, unlink() passes its parameter directly to DeleteFile. There is no difference. DeleteFile() is the only way to de

Re: Redirecting standard out in a single namespace

2006-01-24 Thread Bengt Richter
On 23 Jan 2006 04:00:40 -0800, "Fuzzyman" <[EMAIL PROTECTED]> wrote: > >Bengt Richter wrote: > [...] >> It wouldn't be shadowing, but I suppose you could replace sys.stdout with >> a custom object whose methods check where they were called from. >> Then you could give the object initialization par

Re: list comprehention

2006-01-24 Thread Morten Vold
On 23/01/2006 18:41, Mathijs uttered: >> len([ref.pop(ref.index(x)) for x in lis if x in ref]) > This is the type of solution I was hoping to see: one-liners, with no > use of local variables. As Tim Chase already wrote, it has only one > less elegant side: it alters the original ref list. > > T

Re: Suggestions for workaround in CSV bug

2006-01-24 Thread Michael Ströder
Simmons, Stephen wrote: > > I've come across a bug in CSV where the csv.reader() raises an > exception if the input line contains '\r'. Example code and output > below shows a test case where csv.reader() cannot read an array > written by csv.writer(). > > Error: newline inside string > WARNING

How to enable rotor in python 2.4.2?

2006-01-24 Thread Murphy Wong
Dear all, I've installed python 2.4.2 and Zope 2.8.5 on a 64-bit Linux. As I'm installing FLE (http://fle3.uiah.fi/), I find that it will call the rotor module i npython. However, rotor is removed from python 2.4.2 (http://savannah.nongnu.org/bugs/?func=detailitem&item_id=14434). Could I e

Re: os.unlink() AND win32api.DeleteFile()

2006-01-24 Thread Tim Golden
[rbt] | Can someone detail the differences between these two? On | Windows which is preferred? Looks like that's been answered elsewhere. | Also, is it true that win32api.DeleteFile() can remove the 'special' | files located in the 'special' folders only accessible by the shell | object such as

Re: list comprehention

2006-01-24 Thread Peter Otten
[Mathijs] > Example2: > ref=[2, 2, 4, 1, 1] > list=[2, 2, 5, 2, 4] > solution: 3 (note that only the first two 2's count, the third 2 in the > list should not be counted) [Morten Vold] > May I suggest another one-liner: > > len(set(ref).intersection(lis)) > > I have no idea how this scales/p

Re: New Python.org website ?

2006-01-24 Thread Fredrik Lundh
Aahz wrote: > >the sample site contains ~600 pages. each page has been automatically > >translated from python.org sources to moinmoin markup, and then stored > >in a moinmoin 1.5 instance. a separate component has then extracted the > >pages from moinmoin, and converted them XHTML fragments for

Re: list comprehention

2006-01-24 Thread Morten Vold
On 24/01/2006 09:46, Peter Otten uttered: len(set([2, 2, 4, 1, 1]).intersection([2, 2, 5, 2, 4])) > 2 > Close, but no cigar. I need more coffee! (note to self: Always read entire problem set first) -- Morten -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing for the presence of input from stdin.

2006-01-24 Thread Roland Heiber
Will McDonald wrote: > Hi all. > > I'm writing a little script that operates on either stdin or a file > specified on the command line when run. I'm trying to handle the > situation where the script's run without any input gracefully but > can't think how to test for stdin. > Hi, maybe http://d

Re: list comprehension

2006-01-24 Thread Duncan Booth
Patrick Maupin wrote: def occurrences(t): > ... res = {} > ... for item in t: > ... res.setdefault(item,[0])[0] += 1 > ... return res > ... > I think somebody was mentioning "mutable ints" at one point, > which is basically what I abuse [0] to provide. If I were doing a l

Re: How to enable rotor in python 2.4.2?

2006-01-24 Thread Murphy Wong
I compiled python 2.3.5 and copy the lib-dynload/rotor.so to the 2.4.2 lib and it works... Thanks anyway. :) Murphy Murphy Wong wrote: > > Dear all, > > I've installed python 2.4.2 and Zope 2.8.5 on a 64-bit Linux. As I'm > installing FLE (http://fle3.uiah.fi/), I find that it will cal

Re: Backreferences in python ?

2006-01-24 Thread Sion Arrowsmith
Pankaj <[EMAIL PROTECTED]> wrote: >search for :for ( i = 0; i < 10; i++) >Replace with: for( printf( "10" ), i =0; i < 10; i++) >Where 10 is the line no. >f = open( "./1.c", "r") >fNew = open( "./1_new.c", "w") >for l in f: >print l >lineno = lineno + 1 >strToFind = "f

Re: Oddities of Tkinter

2006-01-24 Thread Eric Brunel
On 23 Jan 2006 11:28:37 -0800, Tuvas <[EMAIL PROTECTED]> wrote: > I am building a tkinter program. A part of this program is to read data > from an incoming interface, and depending on the data, will display a > bit of text on the tk dialog, it decodes this data, so to speak. If one > command is s

Re: Testing for the presence of input from stdin.

2006-01-24 Thread Will McDonald
On 24/01/06, Roland Heiber <[EMAIL PROTECTED]> wrote: > Will McDonald wrote: > > Hi all. > > > > I'm writing a little script that operates on either stdin or a file > > specified on the command line when run. I'm trying to handle the > > situation where the script's run without any input gracefully

Re: Testing for the presence of input from stdin.

2006-01-24 Thread Fredrik Lundh
Will McDonald wrote: > > There are more experienced UNIXers here, but from my POV I don't see how > > that can happen. The reason is simply that > > > > - sys.stdin alwasy exists (unless you close it yourself) > > > > - in a pipe (which this essentially is) there is now way to know if there > >

Re: How to enable rotor in python 2.4.2?

2006-01-24 Thread Gerhard Häring
Murphy Wong wrote: > Dear all, > > I've installed python 2.4.2 and Zope 2.8.5 on a 64-bit Linux. As I'm > installing FLE (http://fle3.uiah.fi/), I find that it will call the > rotor module i npython. However, rotor is removed from python 2.4.2 > (http://savannah.nongnu.org/bugs/?func=detailit

PyGTK Notebook button_press_event connection

2006-01-24 Thread Luigi
Hi all! I have an application that uses a gtk.Notebook to show the content of a GUI. Each page of it has a gtk.Label with a text that explains the content. Each page is added to the notebook with the method append_page(child, tab_label=None), passing a gtk.Label instance as tab_label variable. No

socket examples

2006-01-24 Thread le dahut
Hi, I've read the Gordon McMillan's "Socket Programming HOWTO" and I'm looking for other documents that show examples on how to write a socket server that can answer multiple clients at the same time. Does someone know where I can find those documents/tutorials ? Very thanks, K. -- http://mail

Re: socket examples

2006-01-24 Thread Fredrik Lundh
"le dahut" wrote: > I've read the Gordon McMillan's "Socket Programming HOWTO" and I'm > looking for other documents that show examples on how to write a socket > server that can answer multiple clients at the same time. > Does someone know where I can find those documents/tutorials ? see ht

Re: [Python-Help] HOWTO Send a string???

2006-01-24 Thread Sbaush
Firstly i would like to do the Send/Receive function. In the second moment i would implement the threading with this functions. is it a good way?In your opinion where could i found a valid implementation of udp send/receive? 2006/1/23, Eric Brunson <[EMAIL PROTECTED]>: This is a reasonably simple t

Re: Testing for the presence of input from stdin.

2006-01-24 Thread Thomas Bellman
Peter Gsellmann <[EMAIL PROTECTED]> writes: > Will McDonald wrote: >> That's a good point. I did wonder if it'd just have to sit there >> waiting for input much like cat would. I think that's preferable, and >> simpler :), than implementing timeouts. >> > In unix you can always use select.select

Re: Some thoughts on garbage collection

2006-01-24 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Frank Millman <[EMAIL PROTECTED]> writes >> You could then also categorize this by type, e.g. If you want a nice GUI and no requirement to modify your code Python Memory Validator could be useful. http://www.softwareverify.com Stephen -- Stephen Kellett Object M

Send a particular packet with this python client

2006-01-24 Thread Sbaush
Hi all, i have a python udp client/server.I would send a packed like this: |int|string| . How can i do it with tih client?Another question: buf is the total packet size? from socket import * # Set the socket parameters host = "192.168.11.49" port = 21567 buf = 1024 addr = (host,port) # Creat

Show content of an external page in plone.

2006-01-24 Thread sub
I'm using plone primary as a news system for my school. Now I want to integrate external sources into my plone site. The page is http://www.vucaarhusamtvucwin.dk/hold.asp?v1=randers&v2=randers&v3=a&v4=a which shows the various courses my school offers. This site i updated from a database. And i wan

Re: socket examples

2006-01-24 Thread le dahut
I have a server that receives data from a client, detect the end of this data and send other data back to the client (it's to measure bandwidth). I think the best way is to thread a part of the server's program am I right ? HOST = socket.gethostname() try: PORT = int(sys.argv[1]) print

Re: Redirecting standard out in a single namespace

2006-01-24 Thread Fuzzyman
Bengt Richter wrote: [snip..] > >The following in the write method of the custom out object works : > > > >sys._getframe(1).f_globals['__name__'] > > > >sys.stdout.write is *always* called from at least one frame deep in the > >stack - so it works. > Yes, that's about what I had in mind, not b

Re: Using non-ascii symbols

2006-01-24 Thread Steven D'Aprano
On Tue, 24 Jan 2006 04:09:00 +0100, Christoph Zwerschke wrote: > On the page http://wiki.python.org/moin/Python3%2e0Suggestions > I noticed an interesting suggestion: > > "These operators ≤ ≥ ≠ should be added to the language having the > following meaning: > ><= >= != > > this should

Re: Problem with running external process

2006-01-24 Thread ToMasz
No, no, that wasn't my intention (I'm just not conscious enough what's going on with these fork, exec, spawn.. functions). My parent process should start the child process and go back to it's tasks. Before executing it for the next time the parent should check if the previous child process is done

Re: Using non-ascii symbols

2006-01-24 Thread Claudio Grondi
Christoph Zwerschke wrote: > On the page http://wiki.python.org/moin/Python3%2e0Suggestions > I noticed an interesting suggestion: > > "These operators ≤ ≥ ≠ should be added to the language having the > following meaning: > > <= >= != > > this should improve readibility (and make language

Re: os.unlink() AND win32api.DeleteFile()

2006-01-24 Thread rbt
Tim Golden wrote: > [rbt] > > | Can someone detail the differences between these two? On > | Windows which is preferred? > > Looks like that's been answered elsewhere. > > | Also, is it true that win32api.DeleteFile() can remove the 'special' > | files located in the 'special' folders only acces

xHTML/XML to Unicode (and back)

2006-01-24 Thread Robin Haswell
Hey guys I'm currently screenscraping some Swedish site, and i need a method to convert XML entities (& etc, plus d etc) to Unicode characters. I'm sure one of python's myriad of XML processors can do this but I can't find which one. Can anyone make any suggestions? Thanks -Rob -- http://mail.

Re: Dominant color & PIL

2006-01-24 Thread Fredrik Lundh
Sebastjan Trepca wrote: > I was wondering is it possible to find out which colour is dominant in an > image using PIL? > It would be very easy to create interesting mozaic images with that :) some alternatives: >>> i = Image.open(...) >>> i.quantize(1).convert("RGB").getpixel((0, 0)) (208, 205,

PyWeek Challenge #2: write a game in a week

2006-01-24 Thread Richard Jones
The date for the second PyWeek challenge has been set: Sunday 26th March to Sunday 2nd April (00:00UTC to 00:00UTC). The PyWeek challenge invites entrants to write a game in one week from scratch either as an individual or in a team. Entries must be developed in Python, during the challenge, and m

About multithreaded webserver

2006-01-24 Thread Kr z
Hi,Do anyone know the Python source codes on how to write a simple multithreaded webserver class?RegardsFind the lowest fare online with MSN Travel -- http://mail.python.org/mailman/listinfo/python-list

Re: xHTML/XML to Unicode (and back)

2006-01-24 Thread Fredrik Lundh
Robin Haswell wrote: > I'm currently screenscraping some Swedish site, and i need a method to > convert XML entities (& etc, plus d etc) to Unicode characters. > I'm sure one of python's myriad of XML processors can do this but I can't > find which one. > > Can anyone make any suggestions? any de

Re: file_name_fixer.py

2006-01-24 Thread bruno at modulix
[EMAIL PROTECTED] wrote: > i put this together to fix a bunch of files with wierd names, please > gimme feedback, i am a newbie Ok, so let's go... Hope you won't hate me too much !-) > > #!/usr/bin/env python > import os > import sys > import string > import platform > dir = sys.argv[1] This wil

Unified web API for CGI and mod_python?

2006-01-24 Thread Tim Chase
I've been digging around, but can't seem to come up with the right combo of words to google for to get helpful results. Is there some handy wrapper/module that allows code to target existance as both a CGI script and a mod_python script, with only one "import" statement? Perhaps some common o

Re: Using non-ascii symbols

2006-01-24 Thread Ido Yehieli
>> Is this idea absurd or will one day our children think >> that restricting to 7-bit ascii was absurd? Both... this idea will only become none-absurd when unicode will become as prevalent as ascii, i.e. unicode keyboards, universal support under almost every application, and so on. Even if you c

ZODB and Zope on one Linux machine, how?

2006-01-24 Thread Rene Pijlman
I have a productional Linux web server with a Python/Zope/Plone. Now I'd like to install a non-Zope Python/ZODB application on the same server. What is the recommended way of doing that? Option 1: Install ZODB in the Python installation in the usual way. Should I expect problems when I install and

Re: New Python.org website ?

2006-01-24 Thread Fredrik Lundh
Gerhard Häring wrote: > > the sample site contains ~600 pages. each page has been automatically > > translated from python.org sources to moinmoin markup, and then stored > > in a moinmoin 1.5 instance. a separate component has then extracted the > > pages from moinmoin, and converted them XHTML

Re: PyGTK Notebook button_press_event connection

2006-01-24 Thread Johan Dahlin
> > > notebook = gtk.Notebook() > ... > child = gtk.Frame() > ... > label = gtk.Label('Any text') > label.connect('button_press_event', a_function) > ... > notebook.append_page(child, label) > > > > But the button_press_event event is not intercepted (nothing happens > when I click on the tab

Re: Using non-ascii symbols

2006-01-24 Thread Juho Schultz
Christoph Zwerschke wrote: > "These operators ≤ ≥ ≠ should be added to the language having the > following meaning: > > <= >= != > > this should improve readibility (and make language more accessible to > beginners). > I assume most python beginners know some other programming language

Re: xHTML/XML to Unicode (and back)

2006-01-24 Thread Robin Haswell
On Tue, 24 Jan 2006 14:46:46 +0100, Fredrik Lundh wrote: > Robin Haswell wrote: > >> I'm currently screenscraping some Swedish site, and i need a method to >> convert XML entities (& etc, plus d etc) to Unicode characters. >> I'm sure one of python's myriad of XML processors can do this but I can

append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Hi there, I seem to be unable to find a way to appends more keys/values to the end of a dictionary... how can I do that? E.g: mydict = {'a':'1'} I need to append 'b':'2' to it to have: mydict = {'a':'1','b':'2'} How to do? Best regards, Yves -- http://mail.python.org/mailman/listinfo/pyt

Re: Send a particular packet with this python client

2006-01-24 Thread Sbaush
I can specify the question, so you can request me easily...The int should be an integer of 32 bit fixed. This is total packet size. The string should contain XML.In this example the string is taken from keyboard, so for example. Thanks all for your helps...2006/1/24, Sbaush <[EMAIL PROTECTED]>: Hi

ANN: PyVISA 1.0 -- GPIB, USB, RS232 instrument control

2006-01-24 Thread Torsten Bronger
Hallöchen! At http://pyvisa.sourceforge.net you can find information about the PyVISA package. It realises Python bindings for the VISA library functions, which enables you to control GPIB, USB, and RS232-serial measurement devices via Python. Today I released version 1.0. If you have v0.9.7 of

Re: append to the end of a dictionary

2006-01-24 Thread Juho Schultz
Yves Glodt wrote: > Hi there, > > I seem to be unable to find a way to appends more keys/values to the end > of a dictionary... how can I do that? > > E.g: > > mydict = {'a':'1'} > > I need to append 'b':'2' to it to have: > > mydict = {'a':'1','b':'2'} > mydict['b'] = '2' -- http://mail.py

Re: append to the end of a dictionary

2006-01-24 Thread Tim Chase
> I seem to be unable to find a way to appends more keys/values to the end > of a dictionary... how can I do that? > > E.g: > > mydict = {'a':'1'} > > I need to append 'b':'2' to it to have: > > mydict = {'a':'1','b':'2'} my understanding is that the order of a dictionary should never be rel

Re: append to the end of a dictionary

2006-01-24 Thread Rene Pijlman
Yves Glodt: >I seem to be unable to find a way to appends more keys/values to the end >of a dictionary A dictionary has no order, and therefore no end. >mydict = {'a':'1'} > >I need to append 'b':'2' to it to have: > >mydict = {'a':'1','b':'2'} > >How to do? Like this: >>> mydict = {'a':'1'} >

Re: append to the end of a dictionary

2006-01-24 Thread Fredrik Lundh
Yves Glodt wrote: > I seem to be unable to find a way to appends more keys/values to the end > of a dictionary... how can I do that? > > E.g: > > mydict = {'a':'1'} > > I need to append 'b':'2' to it to have: > > mydict = {'a':'1','b':'2'} to add stuff to a dictionary, use item assignment: m

Re: append to the end of a dictionary

2006-01-24 Thread jay graves
Yves Glodt wrote: > I seem to be unable to find a way to appends more keys/values to the end > of a dictionary... how can I do that? A dictionary doesn't have an 'end' because it is an unordered collection. > E.g: > mydict = {'a':'1'} > I need to append 'b':'2' to it to have: mydict['b'] = '2' p

Re: How to enable rotor in python 2.4.2?

2006-01-24 Thread Paul Rubin
Murphy Wong <[EMAIL PROTECTED]> writes: > I've installed python 2.4.2 and Zope 2.8.5 on a 64-bit Linux. As I'm > installing FLE (http://fle3.uiah.fi/), I find that it will call the > rotor module i npython. However, rotor is removed from python 2.4.2 > (http://savannah.nongnu.org/bugs/?func=detai

Re: append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Rene Pijlman wrote: > Yves Glodt: >> I seem to be unable to find a way to appends more keys/values to the end >> of a dictionary > > A dictionary has no order, and therefore no end. that means I can neither have a dictionary with 2 identical keys but different values...? I would need e.g. thi

Re: append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Yves Glodt wrote: > Hi there, > > I seem to be unable to find a way to appends more keys/values to the end > of a dictionary... how can I do that? > > E.g: > > mydict = {'a':'1'} > > I need to append 'b':'2' to it to have: > > mydict = {'a':'1','b':'2'} > > > > How to do? Sorry for the no

Re: append to the end of a dictionary

2006-01-24 Thread Tim Chase
> that means I can neither have a dictionary with 2 identical keys but > different values...? correct :) > I would need e.g. this: > (a list of ports and protocols, to be treated later in a loop) > > ports = {'5631': 'udp', '5632': 'tcp', '3389': 'tcp', '5900': 'tcp'} > #then: > for port,protoc

Re: append to the end of a dictionary

2006-01-24 Thread Paul Rubin
Yves Glodt <[EMAIL PROTECTED]> writes: > that means I can neither have a dictionary with 2 identical keys but > different values...? No. > I would need e.g. this: > (a list of ports and protocols, to be treated later in a loop) > > ports = {'5631': 'udp', '5632': 'tcp', '3389': 'tcp', '5900': 't

Re: Send a particular packet with this python client

2006-01-24 Thread Sbaush
Now i can explain better than previous messages.This string has to be sent to another host via UDP with the previous attached simple client/server udp implementation in python. The big problem is:The packet MUST be like this c struct: #define PAYLOAD_LENGHT 5000  struct command_hdr {    int lengh

Re: append to the end of a dictionary

2006-01-24 Thread Yves Glodt
Paul Rubin wrote: > Yves Glodt <[EMAIL PROTECTED]> writes: >> that means I can neither have a dictionary with 2 identical keys but >> different values...? > > No. > >> I would need e.g. this: >> (a list of ports and protocols, to be treated later in a loop) >> >> ports = {'5631': 'udp', '5632': '

"wxPython in Action" book

2006-01-24 Thread Iain King
New book on wxPython: http://www.manning.com/books/rappin Release date of this month. Does anyone know if it's out yet / has anyone read it and has an opinion? Iain -- http://mail.python.org/mailman/listinfo/python-list

PyAmazon and Book Descriptions

2006-01-24 Thread popjack
First off, I'm new to Python, so please forgive if I've overlooked something obvious. I work for a publisher and I'm trying to use PyAmazon to programmatically examine our books' listings on Amazon.com. One of the crucial fields for this task is Book Description, which is not one of the available e

Re: append to the end of a dictionary

2006-01-24 Thread Rene Pijlman
Yves Glodt: >I would need e.g. this: >(a list of ports and protocols, to be treated later in a loop) [...] >What would be the appropriate pythonic way of doing this? In the case of tcp and udp ports, it's the combination of protocol and port number that's unique, not the port number by itself. So

Re: Unified web API for CGI and mod_python?

2006-01-24 Thread Paul Boddie
Tim Chase wrote: > I've been digging around, but can't seem to come up with the > right combo of words to google for to get helpful results. Is > there some handy wrapper/module that allows code to target > existance as both a CGI script and a mod_python script, with only > one "import" statement?

Re: Suggestions for workaround in CSV bug

2006-01-24 Thread Stephen Simmons
Simmons, Stephen wrote: > > > > I've come across a bug in CSV where the csv.reader() raises an > > exception if the input line contains '\r'. Example code and output > > below shows a test case where csv.reader() cannot read an array > > written by csv.writer(). > > > > Error: newline inside s

Re: New Python.org website ?

2006-01-24 Thread Aahz
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >Aahz wrote: >>Fredrik: >>> >>>the sample site contains ~600 pages. each page has been automatically >>>translated from python.org sources to moinmoin markup, and then stored >>>in a moinmoin 1.5 instance. a separate compone

Re: file_name_fixer.py

2006-01-24 Thread mdelliot
[EMAIL PROTECTED] wrote: > i put this together to fix a bunch of files with wierd names, please > gimme feedback, i am a newbie See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/442517 -- http://mail.python.org/mailman/listinfo/python-list

Re: Using non-ascii symbols

2006-01-24 Thread Rocco Moretti
Giovanni Bajo wrote: > Robert Kern wrote: > > >>>I can't find "?, ?, or ?" on my keyboard. Posting code to newsgroups might get harder too. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: xHTML/XML to Unicode (and back)

2006-01-24 Thread Paul Boddie
Robin Haswell wrote: > On Tue, 24 Jan 2006 14:46:46 +0100, Fredrik Lundh wrote: > > > Robin Haswell wrote: > > > >> I'm currently screenscraping some Swedish site, and i need a method to > >> convert XML entities (& etc, plus d etc) to Unicode characters. > >> I'm sure one of python's myriad of XML

Re: New Python.org website ?

2006-01-24 Thread Fredrik Lundh
Aahz wrote: > >I think I mentioned this in an earlier post; simply adding a special SideBar > >link list at the top of a page should be good enough > > > > SideBar: > > * [link title] > > * [link title] > > * [link title] > > > > > > Hrm. So you're suggesting that each page have a ma

Re: Using non-ascii symbols

2006-01-24 Thread Robert Kern
Rocco Moretti wrote: [James Stroud wrote:] I can't find "?, ?, or ?" on my keyboard. > > Posting code to newsgroups might get harder too. :-) His post made it through fine. Your newsreader messed it up. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Ar

Re: Loading a Python collection from an text-file

2006-01-24 Thread jschull
another approach (probably frowned upon, but it has worked for me) is to use python syntax (a dictionary, say, or a list) and just import (or reload) the file -- http://mail.python.org/mailman/listinfo/python-list

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
Giovanni Bajo wrote: > Sure, but I can't find OS X listed as a prerequisite for using Python. So, > while I don't give a damn if those symbols are going to be supported by > Python, > I don't think the plain ASCII version should be deprecated. There are too many > situations where it's still usefu

Re: Using non-ascii symbols

2006-01-24 Thread Robert Kern
Ido Yehieli wrote: >>>Is this idea absurd or will one day our children think >>>that restricting to 7-bit ascii was absurd? > > Both... this idea will only become none-absurd when unicode will become > as prevalent as ascii, i.e. unicode keyboards, universal support under > almost every applicatio

Re: Using non-ascii symbols

2006-01-24 Thread Paul Watson
Christoph Zwerschke wrote: > On the page http://wiki.python.org/moin/Python3%2e0Suggestions > I noticed an interesting suggestion: > > "These operators ≤ ≥ ≠ should be added to the language having the > following meaning: > > <= >= != > > this should improve readibility (and make language

Re: IPython 0.7.1 is out.

2006-01-24 Thread [EMAIL PROTECTED]
Fernando Perez wrote: > IPython's homepage is at: > > http://ipython.scipy.org > > and downloads are at: > > http://ipython.scipy.org/dist And if you have easy_install ( install it by running http://peak.telecommunity.com/dist/ez_setup.py if you already haven't done it), you can just say: easy_i

Re: append to the end of a dictionary

2006-01-24 Thread Sion Arrowsmith
Tim Chase <[EMAIL PROTECTED]> wrote: >unless you have a way of doing an in-line sort, in which you >would be able to do something like > > orderedDict = [(k,mydict[k]) for k in mydict.keys().sort()] > >Unfortunately, the version I've got here doesn't seem to support >a sort() method for the li

Re: list comprehension

2006-01-24 Thread Patrick Maupin
Duncan Booth wrote: > I prefer writing an 'if' statement here, Bryan prefers 'get', that's just a > choice of style. But 'setdefault' here, that has no style. Well, I'm often told I have no style, and I _did_ admit that it's an abuse of setdefault. However, I often use setdefault to populate nes

Re: append to the end of a dictionary

2006-01-24 Thread Tim Chase
>> orderedDict = [(k,mydict[k]) for k in mydict.keys().sort()] >> >>Unfortunately, the version I've got here doesn't seem to support >>a sort() method for the list returned by keys(). :( > > I bet it does, but it doesn't do what you think it does. See > http://docs.python.org/lib/typesseq-mutabl

Re: file_name_fixer.py

2006-01-24 Thread eww
thanks for the feedback! I'll work on your suggestions. bruno at modulix wrote: > [EMAIL PROTECTED] wrote: > > i put this together to fix a bunch of files with wierd names, please > > gimme feedback, i am a newbie > > Ok, so let's go... Hope you won't hate me too much !-) > > > > > #!/usr/bin/en

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
Juho Schultz wrote: > Fortran 90 allowed >, >= instead of .GT., .GE. of Fortran 77. But F90 > uses ! as comment symbol and therefore need /= instead of != for > inequality. I guess just because they wanted. However, it is one more > needless detail to remember. Same with the suggested operators.

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 16:33:16 +0200 in comp.lang.python, Juho Schultz <[EMAIL PROTECTED]> wrote: [...] > >Fortran 90 allowed >, >= instead of .GT., .GE. of Fortran 77. But F90 >uses ! as comment symbol and therefore need /= instead of != for >inequality. I guess just because they wanted. However,

Re: Using non-ascii symbols

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 04:09:00 +0100 in comp.lang.python, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: [...] >Once you open your mind for using non-ascii symbols, I'm sure one can >find a bunch of useful applications. Variable names could be allowed to >be non-ascii, as in XML. Think class names

a 32 bit number to integer

2006-01-24 Thread Ricardo Quesada
Hi, In python 2.0, this number was an integer: 0x88776655 but in python 2.4 it is a long (every number > 0x7fff it is a long) in python 2.4, is there a way to convert that number to a integer (notice that it only occupies 32 bits) ? thanks, riq. -- http://mail.python.org/mailman

Re: Using non-ascii symbols

2006-01-24 Thread Rocco Moretti
Robert Kern wrote: > Rocco Moretti wrote: > > [James Stroud wrote:] > >I can't find "?, ?, or ?" on my keyboard. >> >>Posting code to newsgroups might get harder too. :-) > > > His post made it through fine. Your newsreader messed it up. I'm not exactally sure what happened - I can see the

Re: a 32 bit number to integer

2006-01-24 Thread Paul Rubin
Ricardo Quesada <[EMAIL PROTECTED]> writes: > 0x88776655 > > but in python 2.4 it is a long (every number > 0x7fff it is a long) > > in python 2.4, is there a way to convert that number to a integer > (notice that it only occupies 32 bits) ? It would be -2005440939 but that's maybe not

Re: a 32 bit number to integer

2006-01-24 Thread Dave Hansen
On Tue, 24 Jan 2006 13:23:05 -0300 in comp.lang.python, Ricardo Quesada <[EMAIL PROTECTED]> wrote: >Hi, > > In python 2.0, this number was an integer: >0x88776655 > > but in python 2.4 it is a long (every number > 0x7fff it is a long) > >in python 2.4, is there a way to convert that numb

Re: Loading a Python collection from an text-file

2006-01-24 Thread Larry Bates
Take a look at ConfigParser module. The format of the file would be something like: [members] peter=16 anton=21 People are accustomed to this format file (windows .ini format). -Larry Ilias Lazaridis wrote: > within a python script, I like to create a collection which I fill with > values fro

Re: Using non-ascii symbols

2006-01-24 Thread Claudio Grondi
Christoph Zwerschke wrote: > Juho Schultz wrote: > >> Fortran 90 allowed >, >= instead of .GT., .GE. of Fortran 77. But F90 >> uses ! as comment symbol and therefore need /= instead of != for >> inequality. I guess just because they wanted. However, it is one more >> needless detail to remember

Re: Problem with running external process

2006-01-24 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "ToMasz" <[EMAIL PROTECTED]> wrote: > No, no, that wasn't my intention (I'm just not conscious enough what's > going on with these fork, exec, spawn.. functions). > My parent process should start the child process and go back to it's > tasks. Before executing it fo

Creating a more random int?

2006-01-24 Thread Steven Macintyre
Hi all, I need to retrieve an integer from within a range ... this works ... below is my out puts ... it just does not seem so random ... Is there perhaps a suggestion out there to create a more random int ...? >>> random.randint(3, 8) 7 >>> random.randint(3, 8) 3 >>> random.randint(3, 8) 3 >>>

customized instance dictionaries, anyone?

2006-01-24 Thread wolfgang . lipp
some time after posting my `Linkdict recipe`__ to aspn__ -- basically, a dictionary with run-time delegational lookup, but this is not important here -- i thought gee that would be fun to make such a customized dictionary thingie an instance dictionary, and get some custom namespace behavior out of

Re: Creating a more random int?

2006-01-24 Thread Paul Rubin
"Steven Macintyre" <[EMAIL PROTECTED]> writes: > I need to retrieve an integer from within a range ... this works ... below > is my out puts ... it just does not seem so random ... It's pretty normal for random small ints to not look random. Are there some statistical tests that the prng is defi

Re: Some thougts on cartesian products

2006-01-24 Thread Christoph Zwerschke
Bryan Olson wrote: > The claim "everything is a set" falls into the category of > 'not even wrong'. No, it falls into the category of the most fundamental Mathematical concepts. You actually *define* tuples as sets, or functions as sets or relations as sets, or even all kinds of numbers and othe

Re: Creating a more random int?

2006-01-24 Thread [EMAIL PROTECTED]
Steven Macintyre wrote: > Hi all, > > I need to retrieve an integer from within a range ... this works ... below > is my out puts ... it just does not seem so random ... What's wrong with it? > > Is there perhaps a suggestion out there to create a more random int ...? What do you think the outp

Re: list comprehension

2006-01-24 Thread Duncan Booth
Patrick Maupin wrote: > Duncan Booth wrote: > >> I prefer writing an 'if' statement here, Bryan prefers 'get', that's >> just a choice of style. But 'setdefault' here, that has no style. > > Well, I'm often told I have no style, and I _did_ admit that it's an > abuse of setdefault. However, I o

Re: Creating a more random int?

2006-01-24 Thread Tim Chase
> I need to retrieve an integer from within a range ... this > works ... below is my out puts ... it just does not seem so > random ... > > Is there perhaps a suggestion out there to create a more > random int ...? I'm not sure how you determine that "it just does not seem so random"...I tried th

Re: Some thougts on cartesian products

2006-01-24 Thread Christoph Zwerschke
Bryan Olson wrote: > The claim "everything is a set" falls into the category of > 'not even wrong'. No, it falls into the category of the most fundamental Mathematical concepts. You actually *define* tuples as sets, or functions as sets or relations as sets, or even all kinds of numbers and ot

Re: Using non-ascii symbols

2006-01-24 Thread Christoph Zwerschke
Rocco Moretti schrieb: > My point still stands: _somewere_ along the way the rendering got messed > up for _some_ people - something that wouldn't have happened with the > <=, >= and != digraphs. Yes, but Python is already a bit handicapped concerning posting code anyway because of its signific

  1   2   >