Python Forum
Geany 1.25 terminal not showing whitespace
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Geany 1.25 terminal not showing whitespace
#1
Hello,

I am using Python 3.5 with Geany 1.25.

One of the exercises I cam across while studying python as a beginner was stripping whitespace from string.
I stored 'python ' as the value in variable favourite_language. The terminal should return me a value with a white space at the end of the word python, but I only see python with no indication of white space. It's a black terminal window.

How do see whitespace in my output?

Thanks!
Reply
#2
Using print() it will not show quotes.
Example:
>>> # in a REPL it show quotes
>>> s = 'python '
>>> s
'python '
>>> s.strip()
'python'
 
>>> # print will not show quotes,if it's 1 or 10 whitespace it will not be visible
>>> print(s)
python 
>>> # Can use repr to show quotes
>>> print(repr(s))
'python '
>>> print(repr(s.strip()))
'python'
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation "System cannot find path specified"(Geany) kiwi99 2 3,877 Mar-18-2021, 07:37 PM
Last Post: kiwi99
  Style question on adherence to PEP 8 with whitespace near an "=" sign nilesh 6 3,945 Jan-12-2021, 11:11 PM
Last Post: snippsat
  Printing string at specific position on terminal - not showing __Mathieu__ 1 2,388 Sep-07-2020, 10:32 AM
Last Post: Larz60+
  len() function, numbers doesn't work with Geany Editor Penguin827 3 3,001 May-08-2020, 04:08 AM
Last Post: buran
  Superfluous whitespace found? CaptainCsaba 2 21,252 Mar-19-2020, 09:04 AM
Last Post: ak52
  Whitespace syntax error klp21 1 3,060 May-22-2019, 07:49 AM
Last Post: Gribouillis
  Geany Configuration twallace51 0 4,508 Apr-21-2019, 02:20 PM
Last Post: twallace51
  How to remove whitespace from a string when .replace and .strip do not work winnetrie 7 4,466 Jan-05-2019, 08:44 AM
Last Post: DeaD_EyE
  Beginner Help - Geany and Cmder Pogosaur 2 3,204 Oct-09-2018, 02:15 PM
Last Post: Pogosaur
  Geany editor Mike429W 2 3,698 Sep-20-2018, 09:46 AM
Last Post: Mike429W

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020