I'm relatively new to Python, and I'm trying to get the hang of
using Python's subprocess module. As an exercise, I wrote the Tac
class below, which can prints output to a file "in reverse order",
by piping it through the Unix tac utility. (The idea is to delegate
the problem of managing the m
In Nobody
writes:
>You could always lift the code from Popen._communicate(), which uses
>threads for Windows and select() for POSIX.
Thanks. A lot of useful advice in your replies.
G.
--
http://mail.python.org/mailman/listinfo/python-list
In <0059c2b1$0$26930$c3e8...@news.astraweb.com> Steven D'Aprano
writes:
>But if you absolutely have to write to the program file...
No, don't have to, beyond the urge to satisfy a very idiosyncratic
aesthetic imperative...
>then append your
>data to the end of the file (as a comment) and late
The following fragment is from a tiny maintenance script that,
among other things, edits itself, by rewriting the line that ends
with '### REPLACE'.
##
import re
import fileinput
LAST_VERSION = 'VERSION 155' ### REPLACE
ser
In Luis Alberto Zarrabeitia
Gomez writes:
>¿Have you ever tried to read list/matrix that you know it is not sparse, but
>you
jdon't know the size, and it may not be in order? A "grow-able" array would just
>be the right thing to use - currently I have to settle with either hacking
>together my
Hi! I'm having a hard time figuring out how to handle a Unix
SIGPIPE exception cleanly. The following short script illustrates
the problem:
--
#!/usr/bin/python
# sigpipebug.py
import sys
import random
from signal import signal,
I'm hoping to get advice from anyone with prior experience setting
up a Python group.
A friend of mine and I have been trying to start a
scientific-programming-oriented Python group in our school (of
medecine and bio research), with not much success.
The main problem is attendance. Even thou
I'm getting a UnicodeEncodeError during a call to repr:
Traceback (most recent call last):
File "bug.py", line 142, in
element = parser.parse(INPUT)
File "bug.py", line 136, in parse
ps = Parser.Parse(open(filename,'r').read(), 1)
File "bug.py", line 97, in end_item
r = rep
In "Martin v. Loewis" writes:
>> Do I need to do something especial to get repr to work strictly
>> with unicode?
>Yes, you need to switch to Python 3 :-)
>> Or should __repr__ *always* return bytes rather than unicode?
>In Python 2.x: yes.
>> What about __str__ ?
>Likewise.
>> If both of
In a...@pythoncraft.com (Aahz) writes:
>In article , kj wrote:
>>
>>I'm looking for a Python-based, small, self-contained package to
>>hand out API keys, in the same spirit as Google API keys.
>>
>>The basic specs are simple: 1) enforce the "one key per customer" rule;
>>2) be robot-proof; 3) b
Hi everyone. I'm relatively new to Python, and could use your
feedback on the code below.
First some nomenclature. A "nucleotide" is one of A, C, G, T, or
U. (In practice, a sequence of such nucleotides never contains
both T and U, but this fact is not important in what follows.) A
"codon" i
Are there any Python-only modules or packages in the latest releases
of Python 2.x or Python 3.x that were largely written by Guido van
Rossum? What's the best way to find this out? I know that some
modules mention the author(s) in the source code, but this does
not seem to be true most of th
Before I roll my own, is there a good Python module for computing
the Fisher's exact test stastics on 2 x 2 contingency tables?
Many thanks in advance,
Gabe
--
http://mail.python.org/mailman/listinfo/python-list
I have a handy Python script, which takes a few command-line
arguments, and accepts a few options. I developed it on Unix, with
very much of a Unix-mindset. Some Windows-using colleagues have
asked me to make the script "easy to use under Windows 7". I.e.:
no command-line.
Therefore, I want
In gb345 writes:
>I have a handy Python script, which takes a few command-line
>arguments, and accepts a few options. I developed it on Unix, with
>very much of a Unix-mindset. Some Windows-using colleagues have
>asked me to make the script "easy to use under Windows 7&quo
In Tim Golden
writes:
>On 22/10/2010 15:25, gb345 wrote:
>> 3. Both versions of the app work fine on Windows 7, as long as
>> I do the following:
>>a. run CMD
>>b. cd to where the GUI script and my original script live
>>c. execute eith
For a project I'm working on I need a way to retrieve the source
code of dynamically generated Python functions. (These functions
are implemented dynamically in order to simulate "partial application"
in Python.[1]) The ultimate goal is to preserve a textual record
of transformations performed
In Peter Otten <__pete...@web.de> writes:
>gb345 wrote:
>> For a project I'm working on I need a way to retrieve the source
>> code of dynamically generated Python functions. (These functions
>> are implemented dynamically in order to simulate "partial app
18 matches
Mail list logo