Re: urllib.urlencode wrongly encoding ± character

2006-04-06 Thread sleytr
you are right. but when I capture traffic in firefox via livehttpheaders extension, it shows me that ± is encoded to %B1. Addition to that, I found lots of page about urlencoding they have a conversation tables or scripts. All of them defines ± as %B1 . realy confused? I can copy and use

Re: efficiency of range() and xrange() in for loops

2006-04-06 Thread Georg Brandl
Alan Morgan wrote: range is giving you a real list, while xrange is giving you an xrange object. Have you tried to slice an xrange object? Or using .append on it? No, I hadn't. I presume these could all be defined. How would xrange(100).remove(1) work? Georg --

Re: pre-PEP: The create statement

2006-04-06 Thread Paddy
I wonder if the resulting code would look like Python. It seems a great way to unify how things are defined, but I would not want to mix the syntax with the current style. - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Python Module for Determining CPU Freq. and Memory?

2006-04-06 Thread efrat
Hello, I'd like to determine at runtime the computer's CPU frequency and memory. Is there a module for these types of queries? platform.platform returns the computer's CPU name and type, but not its frequency; nor does it report how much memory the computer has. In the python help(), I

Python CGI problem: correct result, but incorrect browser response.

2006-04-06 Thread Sullivan WxPyQtKinter
title:Python CGI problem: correct result, but incorrect browser response. In one of my CGI program,named 'login.py', the script return a HEADER to web browser: Set-Cookie: sessionID=LAABUQLUCZIQJTZDWTFE; Set-Cookie: username=testuser; Status:302 Location:edit.py (blank line) but the IE prompted

Re: efficiency of range() and xrange() in for loops

2006-04-06 Thread Paddy
I wondered at the tone of some of the replies, re-read the repliess and your original message. On first readings ithought that your original message was OK and that the replies were a bit 'strong' . On second reading I thought that the original could be interpreted a little less nicely, but I had

RE: Python Module for Determining CPU Freq. and Memory?

