<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Message: 6<br>
Date: Wed, 15 Apr 2009 14:18:18 -0400<br>
From: Steve McClure &lt;<a href="mailto:sMcClure@racemi.com">sMcClure@racemi.com</a>&gt;<br>
Subject: Re: [pygtk] Funny Indent<br>
To: pygtk mailing list &lt;<a href="mailto:pygtk@daa.com.au">pygtk@daa.com.au</a>&gt;<br>
Message-ID: &lt;<a href="mailto:4B20E162-807E-435C-A8EF-B0559D6AECEF@racemi.com">4B20E162-807E-435C-A8EF-B0559D6AECEF@racemi.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;us-ascii&quot;<br>
<br>
<br>
On Apr 15, 2009, at 1:57 PM, Nawal Husnoo wrote:<br>
<br>
&gt; Dear PyGTK users,<br>
&gt;<br>
&gt; I have never used PyGTK, and I only wanted to extract some gstreamer<br>
&gt; webcam code from a script I found on:<br>
&gt;<br>
&gt; <a href="http://giss.tv/wiki/index.php/Streaming_Tools#GStreamer_2" target="_blank">http://giss.tv/wiki/index.php/Streaming_Tools#GStreamer_2</a><br>
&gt;<br>
&gt;<br>
&gt; I have removed most of the codes I don&#39;t need, but I&#39;m puzzled by<br>
&gt; the indentation used:<br>
&gt;<br>
&gt; class GTK_Main:<br>
&gt;<br>
&gt;     def __init__(self):<br>
&gt;         window = gtk.Window(gtk.WINDOW_TOPLEVEL)<br>
&gt;         window.set_title(&quot;Webcam Streamer&quot;)<br>
&gt;         window.set_default_size(1024, 768)<br>
&gt;<br>
&gt;         window.connect(&quot;destroy&quot;, gtk.main_quit, &quot;WM destroy&quot;)<br>
&gt;                 self.sstate = &#39;preparing&#39;<br>
&gt; &lt;&lt;&lt;&lt;======================================<br>
&gt;<br>
&gt;                 red=gtk.gdk.color_parse(&#39;grey&#39;)<br>
&gt;                 eb=gtk.EventBox()<br>
&gt;                 eb.modify_bg(gtk.STATE_NORMAL, red)<br>
&gt;                 window.add(eb)<br>
&gt;<br>
&gt;         windows = gtk.ScrolledWindow()<br>
&gt;         windows.set_size_request(600, 400)<br>
&gt;         eb.add(windows)<br>
&gt;<br>
&gt;<br>
&gt; Could anyone tell me if this has something to do with PyGTK itself<br>
&gt; or if it&#39;s something deeper in Python? If I remove the &quot;extra&quot;<br>
&gt; indent, and run the code, it gives this error:<br>
&gt;<br>
&gt;   File &quot;./Webcamstream-v4l2.pys&quot;, line 29<br>
&gt;     red=gtk.gdk.color_parse(&#39;grey&#39;)<br>
&gt;     ^<br>
&gt; IndentationError: unexpected indent<br>
&gt;<br>
&gt;<br>
&gt; If I remove the indent in all 5 indented lines, it complains in the<br>
&gt; same way with the next one:<br>
&gt;<br>
&gt;   File &quot;./Webcamstream-v4l2.pys&quot;, line 34<br>
&gt;     windows = gtk.ScrolledWindow()<br>
&gt;     ^<br>
&gt; IndentationError: unexpected indent<br>
&gt;<br>
&gt; Any ideas?<br>
<br>
Your .pys file has mixed tabs and spaces.  If by &quot;remove the indent in<br>
all 5 indented lines&quot; you actually replaced the spaces with tabs, I<br>
think you would find the code worked as expected.  It looks like the<br>
tab spacing is expected to be 8 here.<br>
</blockquote></div><br>Yes, that worked great, thank you very much!<br clear="all"><br>-- <br>The best way to predict the future is to invent it. - Alan Kay<br><a href="http://www.galileon.co.uk/">http://www.galileon.co.uk/</a><br>