Chopping off spaces at both ends



Hi

I am a newbie to python and am using it to interface some of my lab
equipment.

How does one get rid of spaces at both ends of a string ? A little like the
trim() intrinsic in fortran 95.

One of my instruments is returning a string that has one or more blanks in
it, and that is complicating string matching tests in one of my functions.

Thanks.
.



Relevant Pages

  • Re: Chopping off spaces at both ends
    ... >trimintrinsic in fortran 95. ... and that is complicating string matching tests in one of my functions. ... - Tim Roberts, timr@xxxxxxxxx ...
    (comp.lang.python)
  • Re: complex arithmetics
    ... |> Your statement was true in some previous version of Fortran. ... |> can specify the KIND argument optionally, ... |REAL and CMPLX when no optional KIND argument is present. ... Prev by Date: ...
    (comp.lang.fortran)
  • Re: DAY OF WEEK
    ... Fortran integer,integer divide operations, ... then you might translate JUST one line. ... Prev by Date: ...
    (comp.lang.pl1)
  • Re: Larkins website sucks[was Re: Bill Sux]
    ... I believe Excel is not the suitable software here. ... Of course not, real men use FORTRAN. ... Prev by Date: ...
    (sci.electronics.design)
  • Re: Fortran is dead, not viable
    ... David Frank wrote in message ... ... "ancient computer languages such as ... ... Fortran" ... Prev by Date: ...
    (comp.lang.pl1)