2006-04-06 Thread Tim Golden
[efrat] |I'd like to determine at runtime the computer's CPU frequency and | memory. | | (Please note: I'm interested in hardware stuff, like how much | memory the | machine has; not how much free memory is available.) I don't know if there's a cross-platform solution for this. For

Handling IP addresses with SimpleXMLRPCServer.

2006-04-06 Thread Jose Carlos Balderas Alberico
Hello. I' m trying to use the client's IP address in a method defined inside the SimpleXMLRPCServer. Up till now I'm able to verify that the client's IP is an authorised one (I do this before calling the _dispatch method). I can redefine the _dispatch method extending the SimpleXMLRPCHandler

Re: Python Module for Determining CPU Freq. and Memory?

2006-04-06 Thread Ron Adam
efrat wrote: Hello, I'd like to determine at runtime the computer's CPU frequency and memory. Is there a module for these types of queries? platform.platform returns the computer's CPU name and type, but not its frequency; nor does it report how much memory the computer has. In the

Re: Convertion of Unicode to ASCII NIGHTMARE

2006-04-06 Thread Serge Orlov
Roger Binns wrote: Serge Orlov [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have an impression that handling/production of byte order marks is pretty clear: they are produced/consumed only by two codecs: utf-16 and utf-8-sig. What is not clear? Are you talking about the C

Re: Python Module for Determining CPU Freq. and Memory?

2006-04-06 Thread Michele Petrazzo
Tim Golden wrote: [efrat] |I'd like to determine at runtime the computer's CPU frequency and | memory. | | (Please note: I'm interested in hardware stuff, like how much | memory the | machine has; not how much free memory is available.) I don't know if there's a cross-platform

Re: pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
Steven Bethard wrote: The PEP is based on a suggestion [1]_ from Michele Simionato on the python-dev list. True, but I would also mention that the idea of the 'create' keyword come from Nick Coghlan: http://mail.python.org/pipermail/python-dev/2005-October/057531.html Michele Simionato

Re: urllib.urlencode wrongly encoding ± character

2006-04-06 Thread Serge Orlov
[EMAIL PROTECTED] wrote: you are right. but when I capture traffic in firefox via livehttpheaders extension, it shows me that ± is encoded to %B1. It depends on whether user entered url into address bar or clicked on submit button on a page. In the first case there were no standard how to deal

Re: pre-PEP: The create statement

2006-04-06 Thread bruno at modulix
Steven Bethard wrote: The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html PEP: XXX Title: The

debug CGI with complex forms

2006-04-06 Thread Sullivan WxPyQtKinter
When the form in one HTML is very complex with a lot of fields(input, button,radio,checkbox etc.), setting the environment is quite burdernsome, so I usually change the stdout and stderr of the submit processing script to a file object to see the output directly from that file. This just can do,

Re: Dice probability problem

2006-04-06 Thread Antoon Pardon
On 2006-04-05, Tomi Lindberg [EMAIL PROTECTED] wrote: Antoon Pardon wrote: def __rmul__(self, num): tp = num * [self] return reduce(operator.add, tp) sum3d6 = 3 * D(6) One basic question: is there any particular reason not to use __mul__ instead (that would allow me to use

Re: pre-PEP: The create statement

2006-04-06 Thread Serge Orlov
bruno at modulix wrote: Steven Bethard wrote: The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: [snip] Seems mostly clean. +1. That's what Trojans said when they saw a wooden horse at the gates of Troy ;) Serge. --

Re: pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
bruno at modulix wrote: Seems mostly clean. +1. (and I do prefer it with the 'create' statement - more explicit and readable than Michele's original proposition IMHO). Well, I do agree ;) Actually, Steven's original PEP draft was closer to my original proposal, but I suggested him to propose

malloc'ed PyTypeObject

2006-04-06 Thread Gabriel de Dietrich
Hi, I'm doing my first project on embedding and then extending Python in an application. The idea is to import a set of C++ plug-ins into Python and then be able to run a script that uses these plug-ins. Please note that what I'm importing into Python are the plug-in classes in order to be

Re: RELEASED Python 2.5 (alpha 1)

2006-04-06 Thread Michele Simionato
Michael Ekstrand wrote: Michele Simionato wrote: Michael Ekstrand wrote: After reading AMK's survey of what's new in Python 2.5, I am suitably impressed. As usual, I can't wait to start using the cool new features... extended generators? (mind is currently swimming with the question of

How to catch python's STDOUT

2006-04-06 Thread praveenkumar . 117
Hi, Can someone help me by suggesting how to capture python's STDOUT. I doesn't want the python's output to get displayed on the screen. -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib.urlencode wrongly encoding ± character

2006-04-06 Thread sleytr
I have no control over server side. I'm using Ubuntu Breezy at home and Ubuntu Dapper at work. Now I'm at work and same code working properly here! (returning %B1) I'm not sure and not checked yet but locale settings and/or installed Python version may be different between two computers. I

Re: How to catch python's STDOUT

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Can someone help me by suggesting how to capture python's STDOUT. I doesn't want the python's output to get displayed on the screen. you can replace sys.stdout (and/or sys.stderr) with your own file-like object, e.g. class NullStream: def

Re: How to catch python's STDOUT

2006-04-06 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: Can someone help me by suggesting how to capture python's STDOUT. I doesn't want the python's output to get displayed on the screen. python somescript.py /dev/null Sybren -- The problem with the world is stupidity. Not saying there should be a capital

Simple string formatting question

2006-04-06 Thread Steven D'Aprano
I have a sinking feeling I'm missing something really, really simple. I'm looking for a format string similar to '%.3f' except that trailing zeroes are not included. To give some examples: FloatString 1.0 1 1.1 1.1 12.1234 12.123 12.0001 12 and similar.

Re: The World's Most Maintainable Programming Language

2006-04-06 Thread Mirco Wahab
Hi Ralf Perl, named after Pearl Biggar (Larry Wall’s fiancée), His wife was Gloria since at least 1979, perl was published in 1987. This seems to be an insider joke (he wanted to call the language Gloria first, then pearl, then perl). Thanks for pointing this out ;-) This makes

Converting Integer to String

2006-04-06 Thread Jose Carlos Balderas Alberico
Hello. I'm trying to turn an integer into a string, and the repr function doesn't work the way I want. The repr function inserts a '\n' at the end of the string, and I need to get the string representation without the '\n', since I need to insert the stringed data into a sql query. I get SELECT

Re: Converting Integer to String

2006-04-06 Thread Jose Carlos Balderas Alberico
Thank you for the quick reply, but still doesn't work. Now it seems the \n is executed instead of printed. This is what I get when I print the query: SELECT * FROM blah WHERE (cod = 23 ) The code is being executed in an XMLRPC server. Maybe that's the problem? I don't know, but I don't get the

Re: How to catch python's STDOUT

2006-04-06 Thread praveenkumar . 117
HI, I am a member of comp.lang.python. I posted a message saying how to capture python's STDOUT. sorry i did not clearly mentioned the problem. I have python script in which i have some print statements. I dont want the outputs of print to be displayed on

Re: Converting Integer to String

2006-04-06 Thread Jose Carlos Balderas Alberico
That works just fine.Problem solved :) Thank you so much for your help Wesley Jose Carlos. 2006/4/6, Wesley Brooks [EMAIL PROTECTED]: ...or'%i' %546gives:'546' Wesley Brooks. On 06/04/06, Wesley Brooks [EMAIL PROTECTED] wrote: Jose Carlos,str(234) gives '234'Is that what your after?Wesley.

Re: urllib.urlencode wrongly encoding � character

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I think there should be way to encode ± to %B1 on any platform/locale combination. While searching for a real solution, I'm going to add a searchdestroy filter for %C2 on urlencoded dictionary as a workaround. Because my queries are constant and %C2 is the only

Re: How to catch python's STDOUT

2006-04-06 Thread Steven D'Aprano
[EMAIL PROTECTED] wrote: Hi, Can someone help me by suggesting how to capture python's STDOUT. I doesn't want the python's output to get displayed on the screen. import sys, StringIO SAVEOUT = sys.stdout capture = StringIO.StringIO() sys.stdout = capture print hello But

Re: How to catch python's STDOUT

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I have python script in which i have some print statements. I dont want the outputs of print to be displayed on the console since it is used my fellow-workers But i need those prints for debugging purpose So some how i want to

Using PythonWin32 to copy text to Windoze Clipboard for Unix-style random .sig rotator?

2006-04-06 Thread dananrg
Can you tell I miss Unix? I want to write a Python script that, when launched, will choose a random .sig (from a list of about 30 cool ones I've devised), and store the .sig text in the Windows Clipboard, so I can then paste it into any Windows application. This way, it'll work for Outlook

Re: How to catch python's STDOUT

2006-04-06 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I have python script in which i have some print statements. I dont want the outputs of print to be displayed on the console since it is used my fellow-workers But i need those prints for debugging purpose So some how i want to capture those prints can u

Re: Splitting a string with extra parameters

2006-04-06 Thread Fulvio
Alle 11:23, giovedì 06 aprile 2006, Chris P ha scritto: when splitting based on a delimiter of , the above string gets broken up in 5 columns instead of 4 due to the , in the money amount. There should be cvs package in the python directory. Why don't you try that way? Reading some help gives

Re: How to catch python's STDOUT

2006-04-06 Thread Sybren Stuvel
Fredrik Lundh enlightened us with: or you can use the logging module: http://docs.python.org/lib/module-logging.html I'd definitely do that. Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the

How to work with directories and files with spaces

2006-04-06 Thread s99999999s2003
hi I am working in unix and i have some directories names with spaces eg ABC DEF A how can i work effectively with spaces in directory/file names in python? sometimes when i do os.path.join(dir_with_spaces,-somestring ) , it gives me -somestring as the name only...without ABC DEF A it should

RE: Using PythonWin32 to copy text to Windoze Clipboard for Unix-stylerandom .sig rotator?

2006-04-06 Thread Tim Golden
[EMAIL PROTECTED] | | I want to write a Python script that, when launched, will choose a | random .sig (from a list of about 30 cool ones I've devised), | and store | the .sig text in the Windows Clipboard, so I can then paste | it into any | Windows application. Very quick and untested

Re: how to convert string

2006-04-06 Thread Fulvio
Alle 08:51, giovedì 06 aprile 2006, [EMAIL PROTECTED] ha scritto: for x in range(10): sys.stdout.write(x) sys.stdout.write( ) BTW, how to write a number repeatly in the same line and position, without let the printout to scroll down. F --

Re: urllib.urlencode wrongly encoding � character

2006-04-06 Thread Richard Brodie
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm obviously missing some context here, but encoding ± to %B1 on any platform is exactly what urlencode does: import urllib urllib.urlencode([(key, chr(0xb1))]) 'key=%B1' Yeah but you're cheating by using

Re: Using PythonWin32 to copy text to Windoze Clipboard for Unix-stylerandom .sig rotator?

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Can you tell I miss Unix? by your early-nineties spelling of Windows ? I want to write a Python script that, when launched, will choose a random .sig (from a list of about 30 cool ones I've devised), and store the .sig text in the Windows Clipboard, so I can then

how to touch a file

2006-04-06 Thread s99999999s2003
hi i have a dir that contains directories with names and spaces in between example rootdir | ABC DEF A | --- BDD SD N I wanted to touch a file with the same name as the directories inside each directory rootdir | ABC DEF A |--- ABC DEF A-dummy | ---

how to create file with spaces

2006-04-06 Thread s99999999s2003
hi i have a dir that contains directories with names and spaces in between example rootdir | ABC DEF A | --- BDD SD N I wanted to touch a file with the same name as the directories inside each directory rootdir | ABC DEF A |--- ABC DEF A-dummy | ---

Re: how to convert string

2006-04-06 Thread Fredrik Lundh
Fulvio [EMAIL PROTECTED] wrote: BTW, how to write a number repeatly in the same line and position, without let the printout to scroll down. for i in range(100): print \r, i, # do something print will work, as long as the message isn't too long, and you're printing to a

RE: Using PythonWin32 to copy text to Windoze Clipboard for Unix-stylerandom .sig rotator?

2006-04-06 Thread Ryan Ginstrom
On Behalf Of [EMAIL PROTECTED] I want to write a Python script that, when launched, will choose a random .sig (from a list of about 30 cool ones I've devised), and store the .sig text in the Windows Clipboard, so I can then paste it into any Windows application. You might try looking

Re: how to touch a file

2006-04-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: hi i have a dir that contains directories with names and spaces in between example rootdir | ABC DEF A | --- BDD SD N I wanted to touch a file with the same name as the directories inside each directory rootdir | ABC DEF A

Re: how to create file with spaces

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I wanted to touch a file with the same name as the directories inside each directory rootdir | ABC DEF A |--- ABC DEF A-dummy | --- BDD SD N |--- BDD SD N-dummy heres the code : for d in os.walk(rootdir):

Re: how to create file with spaces

2006-04-06 Thread Fredrik Lundh
try filename = dirpath + -dummy if not os.path.isfile(filename): open(filename, w).close() better make that basename = os.path.basename(dirpath) + -dummy filename = os.path.join(dirpath, basename) if not os.path.isfile(filename): open(filename, w).close()

Cleaning the current environment after a fork

2006-04-06 Thread Robin Haswell
Hey guys I want to fork a process, but my scope has lots of stuff that the child won't need. Is it possible to clean the current environment of cruft so it is collected and freed? Basically I want it to go something like this. This is my first forking Python app, by the way: # {{{ My app import

Re: IMPORTANT 2.5 API changes for C Extension Modules

2006-04-06 Thread konrad . hinsen
On 05.04.2006, at 08:44, [EMAIL PROTECTED] wrote: Python 2.5 alpha 1 is in the process of being released later today. There are important changes that are in 2.5 to support 64-bit systems. These changes can cause Python to crash if your module is not upgraded to support the changes. Python

Re: Cleaning the current environment after a fork

2006-04-06 Thread Diez B. Roggisch
I want to fork a process, but my scope has lots of stuff that the child won't need. Is it possible to clean the current environment of cruft so it is collected and freed? Basically I want it to go something like this. This is my first forking Python app, by the way: I'm not an expert of this

Re: IMPORTANT 2.5 API changes for C Extension Modules

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: One question: Is there a safe way to keep extension modules backward- compatible with older Python versions? absolutely. I am thinking of something like #ifndef PY_SSIZE_T_DEFINED typedef Py_ssize_t int; #endif assuming that Python 2.5 defines

Re: python on Mac

2006-04-06 Thread Lou Pecora
In article [EMAIL PROTECTED], James Stroud [EMAIL PROTECTED] wrote: Thomas Nelson wrote: I just purchased a new macbook (os 10.4.6), and I'm trying to install python 2.4 on it. I downloaded and ran the two installers recommended at http://www.python.org/download/mac/. Now I have IDLE,

Unicode, command-line and idle

2006-04-06 Thread a . serrano
Hello, the following program prompts the user for a word and tests to see if it is the same as another one. If the user types españa (note that the word contains an 'ñ'), the program should output same. This works if I run the code in IDLE but does not if I run it in the windows console. Can

Re: Unicode, command-line and idle

2006-04-06 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Hello, the following program prompts the user for a word and tests to see if it is the same as another one. If the user types españa (note that the word contains an 'ñ'), the program should output same. This works if I run the code in IDLE but does not if I run it in

Re: how to convert string

2006-04-06 Thread Fulvio
Alle 18:21, giovedì 06 aprile 2006, Fredrik Lundh ha scritto: will work, as long as the message isn't too long I was trying some print\b\b\b\b, i, For a number of 4 digit, but I think I miscalculated some lenght variation. The reason of this is because it won't leave previous printing.

Re: how to create file with spaces

2006-04-06 Thread Fulvio
Alle 18:18, giovedì 06 aprile 2006, [EMAIL PROTECTED] ha scritto: How can i deal with spaces in this case? I don't have an idea with python, but if can help I may say that bash you might use \ to escape a space or use a quoted full path. The shell program basename is failing, anyhow with file

Re: Splitting a string with extra parameters

2006-04-06 Thread Amit Khemka
I guess you should use re module ... In this case re.split(\D,\D, YOUR_STRING) should work. (splits only when , is between two non-digits). for details and more options see python-docs. cheers, amit. On 4/6/06, Fulvio [EMAIL PROTECTED] wrote: Alle 11:23, giovedì 06 aprile 2006, Chris P ha

How to change the docs - a case study

2006-04-06 Thread Kent Johnson
There has been a lot of discussion here recently about making changes to the docs, and what new system should be in place, etc., wiki, etc. I occasionally chime in with a note that it's pretty easy to submit a doc patch through SourceForge and they are often accepted quickly. The point being

Re: Splitting a string with extra parameters

2006-04-06 Thread Andrew Gwozdziewycz
On Apr 6, 2006, at 7:38 AM, Amit Khemka wrote: I guess you should use re module ... In this case re.split(\D,\D, YOUR_STRING) should work. (splits only when , is between two non-digits). This works assuming all line elements are quoted. This would fail if (and this too my knowledge is

shelve and .bak .dat .dir files

2006-04-06 Thread Michele Petrazzo
Hi, I'm trying a script on a debian 3.1 that has problems on shelve library. The same script work well on a fedora 2 and I don't know why it create this problem on debian: #extract from my code import shelve class XX: def __init__(self): self._data = shelve.open(/tmp/myfile) # do the

Re: How to work with directories and files with spaces

2006-04-06 Thread Michele Petrazzo
[EMAIL PROTECTED] wrote: hi I am working in unix and i have some directories names with spaces eg ABC DEF A how can i work effectively with spaces in directory/file names in python? Like you can do with unix: michele:~$ echo Michele my\ name michele:~$ python Python 2.3.5 (#2, May 4

Re: pre-PEP: The create statement

2006-04-06 Thread bruno at modulix
Serge Orlov wrote: bruno at modulix wrote: Steven Bethard wrote: The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: [snip] Seems mostly clean. +1. That's what Trojans said when they saw a wooden horse at the gates of Troy

Re: Simple string formatting question

2006-04-06 Thread Ben Finney
Steven D'Aprano [EMAIL PROTECTED] writes: I have a sinking feeling I'm missing something really, really simple. Oh no, everyone in the galaxy gets that, that's perfectly natural paranoia. I'm looking for a format string similar to '%.3f' except that trailing zeroes are not included. Can;t

[ANNOUNCE] OpenRTS 0.2b2 released

2006-04-06 Thread Andreas R.
OpenRTS is a cross-platform open source real-time strategy game developed in Python. Now version 0.2b2 has been released. The new release uses the Twisted networking library for multi-player games, and has graphics from the Hard Vacuum project. The game can be downloaded from

An interview with Michael Foord, aka Fuzzyman on Python411

2006-04-06 Thread UrsusMaximus
www.awaretek.com/python/index.html features a Python411 interview with Michael Foord, aka Fuzzyman, Python hacker who has contributed a disproportionate amount and quality of open source projects, applications, tools, tutorials, Pyzine articles, and more in his mere 3 years in the community. This

Re: Unicode, command-line and idle

2006-04-06 Thread M�ta-MCI
(just for confirm) Hi! if the console is in cp1252, raw_input work OK with ñ This (your) script : # -*- coding: cp1252 -*- import sys text1 = u'españa' text2 = unicode(raw_input(), sys.stdin.encoding) if text1 == text2: print 'same' else: print 'not same' work OK with chcp 850

Re: How to change the docs - a case study

2006-04-06 Thread Fredrik Lundh
Kent Johnson wrote: Here is an example. This morning I noticed a minor discrepancy in the docs for the 'rot13' encoding. I posted a bug to SourceForge at 10:05 GMT. At 10:59 someone commented that maybe the code was broken rather than the docs. At 11:18 another poster responded that the code

Re: pre-PEP: The create statement

2006-04-06 Thread Michael Ekstrand
Carl Banks wrote: That's probably even more readable than class A, if not as familiar. My biggest concern with this is the special arguments of the caller. It breaks my heart that we couldn't do something like this: create dict keymap: A = 1 B = 2 Why couldn't you? Maybe I'm not

Re: Simple string formatting question

2006-04-06 Thread Fredrik Lundh
Steven D'Aprano wrote: Here is a (quick and dirty) reference implementation: def format(f, width=3): fs = '%%.%df' % width s = fs % f return s.rstrip('0').rstrip('.') Is there a way of getting the same result with just a single string format expression? not with % itself,

Pyexcelerator

2006-04-06 Thread Jens Kabella
Hi, i have a question with the pyexcelerator Modul. I´m using the Version 0.6.3a. Now I want to know how I can change the Colour Palette of Excel. I want to have my own colours for pattern_fore_colour and things like this. I want to build the colours dynamically. I have the RGB values for the

Re: output formatting for user-defined types

2006-04-06 Thread Peter Hansen
Russ wrote: Thanks, but that is not acceptable for my application. Any other ideas? Yeah, how about we read your mind or make wild guesses about why it's not acceptable, and about what your requirements really are. Really, your response seems a little bizarre to me, given that __float__ is

Re: pre-PEP: The create statement

2006-04-06 Thread Michael Ekstrand
Steven Bethard wrote: The PEP below should be mostly self explanatory. I'll try to keep the most updated versions available at: http://ucsu.colorado.edu/~bethard/py/pep_create_statement.txt http://ucsu.colorado.edu/~bethard/py/pep_create_statement.html PEP: XXX Title: The

Re: ``pickling'' and ``unpickling''

2006-04-06 Thread Roy Smith
In article [EMAIL PROTECTED], Lonnie Princehouse [EMAIL PROTECTED] wrote: Pickling is the Python term for serialization. See http://en.wikipedia.org/wiki/Serialization Suppose you want to save a Python object x to a file... output_file = open('my_pickle', 'wb') # open a file import

Re: The World's Most Maintainable Programming Language

2006-04-06 Thread Peter Hansen
Mirco Wahab wrote: Hi Ralf So we should rename Python into Cottonmouth to get more attention. No, always take some word that relates to something more or less 'feminine', its about 96% of young males who sit hours on programming over their beloved 'languages' ;-) Pythia?

Re: Counting all permutations of a substring

2006-04-06 Thread Chris Lasher
Great suggestions, guys! Thanks so much! And yes, I stand corrected. A better suited subject title would have been Counting all overlapping substrings. Thanks again, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple string formatting question

2006-04-06 Thread Paul McGuire
Fredrik Lundh [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Steven D'Aprano wrote: Here is a (quick and dirty) reference implementation: def format(f, width=3): fs = '%%.%df' % width s = fs % f return s.rstrip('0').rstrip('.') Is there a way of getting the

RE: The World's Most Maintainable Programming Language

2006-04-06 Thread Michael Yanowitz
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Peter Hansen Sent: Thursday, April 06, 2006 8:47 AM To: python-list@python.org Subject: Re: The World's Most Maintainable Programming Language Mirco Wahab wrote: Hi Ralf So we should rename Python into

Re: ``pickling'' and ``unpickling''

2006-04-06 Thread Peter Hansen
[EMAIL PROTECTED] wrote: Hi, I am new in Python World.I want to know what is mean by ``pickling'' and ``unpickling'' ? And how can we used it?Please Give Me some links of Picking Examples. Thanks You can generally answer such questions yourself by heading to docs.python.org and typing

Re: urllib.urlencode wrongly encoding ± character

2006-04-06 Thread Evren Esat Ozkan
when I remove # -*- coding: utf-8 -*- line from start of the script it worked properly. So I moved variable decleration to another file and imported than it worked too. Now it's working but I dont understand what I'm doing wrong? I'm new to Python and unicode encoding. I'm tried

BIOCHIP --- NO GOOD !!

2006-04-06 Thread okay
Hello, http://www.av1611.org/666/biochip.html To Archbishop Christodoulos Paraskevaides of the Greek Orthodox Church in Athens and Greece Archbishop, I talked with a Greek Orthodox believer in Australia and he told me two things of interest in these last days, as we see it this day even. They

Re: pre-PEP: The create statement

2006-04-06 Thread Tim N. van der Leeuw
From what I read here it would make a huge useability improvement for properties, and for that alone I would vote this a +1 if I were given the right to vote. Could this still make it in Python 2.5 even? If it's pushed hard enough? I don't know if this has been discussed on the python-dev mailing

help with designing an app. based on ConfigParser

2006-04-06 Thread Alexandre CONRAD
Hello list ! I'm using the ConfigParser module to use configuration files (what else would it be for ?). But I have a dilema: I'd like to setup multiple update server for my application with update priority. At first, I thought about adding a new section in my actual existing config file such

Re: pre-PEP: The create statement

2006-04-06 Thread Kay Schluehr
Steven Bethard wrote: Python-Version: 2.6 Have you a rough estimation how many modules will be broken when create is introduced as a keyword? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to catch python's STDOUT

2006-04-06 Thread Peter Hansen
Steven D'Aprano wrote: import sys, StringIO SAVEOUT = sys.stdout capture = StringIO.StringIO() sys.stdout = capture print hello But be warned, I've had difficulty restoring stdout afterwards, and needed to exit the interactive interpreter to get things back to normal. If

Re: How to change the docs - a case study

2006-04-06 Thread Kent Johnson
Fredrik Lundh wrote: Kent Johnson wrote: Here is an example. This morning I noticed a minor discrepancy in the docs for the 'rot13' encoding. I posted a bug to SourceForge at 10:05 GMT. At 10:59 someone commented that maybe the code was broken rather than the docs. At 11:18 another poster

GUI issues in Python

2006-04-06 Thread diffuser78
Hi, I want to create a GUI where a user can select drag and drop kind of boxes, circles and make connections between them. This is basically for depicting states and dependencies. I am writing a program where I let the user input states and dependencies in a certain domain. Based on input given

Re: urllib.urlencode wrongly encoding ± character

2006-04-06 Thread Evren Esat Ozkan
I'm just discovered that I don't have to remove that line, just change utf-8 to iso-8859-9 and it worked again. But I want to use utf-8. Please advise... -- http://mail.python.org/mailman/listinfo/python-list

Re: help with designing an app. based on ConfigParser

2006-04-06 Thread Fredrik Lundh
Alexandre CONRAD wrote: But now, how do I hold multiple servers ? In this case, I thought about having multiple sections such as [SERVER 01] [SERVER 02] [SERVER 03] But it's not very efficient when I want to parse the WHOLE config file to find which servers are available and

Re: GUI issues in Python

2006-04-06 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: Hi, I want to create a GUI where a user can select drag and drop kind of boxes, circles and make connections between them. This is basically for depicting states and dependencies. I am writing a program where I let the user input states and dependencies in a

Re: shelve and .bak .dat .dir files

2006-04-06 Thread Sion Arrowsmith
Michele Petrazzo [EMAIL PROTECTED] wrote: I'm trying a script on a debian 3.1 that has problems on shelve library. The same script work well on a fedora 2 and I don't know why it create this problem on debian: [ ... ] Now I see that shelve create not my file, but three files that has the name

Re: HTMLParser fragility

2006-04-06 Thread Walter Dörwald
Rene Pijlman wrote: Lawrence D'Oliveiro: I've been using HTMLParser to scrape Web sites. The trouble with this is, there's a lot of malformed HTML out there. Real browsers have to be written to cope gracefully with this, but HTMLParser does not. There are two solutions to this: 1.

Re: pre-PEP: The create statement

2006-04-06 Thread Michele Simionato
Kay Schluehr wrote: Steven Bethard wrote: Python-Version: 2.6 Have you a rough estimation how many modules will be broken when create is introduced as a keyword? This is a very relevant question. I would expect the new keyword would break lots of modules. However measuring is better than

Re: GUI issues in Python

2006-04-06 Thread diffuser78
My question basically revolves around... that I dont want to draw circles and boxes for drawing purposes. I want the end user to be able to draw the GUI boxes and circles and makes connection to depict states and dependencies. So its a little unconventional and more like a SIMULATION TOOL. I am

Re: Counting all permutations of a substring

2006-04-06 Thread Azolex
I wrote: [counting all (possibly overlapping) occurences of a substring in a string] def count_subs(s,subs,pos=0) : pos = 1+s.find(subs,pos) return pos and 1+count_subs(s,subs,pos) . now to push lisp-style to the extreme,

Re: python on Mac

2006-04-06 Thread gene tani
Lou Pecora wrote: YIKES! Don't do that. Don't mess with Apple's python. Not recommended. Check the MacPython FAQ and Wiki pages. Python 2.4 was installed in /usr/local/bin. You should put that in your $PATH variable Before /usr/bin. That will cause the new Python to be launched.

python411 podcast -- problem with the 'modules' podcast?

2006-04-06 Thread John Salerno
Not sure if you guys follow along with the podcast, but if you do, has anyone else had problems listening to the Modules podcast? On my iPod, it stops at 8 minutes, and in iTunes it stretches out across the full 17-19 minutes, but the contents are still just the first 8 minutes (meaning that

Re: pre-PEP: The create statement

2006-04-06 Thread Steven Bethard
Michael Ekstrand wrote: Something it could be useful to try to add, if possible: So far, it seems that this create block can only create class-like things (objects with a name, potentially bases, and a namespace). Is there a natural way to extend this to other things, so that function creation

Re: python411 podcast -- problem with the 'modules' podcast?

2006-04-06 Thread UrsusMaximus
John, I'll go back and look intoi this tonight on the Modules Podcast. Sometimes, the problems are specific to a given user's equipmentn, and I don't always know how to fix them, which is frustrating. But, maybe there is a problem I can fix with that podcast. I'll let you know ton=ight after I

  1   2   3   >