Check os.isatty(fd). It will return True if fd is a terminal-like device.
On Tue, Apr 17, 2012 at 5:21 PM, Edward d'Auvergne wrote:
> Hi,
>
> I was wondering if anyone knows of how to detect when IO redirection
> of any form is happening within a Python program? I would like to
> emulate the beh
Paramiko provides SSH2 support and is platform-independent (implemented
purely in Python). Try it and see if it works for you. Link:
http://www.lag.net/paramiko/..
On 04/18/2012 04:35 PM, Richard Shea wrote:
On a *nix box this is a reasonable bit of Python :
cmd = "ssh -o StrictHostKeyCheckin
Thomas Heller wrote:
>
> What is the difference between PyDispatcher and Louie?
> (I'm still using a hacked version of the original cookbook recipe...)
Not too much at this point, but the general differences are listed on
this page:
http://louie.berlios.de/changes.html
Matt and I plan to experim
Leif K-Brooks wrote:
> I'm writing a relatively simple multi-user public Web application
with
> Python. It's a rewrite of a similar application which used PHP+MySQL
> (not particularly clean code, either). My opinions on various Web
> frameworks tends to vary with the phase of the moon, but current
Posting using Google Groups messed up the formatting of those class
definition examples. Assume that they contain the usual indentation of
typical class definitions. ;-)
--
http://mail.python.org/mailman/listinfo/python-list
e into multiline command.
Ctrl+]Increase font size.
Ctrl+[Decrease font size.
Ctrl+=Default font size.
>>>
Hope that helps.
Pat
--
Patrick K. O'Brien
Orbtechhttp://www.orbtech.com
Schevo http://www.schevo.org
Pypersyst http://www.pypersyst.org
--
http://mail.python.org/mailman/listinfo/python-list
Wow! I must say, I'm less than impressed with the responses so far. I
know Ilias can give the impression that he is just trolling, but I can
assure you he is not. At least, not in this case. ;-)
So in an effort to make some headway, I'm going to try to summarize the
current state of affairs.
So what if someone appears to be a troll? Suck it up and rise above
it. This thread started with legitimate questions. Unfortunately,
almost every response has been dismissive, petty, and a complete waste
of time and effort. Please respond to the issue or simply ignore it.
The issue is real and
I thought I was being as clear and specific as I needed to be.
Apparently not. I'm talking about compiling the original source code,
per the recommendations made by Mike Fletcher and documented here:
Python 2.4 Extensions w/ the MS Toolkit Compiler
http://www.vrplumber.com/programming/mstoolkit/
between the two dlls?
If I'm asking questions already answered elsewhere, I'd love a link to
that resource, if you have it.
Thanks,
Pat
Patrick K. O'Brien
Orbtechhttp://www.orbtech.com
Schevo http://www.schevo.org
Pypersyst http://www.pypersyst.org
--
http://mail.pyt
Stephen,
I appreciate your responses. Maybe "school bullies" was an
exaggeration on my part. At the same time, I'm not sure it is good for
the Python community to expect everyone to roll up their sleeves and
hack at something to make it work. (And I don't mean to imply that you
hold that opinio
>>users. I can't expect them to purchase a .NET compiler or go through
a
>See above.
That answers the cost question (assuming that your interpretation of
the licensing is correct, since I'm not a lawyer nor qualified to
render much of an opinion on that). But there is still the issue of
going t
Stephen Kellet said:
Pat, could you include some context in your replies? I have no idea if
you are replying to my comments about Visual Studio Express or someone
else? The only text I see in your replies is what you write, no text
from the posting you are replying to. As it is I've ignore
Fredrik Lundh wrote:
> "Pat"wrote:
>
> > I thought I was being as clear and specific as I needed to be.
> > Apparently not. I'm talking about compiling the original source
code
>
> the python source or the extension source?
>
> > The bottom line
Stephen Kellett wrote:
> In message <[EMAIL PROTECTED]>,
Pat
> <[EMAIL PROTECTED]> writes
> >That answers the cost question (assuming that your interpretation of
> >the licensing is correct, since I'm not a lawyer nor qualified to
> >render much of an
Fredrik Lundh wrote:
> "Pat" wrote:
>
> > Okay, I think we are pretty much talking about the same thing. My
> > problem is not that I'm unable or unwilling to purchase a good
> > compiler. My problem is that I don't want to make it a requirement
of
&g
Fredrik Lundh wrote:
> "Pat" wrote:
>
> > A few things. Primarily the fact that I'm not very experienced in
C
> > (the extensions that I need to have compiled are not written by
me).
> > Secondarily, the fact that the discussion threads I read made it
seem
Diez B. Roggisch wrote:
>
> >> Just out of curiousity: How many python extensions are you
planning to
> >> write?
> >
> > I estimate 10 to 100, depending on abstractional capabilities of
the
> > extension system.
> >
> >> And how many lines of pure python code have you written in your
life?
> >
> >
Nick Coghlan wrote:
> Pat wrote:
> > On Windows, most users are used to installing precompiled binary
> > packages, rather than compiling from source. When you do have to
> > compile from source, it often requires you to fiddle with nitty
gritty
> > details abou
Timothy Gee wrote:
> Have do a lot of lab work making use of xmlrpclib and am quite
> dependent on it. I just started working with pycrust under Linux RH9,
> and wanted to use it as my standard python environment, however, when I
> import xmlrpclib, I get a segmentation fault. Command line still wo
I have to do a big programm. Could someone give me some suggests about
IDE (on Linux) and books to learn.
--
http://mail.python.org/mailman/listinfo/python-list
Up until today, I never needed to pass any arguments to a Python program.
I did all the requisite reading and found that I should use optparse
instead of getopt. I read the documentation and since the words
"simple" and "easy" often appeared in the examples and documentation, I
just knew tha
If you mean with "/" as the option designator instead of "-": there
doesn't appear to be a documented way of doing it. You would have to
do some social engineering on the users to get them used to doing "dir
-s -b". In any case I thought the number of Windows users who know how
to fire up a Com
Thorsten Kampe wrote:
* Pat (Mon, 26 Jan 2009 20:02:59 -0500)
Up until today, I never needed to pass any arguments to a Python
program.
[...]
getopt resolved my immediate need, but I would like to know how one
could use optparse to extract out the options from something like "dir
/s /b&q
I had no idea people were going to get so upset that I used a Windows
example and go off on a tear.
Nobody is upset, and nobody has "gone off on a tear". The point about
the "Windows example" is that the docs say in a close-to-screamingly-
obvious manner that /options are not supported, no ma
Peter Otten wrote:
Pat wrote:
The question was it possible to add a simple flag like 'd-' to optparse
with no other parameters?
Do you mean "d-" or "-d"? If the latter, what's wrong with Robert Kern's
answer?
Peter
I mean "-d" since th
Tobiah wrote:
Just out of curiosity, why was len() made to
be it's own function? I often find myself
typing things like my_list.len before I
catch myself.
Thanks,
Toby
I'm surprised that no one responded to that question.
I keep making that mistake all the time myself.
--
http://mail.python
Andreas Waldenburger wrote:
On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote:
Tobiah wrote:
Just out of curiosity, why was len() made to
be it's own function? I often find myself
typing things like my_list.len before I
catch myself.
Thanks,
Toby
I'm surprised that no one respond
Gabriel Genellina wrote:
En Wed, 04 Feb 2009 12:38:04 -0200, Pat escribió:
Andreas Waldenburger wrote:
On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote:
Tobiah wrote:
Just out of curiosity, why was len() made to
be it's own function? I often find myself
typing things like my_list.len bef
Terry Reedy wrote:
Pat wrote:
Andreas Waldenburger wrote:
On Sat, 31 Jan 2009 13:27:02 -0500 Pat wrote:
Tobiah wrote:
Just out of curiosity, why was len() made to
be it's own function? I often find myself
typing things like my_list.len before I
catch myself.
Thanks,
Toby
I'm
Bruno Desthuilliers wrote:
Pat a écrit :
I've been searching for a good multi-module lint checker for Python
and I haven't found one yet.
Pylint does a decent job at checking for errors only within a single
module.
Here's one of my problems. I have two modules.
In modul
I can't figure out how to set up a Python data structure to read in data
that looks something like this (albeit somewhat simplified and contrived):
States
Counties
Schools
Classes
Max Allowed Students
Current enrolled Students
Nebraska, Wabash, Newville, Ma
Dennis Lee Bieber wrote:
On Mon, 06 Oct 2008 19:45:07 -0400, Pat <[EMAIL PROTECTED]> declaimed the
following in comp.lang.python:
I can't figure out how to set up a Python data structure to read in data
that looks something like this (albeit somewhat simplified and contrived)
I know it's not "fair" to compare language features, but it seems to me
(a Python newbie) that appending a new key/value to a dict in Python is
awfully cumbersome.
In Python, this is the best code I could come up with for adding a new
key, value to a dict
mytable.setdefault( k, [] ).append(
Pat wrote:
I know it's not "fair" to compare language features, but it seems to me
(a Python newbie) that appending a new key/value to a dict in Python is
awfully cumbersome.
In Python, this is the best code I could come up with for adding a new
key, value to a dict
mytabl
paul wrote:
Pat schrieb:
I know it's not "fair" to compare language features, but it seems to
me (a Python newbie) that appending a new key/value to a dict in
Python is awfully cumbersome.
In Python, this is the best code I could come up with for adding a new
key,
Faheem Mitha wrote:
Hi,
I need to match a string of the form
capital_letter underscore capital_letter number
against a string of the form
anything capital_letter underscore capital_letter number
some_stuff_not_starting with a number
DUKE1_plateD_A12.CEL.
Thanks in advance. Please cc
[EMAIL PROTECTED] wrote:
Hi All,
I'm switching to python from perl, and like the language a ton, but I
find pdb and pydb to be vastly inferior debuggers to the perl version.
In particular, I've grown very used to stepping into arbitrary
functions interactively. For instance, in perl you can do
Sean DiZazzo wrote:
On Sep 29, 12:44 pm, "Blubaugh, David A." <[EMAIL PROTECTED]>
wrote:
Sir,
You are absolutely correct. I was praying to G_d I did not have to
slaughter my project's source code in this manner. However, like life
itself, I was given legacy source code (i.e. someone else erro
Steve Phillips wrote:
Hi All,
I am just wondering what seems to be the most popular IDE. The reason
I ask is I am currently at war with myself when it comes to IDE's. It
seems like every one I find and try out has something in it that
others don't and viceversa. I am in search for the perfect IDE
I have a regexp in Perl that converts the last digit of an ip address to
'9'. This is a very particular case so I don't want to go off on a
tangent of IP octets.
( my $s = $str ) =~ s/((\d+\.){3})\d+/${1}9/ ;
While I can do this in Python which accomplishes the same thing:
ip = ip[ :-1 ]
i
While I can use a for loop looking for a match on a list, I was
wondering if there was a one-liner way.
In particular, one of my RE's looks like this '^somestring$' so I can't
just do this: re.search( '^somestring$', str( mylist ) )
I'm not smart enough (total newbie) to code up a generator e
Bruno Desthuilliers wrote:
Pat a écrit :
While I can use a for loop looking for a match on a list, I was
wondering if there was a one-liner way.
In particular, one of my RE's looks like this '^somestring$' so I
can't just do this: re.search( '^somestring$', s
Bruno Desthuilliers wrote:
Pat a écrit :
I have a regexp in Perl that converts the last digit of an ip address
to '9'. This is a very particular case so I don't want to go off on
a tangent of IP octets.
( my $s = $str ) =~ s/((\d+\.){3})\d+/${1}9/ ;
While I can do this
I have written chunks of Python code that look this:
new_array = []
for a in array:
if not len( a ):
continue
new_array.append( a )
and...
string = ""
for r in results:
if not r.startswith( '#' ):
string =+ r
It seems that a list
Steven D'Aprano wrote:
On Mon, 20 Oct 2008 10:20:03 -0400, Pat wrote:
Finally, if someone could point me to a good tutorial or explain list
compressions I would be forever in your debt.
Think of a for-loop:
for x in (1, 2, 3):
x
Creates x=1, then x=2, then x=3. It doesn't d
Diez B. Roggisch wrote:
Pat wrote:
I have written chunks of Python code that look this:
new_array = []
for a in array:
if not len( a ):
continue
new_array.append( a )
new_array = [a for a in array if len(a)]
and...
string = ""
I have a Globals class.
In it, I have a variable defined something like this:
remote_device_enabled = bool
In one module, I assign True/False to Globals.remote_device_enabled.
Once set, this value never changes.
In another module, at the top after the imports statements, I tried this:
from
Bruno Desthuilliers wrote:
Pat a écrit :
Bruno Desthuilliers wrote:
Pat a écrit :
While I can use a for loop looking for a match on a list, I was
wondering if there was a one-liner way.
In particular, one of my RE's looks like this '^somestring$' so I
can't jus
Bruno Desthuilliers wrote:
Pat a écrit :
I have a Globals class.
Not sure it's such a great idea, but anyway... What's the use case for
this class ? There are perhaps better (or at least more idiomatic)
solutions...
In it, I have a variable defined something
Bruno Desthuilliers wrote:
MRAB a écrit :
On Oct 19, 5:47 pm, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
Pat a écrit :
(snip)
ip = ip[ :-1 ]
ip =+ '9'
or:
ip = ip[:-1]+"9"
(snip)
>>> re.sub(r'^(((\d+)\.){3})\d+$', "\g<1>9&quo
Steven D'Aprano wrote:
On Thu, 23 Oct 2008 11:38:35 -0400, Pat wrote:
I have a Globals class.
Well, that's your first mistake. Using global variables in a class is no
better than using bare global variables. They're still global, and that's
a problem:
http://we
I've been searching for a good multi-module lint checker for Python and
I haven't found one yet.
Pylint does a decent job at checking for errors only within a single module.
Here's one of my problems. I have two modules.
In module one, I have a function:
def foo( host, userid, password ):
Miki wrote:
Hello,
In module one, I have a function:
def foo( host, userid, password ):
pass
In module two, I call that function:
foo( userid, password)
lint doesn't find that error and it won't be caught until it's called
while the program is running.
pychecker does find these kind o
I am trying to place a dialog in the center of the screen based on a users
screen resolution.
I can get the width and height of the screen, but I can't seem to use the
following:
root.geometry('WxH+X+Y')
It appears the values for X and Y need to be integers and not a variable
like width/2-40
S
Thanks.
S
"Lonnie Princehouse" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Tkinter takes strings as its arguments; it's TCL's legacy. You can use
> string formatting for this:
>
> x = width/2-40
> y = height/2-30
>
> root.geometry('%ldx%ld+%ld+%ld' % (width, height, x, y))
>
Thanks a lot for you response.
S
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> "Pat" <[EMAIL PROTECTED]> wrote:
>
>> I am trying to place a dialog in the center of the screen based on a
>> users
>> screen r
Set the site to be Basic Authentication and login as you. I suspect that
the .exe is either running as IWAM/IUSER (i.e. GUEST) or you are running
into a double hop issue.
Pat
"paulp" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Greetings,
>
> I
Don't change the account IIS is running under - that is a pretty big
security issue waiting to happen.
Change the authentication model for the web site to Basic, then logon as
you. That will cause any execution to be in the security context you are
expecting.
Pat
"paulp" &l
This made me grin. ;)
--
https://mail.python.org/mailman/listinfo/python-list
nd regards
Pat
--
This message has been scanned for viruses and
dangerous content by Pinpoint, and is
believed to be clean.
--
https://mail.python.org/mailman/listinfo/python-list
I don't think you are allowed to use the word dumbass to describe anyone or
anything buddy.
On Tuesday, October 1, 2013 9:42:31 AM UTC-4, Ferrous Cranus wrote:
> Στις 1/10/2013 4:27 μμ, ο/η Chris “Kwpolska” Warrick έγραψε:
>
> > On Tue, Oct 1, 2013 at 3:15 PM, Νίκος wrote:
>
> >> Στις 1/10/2
>From what I gather he was viewing files uploaded to the ftp folder and found
>this warning.html file contained within... So my take on it is, someone just
>uploaded it and this guy is freaking out making a buffoon out of himself.
--
https://mail.python.org/mailman/listinfo/python-list
yone help as this did work before.I have recompiled everything but the
problem still
Exists.
In anticipation,
Many Thanks
Pat
p...@icon.co.za
--
This message has been scanned for viruses and
dangerous content by Pinpoint, and is
believed to be clean.
--
https://mail.python.org/mailman/listinfo/python-list
vocation of boa worked fine.
Good luck!
Pat
--
http://mail.python.org/mailman/listinfo/python-list
7;ve never
dealt with this.
Thanks for your help,
-Pat
--
http://mail.python.org/mailman/listinfo/python-list
66 matches
Mail list logo