I have been trying for several weeks now to write a program that allows
me to read the stdout of a process that I spawn and once I receive
feedback, act appropriately.
More specifically, I need to create an SSH tunnel using plink on
Windows XP. Once the tunnel is successfully created, then I need
BroLewis wrote:
I have been trying for several weeks now to write a program that
allows me to read the stdout of a process that I spawn and once
I receive feedback, act appropriately.
Have you looked into the 'commands' module?
Cheers,
--
Klaus Alexander Seistrup
Copenhagen, Denmark
Mardy wrote:
Hi,
I've built a small project (http://eligante.sf.net) which I'm actually
trying to package using distutils.
...
However, I don't know if this directory layout is suitable for
site-packages, since at a first glance it looks to me that datafiles might
not be welcome under it.
commands is Unix only. This is Windows specific
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
thanks for that. But this will check for the exact content of the
start of block.. or end of block. How about if the content is
anywhere in the line?
Then the test is 'start of block. in line'. You could also use
the line.find or line.index methods, but those
[EMAIL PROTECTED] wrote:
Sorry Peter,
Try this
import unittest
import Numeric
class myTest(unittest.TestCase):
def runTest(self):
var1 = Numeric.array([1,22])
var2 = Numeric.array([1,33])
self.assertEqual(var1,var2)
if __name__ == '__main__':
In article [EMAIL PROTECTED],
Jeffrey Schwab [EMAIL PROTECTED] wrote:
...
Yes it is. Memory is only one type of resource. There are still files
and sockets to close, pipes to flush, log messages to be printed, GDI
contexts to free, locks to release, etc. In C++, these things are
Hi!
Let down subprocess, and remember popen4.
Here, an example (with CMD, under w-XP) :
import os
def lcmd(lst=None):
a = os.popen4(lst[0])
for i in lst[1:]:
if i!='':
a[0].write(i+'\r\n')
a[0].flush()
return a[1].readlines()
l=[
'CMD /K',
'DIR
Donn Cave wrote:
In article [EMAIL PROTECTED],
Jeffrey Schwab [EMAIL PROTECTED] wrote:
Yes it is. Memory is only one type of resource. There are still files
and sockets to close, pipes to flush, log messages to be printed, GDI
contexts to free, locks to release, etc. In C++, these
Philippe C. Martin wrote:
My mistake: The makefile (as written in the readme!) looks for bzip 1.0.2
PS: since bzip.org does not have 1.0.2 source anymore, can I just rename
1.0.3 ?
That should work; alternatively, you can change the project file.
Regards,
Martin
--
Xiao Jianfeng wrote:
self.assertEquals(result, expected)
AssertionError: '-0' != '0'
Can somebody tell me what's the problem ?
It looks like there is some minor bug in the floating
point libraries of your operating system: Python expects
that the strings for both numbers are the same in the
I tried the solutions you provided..these are not as robust as i
thought would be...
may be i should put the problem more clearly...
here it goes
I have a bunch of documents and each document has a header which is
common to all files. I read each file process it and compute the
frequency of
Tom Anderson wrote:
If you program threads with shared nothing and communication over Queues
you are, in effect, using processes. If all you share is read-only
memory, similarly, you are doing easy stuff and can get away with it.
In all other cases you need to know things like which
Fredrik Lundh wrote:
I'll repeat this one last time: for the use cases presented by Zwerschke
and bonono, using a list as the master data structure, and creating the
dictionary on demand, is a lot faster than using a ready-made ordered
dict implementation. if you will access things via the
I have an application that needs to create and delete
records in a Berkeley DB version 1.85 database.
If I use the bsdddb185 module I dont see any
of the record manipulation methods in there that
are available in the newer bsddb module.
(put(), get(), pop() etc)
I know the docs say that one
I needed to generate some C code for a fast lookup table using
piecewise-cubic interpolation. If anybody else needs this, the Python
code for it is at http://tinyurl.com/92zcs (alt.source, Google Groups).
Will Ware
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 21 Nov 2005 19:47:45 +0100, Diez B. Roggisch wrote:
The idea is that otherwise e.g. cat and hippopothamus have a
l-distance of only 3, which one would consider good at the first look.
???
I make it that the L-distance between cat and hippopothamus is twelve, not
three. With
Does anyone know how to set modal to True for Gtk::FileChooserDialog?
Thanks
Thierry
--
http://mail.python.org/mailman/listinfo/python-list
Thanks,
Regards,
Philippe
Martin v. Löwis wrote:
Philippe C. Martin wrote:
My mistake: The makefile (as written in the readme!) looks for bzip 1.0.2
PS: since bzip.org does not have 1.0.2 source anymore, can I just rename
1.0.3 ?
That should work; alternatively, you can change the
javuchi wrote:
I'm searching for a library which makes aproximative string matching,
for example, searching in a dictionary the word motorcycle, but
returns similar strings like motorcicle.
Is there such a library?
Perhaps the get_close_matches function that is presentt in the standard
Paul Watson wrote:
My desire to have the code distributed through a web page is just to
ensure that the user is running the correct version and has not hacked
it in any way. I suppose I can checksum the local client application
and compare it with what is on the server. Then, make a way
Hi,
I am attemtping to package Python in a U3 install program for Windows.
I got Python to compile/link and prior to adding the necessary code for the
U3 SDK registration, I would like to know where I can find the actual list
of files needed for a minimum installation (are DLLs and libs enough
What I am trying to do is call perl on the command line. Also, do any
of these functions return the data recievved from the command?
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 21 Nov 2005, Tom Anderson wrote:
On Sun, 20 Nov 2005, Warren Francis wrote:
Basically, I'd like to specify a curved path of an object through space. 3D
space would be wonderful, but I could jimmy-rig something if I could just
get 2D... Are bezier curves really what I want after
On Mon, 21 Nov 2005 10:35:20 +0200, Sinan Nalkaya [EMAIL PROTECTED] wrote:
Dennis Lee Bieber wrote:
On Fri, 18 Nov 2005 22:45:37 -0500, Peter Hansen [EMAIL PROTECTED]
declaimed the following in comp.lang.python:
It's quite unclear whether the last part, above, is one of your
Ben Finney [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Xiao Jianfeng [EMAIL PROTECTED] wrote:
I need to print a long sting, which is two long so it must expand
two lines.
How is this string being constructed in the source? If it exists as a
single long string, why must it be
On 20 Nov 2005 12:00:02 -0800, amfr [EMAIL PROTECTED] wrote:
Hoe would I call something on the command line from python, e.g. ls
-la?
Depends on how much control you want over where the output goes.
If you want the result as a multi-line string formatted the way
the system utility (ls here)
On 20 Nov 2005 21:12:52 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Bengt Richter wrote:
On Sun, 20 Nov 2005 22:03:34 +0100, Christoph Zwerschke [EMAIL PROTECTED]
wrote:
Ordering the keys isn't the normal case, and can be done easily when
needed.
That depends. Maybe I do not want
On 11/17/05, Shi Mu [EMAIL PROTECTED] wrote:
why subtract 1 from max_y - original_y?
Because in the computer science world we like starting to count at 0.
image_size = 1000
original_y = 25 # Really the 26th pixel line.
new_y = 1000 - 25 - 1 # 26 pixels from the bottom of the screen.
--
Steve
On Mon, 21 Nov 2005 01:27:22 +0100, Christoph Zwerschke [EMAIL PROTECTED]
wrote:
Fredrik Lundh wrote:
if you restructure the list somewhat
d = (
('pid', ('Employee ID', 'int')),
('name', ('Employee name', 'varchar')),
('sal', ('Salary', 'float'))
)
you
On Mon, 21 Nov 2005 15:23:20 +1100, Steven D'Aprano [EMAIL PROTECTED] wrote:
David (Alan) Isaac wrote:
What's the good way to produce a cumulative sum?
E.g., given the list x,
cumx = x[:]
for i in range(1,len(x)):
cumx[i] = cumx[i]+cumx[i-1]
What's the better way?
Is there something
On 20 Nov 2005 20:34:39 -0800, Alex [EMAIL PROTECTED] wrote:
I apologize for asking maybe a very trivial question.
I have a new class object A with slots. One of the slots is, for
example, object spam. Object spam, in turn, also has slots and one of
them is attribute eggs. I need to assign a new
On 21 Nov 2005 01:54:38 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Fredrik Lundh wrote:
[EMAIL PROTECTED] wrote:
If I need the dict feature 90% of the time, and the list feature 10% of
the time.
Wasn't your use case that you wanted to specify form fields in
a given order (LIST),
Hi Magnus,
thanks a lot for your posting, you made me clear several things.
However, there something I still want to discuss:
Le die Mon, 21 Nov 2005 20:08:24 +0100, Magnus Lycka ha scribite:
[...]
In an apache cgi-bin directory: The main Python CGI script(s) that are
called by the web
Hi Steven,
Le die Mon, 21 Nov 2005 11:37:37 -0700, Steven Bethard ha scribite:
[...]
In the basic situation, where the instance is created in the same
module
as the class, I can figure out 'mod' and 'name' like::
cls = type(self)
name = cls.__module__
mod =
Thanks for your help. Another question, is there an built in md5/sha1
function in python?
--
http://mail.python.org/mailman/listinfo/python-list
Thanks, all I wanted to know where the post data was stored from the
request
--
http://mail.python.org/mailman/listinfo/python-list
amfr wrote:
Thanks for your help. Another question, is there an built in md5/sha1
function in python?
Yes.
Although it's a long list, it is worthwhile as a newbie for one to
peruse the list of standard modules from time to time, until you gain a
familiarity with what is there.
Christoph Zwerschke [EMAIL PROTECTED] wrote:
...
But I think the following rule is natural enough to consider it as THE
standard behavior of ordered dictionaries:
Insertion: If the key exists: Don't change the order. If it does not
exist: Append it to the sequence of keys. Deletion:
If I found the right U3 when I googled, then maybe this is relevant:
http://www.voidspace.org.uk/python/movpy/
Jeff
pgp1AjuUdEskN.pgp
Description: PGP signature
--
http://mail.python.org/mailman/listinfo/python-list
Hello, I'm new to python and trying to get records from an MSAccess
database using mxODBC. It works, but the output is not formatted the
way I want it.
Here's the script:
import mx.ODBC.Windows as odbc
driv='DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:/Access
Databases/Quotations2005'
conn
Wordpress.com blog will eat up the spaces before a line,
just as it will trim every line of my article. So I can't paste python code indentedly.
Does any one use wordpress blog here?
Please tell me how to leave the sapces as they are when publishing ariticles on the blog,
Thank you.
--
The Bezier gives control points with natural interpretations and a
nice within the convex hull property. I happen to like Beziers to
control curves which are aestheticly, rather than computationally
defined.
--
-Scott David Daniels
[EMAIL PROTECTED]
--
BartlebyScrivener wrote:
Hello, I'm new to python and trying to get records from an MSAccess
database using mxODBC. It works, but the output is not formatted the
way I want it.
Here's the script:
import mx.ODBC.Windows as odbc
driv='DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:/Access
mxODBC implements the Python DB-API spec, which states that each row
of query results is returned as a tuple. If you want the data
displayed differently, you can do it yourself.
for row in rows:
print \t.join(row)
should do it.
--
http://mail.python.org/mailman/listinfo/python-list
On Nov 21, 2005, at 8:17 PM, could ildg wrote:
Wordpress.com blog will eat up the spaces before a line,
just as it will trim every line of my article. So I can't paste
python code indentedly.
Does any one use wordpress blog here?
Please tell me how to leave the sapces as they are when
Is there any way to have one program run another arbitrary program
with input from stdin and display the output as if you had run it in
a shell (i.e., you'd see some of the output followed by the input
they typed in and then a newline because they pressed return followed
by subsequent
Works!!
Thank you all so much. I didn't know it was coming back as a tuple, and
I'm sure that would have taken me four hours to figure out.
Appreciate it!
bs
Chris Curvey wrote:
mxODBC implements the Python DB-API spec, which states that each row
of query results is returned as a
On 11/22/05, Paul McGuire [EMAIL PROTECTED] wrote:
Or for a large literal string:lots of text hundreds of characters long
more text on another line but we really don't want any line breaksin our final stringso we replace newlines in this multiline stringwith an empty string thus.replace('\n','')--
Peter Hansen wrote:
Okay, granted. I guess this is the same as in any other case of
deprecation (e.g. some people still have to work with code that uses
apply() or string module methods).
Yup, this is exactly what will have to happen. Most or all of os.path
and maybe some of
Fredrik Lundh wrote:
Steven D'Aprano wrote:
Alas and alack, I have to write code which is backwards
compatible with older versions of Python:
[snip]
What should I do when I can't rely on functions that
don't exist in older versions of Python?
python 2.1 doesn't support iterators, so
Is there a way to instruct Python to import modules from standard
library even if there is one with the same name in the current working
directory? I was trying to import BaseHTTPServer.py from standard
library but was prevented by a python file with the same name in
current working directory (but
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] wrote:
Is there a way to instruct Python to import modules from standard
library even if there is one with the same name in the current working
directory? I was trying to import BaseHTTPServer.py from standard
library but was prevented by a
Steven D'Aprano [EMAIL PROTECTED] wrote:
...
In the specific case of iter(), are there good
alternative ways of detecting an iterable without
consuming it?
Not a problem I've had often, but when I did, if I recall correctly, I
did something like:
try:
iter
except NameError:
def
Great, thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
I'm attempting to develop a plugin framework for an application that I'm
working on. I wish to develop something in which all plugins exist in a
directory tree. The framework need only be given the root of the tree. The
framework then uses os.path.walk to search all for all files
Is there any way to access the RFC 3542 defined macros such as
ICMP6_FILTER_SETPASSALL() from within the socket module? A dir() on the
socket module (Python 2.4.1, built on a solaris box with IPv6 support)
doesn't show anything that looks like it (and socket.has_ipv6 is True).
--
Jeffrey Schwab [EMAIL PROTECTED] wrote:
...
You may be gratified to learn that Python's main storage model
is reference counted objects, and when an object falls out of
all referenced scopes its finalizers run immediately.
Thanks, that's good to know! For some reason I had it in my
Hi,
I'm having some trouble linking one extension module to another because
the linker expects a lib prefix and my python modules cannot have
this prefix.
I found two ways of doing it on a linux box (either symlink or create a
dummy .so that links to extension module) but I can get neither of
thakadu wrote:
So it seems I am forced to use the bsddb185 module
which does not have convenient record level methods.
Am I missing something here or have others eperienced
tha same?
I think you are missing that bsddb185 implements the
dictionary interface. So you can use [key] to access
the
Thank you~It works!but how can paste and , please?these 2 symbols will also confuse wordpress and I can't publish what I want.On 11/22/05,
Dan Lowe [EMAIL PROTECTED] wrote:
On Nov 21, 2005, at 8:17 PM, could ildg wrote: Wordpress.com blog will eat up the spaces before a line, just as it will
hi,
i am trying to develop a small gui app using boa constructor. say this
app has one frame which has one static text control. i want the frame
to resize itself to the width of the text contrl when i change the
label of the text control via SetLabel(). how can i do this in boa
constructor?
can
I run the following code and got wrong message, but I still want to
make [1,2],[4,3] and [6,9]
to be keys of the dictionary or change the style a little bit. How to do that?
Thanks!
p=[[1,2],[4,3],[6,9]]
n=dict([(x,[]) for x in p])
Traceback (most recent call last):
File interactive input,
Roy Smith wrote:
Is there any way to access the RFC 3542 defined macros such as
ICMP6_FILTER_SETPASSALL() from within the socket module?
No. Not sure it would belong into the socket module, though:
an icmp module could be developed independently from the socket
module if needed.
Regards,
Simon Burton wrote:
I'm having some trouble linking one extension module to another because
the linker expects a lib prefix and my python modules cannot have
this prefix.
This is a Good Thing (tm) :-) Don't link extension modules to each
other; this is really asking for trouble. Instead, come
Shi Mu wrote:
I run the following code and got wrong message, but I still want to
make [1,2],[4,3] and [6,9] to be keys of the dictionary or change the
style a little bit. How to do that?
Make them tuples:
p=[[1,2],[4,3],[6,9]]
n=dict([(tuple(x),[]) for x in p])
n
{(6, 9): [], (1, 2):
Alex Martelli wrote:
Consuming didn't really come into consideration for the
backwards compatibility part because only objects indexable with
integers, 0 and up (and raising IndexError at some point) were usable in
for statements in old Pythons, there was no consuming.
Ah yes, of course. How
Has anyone found a way besides not deriving from dict?
Shouldn't there be a way?
TIA
(need this for what I hope is an improvement on the Larosa/Foord OrderedDict ;-)
I guess I can just document that you have to spell it dict(d.items()), but I'd
like to hide the internal shenanigans ;-)
Regards,
On Nov 22, 2005, at 12:30 AM, could ildg wrote:
Thank you~
It works!
but how can paste and , please?
these 2 symbols will also confuse wordpress and I can't publish
what I want.
Replace with lt;
Replace with gt;
(where those abbreviations stand for less than and greater than)
On Mon, 21 Nov 2005 19:39:42 -0500, Peter Hansen [EMAIL PROTECTED] wrote:
amfr wrote:
Thanks for your help. Another question, is there an built in md5/sha1
function in python?
Yes.
Although it's a long list, it is worthwhile as a newbie for one to
peruse the list of standard modules from
There is the BayPiggies user group: [EMAIL PROTECTED] It meets
monthly alternating between Mt. VIew (Google) and San Bruno (IronPort).
n
--
bruce wrote:
hey...
i'm looking for classes (advanced) in python/php in the bay area as well...
actually i'm looking for the students/teachers/profs
http://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm
has a Python example implementation of qubic Bezier curves available.
Claudio
Warren Francis [EMAIL PROTECTED] schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
I'm fairly new to Python (2-3 months) and I'm trying to figure out a
simple
way
Thank you very much Dan.I settle the problem according to you tips.On 11/22/05, Dan Lowe [EMAIL PROTECTED]
wrote:On Nov 22, 2005, at 12:30 AM, could ildg wrote: Thank you~
It works! but how can paste and , please? these 2 symbols will also confuse wordpress and I can't publish what I
http://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm
has a Python example implementation of qubic Bezier curves available.
Here my port to Tkinter (doesn't need PIL)
from Tkinter import *
master = Tk()
objTkCanvas = Canvas(master, width=110, height=180)
objTkCanvas.pack()
def midpoint((x1,
Alex Martelli wrote:
In the specific case of iter(), are there good
alternative ways of detecting an iterable without
consuming it?
Not a problem I've had often, but when I did, if I recall correctly, I
did something like:
try:
iter
except NameError:
def isiterable(x):
try:
On 21 Nov 2005 13:59:12 -0800, [EMAIL PROTECTED] wrote:
I tried the solutions you provided..these are not as robust as i
thought would be...
may be i should put the problem more clearly...
here it goes
I have a bunch of documents and each document has a header which is
common to all files.
Bugs item #1362587, was opened at 2005-11-21 08:44
Message generated for change (Comment added) made by gustaebel
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1362587group_id=5470
Please note that this message will contain a full copy of the comment
101 - 177 of 177 matches
Mail list logo