Since 4/30/2012 1:09:49 AM, __peter__ has written 10 articles and participated in 3834 conversations. __peter__ signature: __peter__
__peter__'s articles:
Items(10) /1
Re: Creating formatted output using picture strings1730 (2/10/2010 9:45:37 AM) comp.lang.python python@bdurham.com wrote: > Does Python provide a way to format a string according to a > 'picture' format? > > For example, if I have a string '123456789' and want it formatted > like '(123)-45-(678)[9]', is... Peter
StopIteration in the if clause of a generator expression1624 (4/1/2005 10:04:11 AM) comp.lang.python To confuse a newbies and old hands alike, Bengt Richter wrote: > Need something more straightforward, e.g., a wrapped one-liner: > > >>> def guess(n=3): print ("You're right!", 'No more tries for > >>> you!... Peter
Fwd: [Python-Dev] Strawman decision: @decorator won't change1626 (9/16/2004 8:59:12 AM) comp.lang.python I took the freedom to forward GvR's mail concerning decorator cosmetics. I think you should know about it. Peter ---------- Forwarded Message ---------- Subject: [Python-Dev] Strawman decision: @decorator... Peter
decorator with keyword731 (8/12/2004 9:17:15 AM) comp.lang.python I'm sure they have been mentioned somewhere but here are some more advantages of a decorator keyword (I use "transform"): - The docstring can be moved to the top of the decorator suite. - Simple attributes tha... Peter
decorators, function signature, and help()121 (8/10/2004 12:15:18 PM) comp.lang.python After a week or so I'm finally getting accustomed to the pie-pre-def syntax. Consider a simple-minded decorator that doesn't care about the signature of the function it wraps: >>> def noisy(f): .... def g... Peter
Tkinter: closing a popup menu by clicking elsewhere028 (2/26/2004 11:19:01 AM) comp.lang.python How can I close a popup menu in Tkinter by clicking elsewhere on the toplevel window underneath? I tried popup.grab_set() but this causes the popup to close immediately. An alternative would be def hidepop... Peter
Tkinter: Clipping a canvas text item440 (2/21/2004 1:19:00 PM) comp.lang.python Is there a way to limit both width and height of a canvas text item? My current workaround seems clumsy: import Tkinter as tk root = tk.Tk() canvas = tk.Canvas(root, width=400, height=200, bg="white") canvas.p... Peter
Hiding/showing Tkinter.Canvas items244 (2/17/2004 8:20:30 AM) comp.lang.python Before I start moving them into dark corners of the canvas - is there a way to hide/show Tkinter canvas items without having to maintain their original position externally? All I've found so far is sortvisu.py ... Peter
Turning f(callback) into a generator630 (12/3/2003 5:48:41 PM) comp.lang.python It's easy to write a function that wraps a generator and provides a callback. E. g.: import os, sys def walk(path, visit): """ Emulate os.path.walk() (simplified) using os.walk()""" for dir, folders, ... Peter
Fast attribute/list item extraction038 (11/30/2003 10:45:14 AM) comp.lang.python There is currently a discussion on python-dev about an extract() function which offers fast access to list items and object attributes. It could serve, e. g., as the key argument of the future list.sort() metho... Peter
Please help with Threading50 (5/18/2013 8:58:13 AM) comp.lang.python This is my first script where I want to use the python threading module. I =
have a large dataset which is a list of dict this can be as much as 200 dic=
tionaries in the list. The final goal is a histogram ... debruinjj(6)
Fixing escaped characters python-xbee43 (4/24/2013 7:33:30 AM) comp.lang.python I am using a XBee to receive data from an arduino network.
But they have AP=2 which means escaped characters are used when a 11 or 13 appears (and some more...)
When this occurs, XBee sends 7D and inmedia... pabloblo85(2)
Guess the Number Repeat13 (4/25/2013 8:47:17 AM) comp.lang.python How do I make the following program play the 'guess the number game' twice?
import random
guessesTaken = 0
print('Hello! What is your name?')
myName = input()
number = random.randint(1, 20)
print('Well,... eschneider92(10)
File Read issue by using module binascii121 (4/27/2013 3:57:45 AM) comp.lang.python When I run the readbmp on an example.bmp(about 100k),the Shell is become to "No respose",when I change f.read() to f.read(1000),it is ok,could someone tell me the excat reason for this?
Thank you in advance!
... jimmie.he(14)
How do I encode and decode this data to write to a file?124 (4/29/2013 9:47:46 AM) comp.lang.python I am debugging some code that creates a static HTML gallery from a
directory hierarchy full of images. It's this package:-
https://pypi.python.org/pypi/Gallery2.py/2.0
It's basically working and does... cl9499(7)
python backup script172 (5/6/2013 7:01:06 PM) comp.lang.python I am trying to backup database on CentOS linux server,I'm getting error when running the following script. anyone can help?
#!/usr/bin/env python
import ConfigParser
import os
import time
config = Co... programmer.toronto(5)
formatted output22 (5/7/2013 12:00:21 PM) comp.lang.python Dear members,
I need to print few arrays in a tabular form for example below array IL has 25 elements, is there an easy way to print this as 5x5 comma separated table? in python
IL=[]
for i in ... sjo.India(13)
Diacretical incensitive search40 (5/17/2013 6:57:04 AM) comp.lang.python One feature that seems to be missing in the re module (or any tools that I =
know for searching text) is "diacretical incensitive search". I would like =
to have a match for something like this:
re.match("... diolu.remove_this_part(8)