Please keep your reply on the list, unless you have something private to say.
That way others can help, or learn from your questions. I've taken the liberty
of putting this back into the list.
Leam Hall wrote:
On 04/01/2012 09:40 PM, Steven D'Aprano wrote:
leam hall wrote:
Python 2.4.3 on R
leam hall wrote:
Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
but it doesn't seem to work like I thought.
res = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
uname = res.stdout.read().strip()
For future reference, you should identify the shortest possible am
On 31/03/2012 03:01, bob gailer wrote:
Then, of course, there's "15:45".replace(':','')
For the record in earlier Python versions such as the one the OP is
using you can do
>>> allchars = "".join([chr(x) for x in range(256)])
>>> 'www.example.com'.translate(allchars, 'cmowz.')
'exaple'
As
Then, of course, there's "15:45".replace(':','')
--
Bob Gailer
919-636-4239
Chapel Hill NC
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
On 30/03/2012 18:28, Joel Goldstick wrote:
On Fri, Mar 30, 2012 at 1:25 PM, Joel Goldstick
wrote:
On Fri, Mar 30, 2012 at 1:09 PM, leam hall wrote:
Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
but it doesn't seem to work like I thought.
res = subprocess.Popen(['uname
> strip(...)
> S.strip([chars]) -> string or unicode
>
> Return a copy of the string S with leading and trailing
> whitespace removed.
> If chars is given and not None, remove characters in chars instead.
> If chars is unicode, S will be converted to unicode before strippi
On 30/03/2012 18:09, leam hall wrote:
Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
but it doesn't seem to work like I thought.
What do you expect it to do?
res = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
uname = res.stdout.read().strip()
uname
'Linu
On Fri, Mar 30, 2012 at 1:25 PM, Joel Goldstick
wrote:
> On Fri, Mar 30, 2012 at 1:09 PM, leam hall wrote:
>> Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
>> but it doesn't seem to work like I thought.
>>
>>
>> res = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
On 3/30/2012 10:09 AM leam hall said...
Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
but it doesn't seem to work like I thought.
... but it works as advertised...
Help on built-in function strip:
strip(...)
S.strip([chars]) -> string or unicode
Return a copy o
> Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
> but it doesn't seem to work like I thought.
>
>
> res = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
> uname = res.stdout.read().strip()
>
> >>> uname
> 'Linux myserver 2.6.18-274.el5PAE #1 SMP Fri Jul 8 17:59:
On Fri, Mar 30, 2012 at 1:09 PM, leam hall wrote:
> Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
> but it doesn't seem to work like I thought.
>
>
> res = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
> uname = res.stdout.read().strip()
>
uname
> 'Linux myse
> Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
> but it doesn't seem to work like I thought.
>
>
> res = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
> uname = res.stdout.read().strip()
>
uname
> 'Linux myserver 2.6.18-274.el5PAE #1 SMP Fri Jul 8 17:59:09
Python 2.4.3 on Red Hat 5. Trying to use strip to remove characters
but it doesn't seem to work like I thought.
res = subprocess.Popen(['uname', '-a'], stdout=subprocess.PIPE)
uname = res.stdout.read().strip()
>>> uname
'Linux myserver 2.6.18-274.el5PAE #1 SMP Fri Jul 8 17:59:09 EDT 2011
i686 i6
13 matches
Mail list logo