Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'interpreter': 0.04; 'output': 0.04; 'modify': 0.05; 'convention.': 0.07; 'works.': 0.07; 'subject:How': 0.09; 'python': 0.09; '"%s"': 0.09; '%s\\n"': 0.09; ':-(': 0.09; 'answering': 0.09; 'script,': 0.09; 'subject:script': 0.09; 'def': 0.10; 'kurt': 0.11; 'columns': 0.16; 'item)': 0.16; 'rewriting': 0.16; 'script?': 0.16; 'wrote:': 0.17; '>>>': 0.18; 'putting': 0.20; 'to:name:python-list@python.org': 0.20; 'trying': 0.21; '>>>': 0.22; 'skip:$ 20': 0.22; 'skip:% 10': 0.22; 'sorry,': 0.22; 'help.': 0.22; '>': 0.23; 'monday,': 0.23; 'to:2**1': 0.23; 'somewhere': 0.24; 'script': 0.24; 'header:In- Reply-To:1': 0.25; 'skip:" 20': 0.26; 'question': 0.27; 'lines': 0.28; 'run': 0.28; 'received:98.138.87': 0.29; 'url:mailman': 0.29; 'skip:& 10': 0.29; "i'm": 0.29; 'worked': 0.30; 'code': 0.31; 'url:python': 0.32; 'file': 0.32; 'running': 0.32; 'skip:_ 30': 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'surely': 0.33; 'to:addr:python-list': 0.33; 'skip:& 20': 0.33; 'that,': 0.34; "can't": 0.34; 'text': 0.34; 'reply-to:addr:yahoo.com': 0.34; 'table': 0.35; 'subject:?': 0.35; 'subject:': 0.36; 'url:org': 0.36; 'apple': 0.36; 'data.': 0.36; 'email addr:python.org': 0.36; "i'll": 0.36; 'should': 0.36; 'thank': 0.36; 'does': 0.37; 'item': 0.37; 'sent:': 0.37; 'subject:: ': 0.38; 'green': 0.38; 'from:': 0.38; 'skip:l 20': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'help': 0.40; 'url:mail': 0.40; 'your': 0.60; 'you.': 0.61; 'containing': 0.61; 'side': 0.61; 'email name:python-list': 0.62; 'between': 0.63; 'price': 0.66; 'header:Reply-To:1': 0.68; 'business': 0.70; 'received:41': 0.73; 'subject:this': 0.84; '2013': 0.84; 'fortunately': 0.84; 'yourself?': 0.84; 'received:98.138.226': 0.91 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 350976.35817.bm@omp1004.mail.ne1.yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1357659101; bh=Rr/kWQod4f0fA1gckczqefyTOCh0QSfJXYbj1BfaBP4=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=mC+vldYOVZRk0dT979c8w7KN7SbJDms+bFolfpnpvgZO0TNlRBpJWW+Ci7GwsVx8HjaZ5dwS3SgHwgv8uJMYWJwQIUAUNpF+EQU21LQVO+ustl3TkWJWBioid2WoZVXv42HA4dlTuaMC2eFpJQNOqkS1xKVPUtJn+aUek7/s8pc= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=R3IFf8wBYFA2MoT7YDhKVPIvz8/VZsw4eGA2UEPMxMOgzv/ocqjMEiJ7JvcYCIKKxqIB/iEHtRGI3uVHgeNQfUBodYoykcXLp43sAhqF5TASQJ2uTewkYzkBDiv/dZ9sCC6ooSBb2qPg3spxL0PZgsDq2ZKuKWd+dVo3k+z96K4=; X-YMail-OSG: KLzZHToVM1kR3AXfIKm6LYioGub.RrOY_yfzdVSsOR_ZB0p z2wtZW3n43nwpdcKU2Q6Iv_B.gSwtlLYtY6hoQfpWjWQ1JR5_ZdvcIpKpElZ isLTEH8b4FOagYGjAnPsNZv5vwQoMvIFAWX62Lt7eLacYCOyvtkO8VQlDF9s HjYxkPKKhhQAL6ygk9c2FSHN5mbqBiarGBAhQbqxV28CNl9Db4ZxgHnfMaAn a.M5ulnznXbqrsLufY5SviwZw.Gs6m8vYoMzdMJBVwM_gMHuhBH7VOKxr3pB 8NJdXX2kmvphvsrvjHi2zkgAfsT41yn63i3Cqj78I2nrux_WQkWpX8.FOv_e zPuIxKMpY4psSsWiLsclDtUMZLpehA9sEaVktIkgMRhCZjxRSjRcHUMSeuLK TERlV0MQzr3HEdwRvxVasuxnHWp6g0cSJHPkBY8UVUOHwrRqeGOxWl_iDUlH yzOmozrj_B_jtMQ4ccqHmKWLkyzN0yfXbLkH3af5FHclJmrYENd515rjTZfR 3rhet7HwSyHzHjFfv4jyOOtzEbALG X-Rocket-MIMEInfo: 001.001, V2VsbCB0ZWxsIG1lIGhvdyBkbyB5b3UgdXNlIHRoaXMgc2NyaXB0IGluIGdlZGl0LCBhcmUgeW91IHVzaW5nIGl0IGFzIGEgcGx1Z2luID8gYXJlIHlvdSBwdXR0aW5nIHRoaXMgY29kZSBzb21ld2hlcmUgPyBJJ2xsIHRyeSB0byBkbyB0aGUgc2FtZSBvbiBteSBzaWRlIGFuZCB0cnkgdG8gdW5kZXJzdGFuZCBob3cgaXQgd29ya3MuCgoKCgoKCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCiBGcm9tOiBLdXJ0IEhhbnNlbiA8a3VydEB1Z3lsZGlnLmludmFsaWQ.ClRvOiBweXRob24tbGlzdEBweXQBMAEBAQE- X-Mailer: YahooMailWebService/0.8.130.494 References: <50e97123$0$294$14726298@news.sunsite.dk> <50e97e4c$0$294$14726298@news.sunsite.dk> <50e9885e$0$294$14726298@news.sunsite.dk> <50eafb00$0$287$14726298@news.sunsite.dk> Date: Tue, 8 Jan 2013 07:31:41 -0800 (PST) From: chaouche yacine Subject: Re: How to modify this script? To: Kurt Hansen , "python-list@python.org" In-Reply-To: <50eafb00$0$287$14726298@news.sunsite.dk> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="-1546730761-700498275-1357659101=:20095" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: chaouche yacine List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 109 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1357659111 news.xs4all.nl 6982 [2001:888:2000:d::a6]:39177 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:36436 ---1546730761-700498275-1357659101=:20095 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Well tell me how do you use this script in gedit, are you using it as a plu= gin ? are you putting this code somewhere ? I'll try to do the same on my s= ide and try to understand how it works.=0A=0A=0A=0A=0A=0A=0A_______________= _________________=0A From: Kurt Hansen =0ATo: python-= list@python.org =0ASent: Monday, January 7, 2013 5:42 PM=0ASubject: Re: How= to modify this script?=0A =0ADen 06/01/13 16.12, chaouche yacine skrev:=0A= > I'm not confident this would run on gedit. It works on a python=0A> inter= preter if you have a file named data.txt in the same directory=0A> containi= ng your sample data.=0A>=0A> It surely has to do with how gedit works then,= because the "$" sign=0A> isn't used in python, this business should be a g= edit convention. And=0A> sorry, I can't help on that, I'm not a user of ged= it myself. Fortunately=0A> others have answered and I beleive one of the so= lutions worked for you.=0A=0AIt does not seem to be the case :-(=0A=0AThank= you for trying to help.=0A=0A> -------------------------------------------= -----------------------------=0A> *From:* Kurt Hansen =0A> *To:* python-list@python.org=0A> *Sent:* Sunday, January 6, 2013 3:21= PM=0A> *Subject:* Re: How to modify this script?=0A>=0A> Den 06/01/13 15.0= 1, chaouche yacine wrote:=0A>=A0 > Well, I'm not answering your question si= nce I am rewriting the script,=0A>=A0 > because I prefer it this way :)=0A>= =A0 >=0A>=A0 > def addline(line):=0A>=A0 >=A0 =A0 =A0 return "%s\n= " % line=0A> [cut]=0A>=0A> I surpose I shall put your code between $< and >= ?=0A>=0A>=A0 > printed=0A>=A0 >=0A>=A0 >=A0 >>> =0A>=A0 > =0A>=A0 > =0A>=A0 > =0A>=A0 > =0A>=A0 >
Price table
1 Green apple = $1
5 Green apples = $4
10 Green apples $7
=0A>=A0 >=A0 >>>=0A>=0A> Aha, so you tested it yoursel= f?=0A>=0A> When running this in Gedit on four lines of tab-separated text t= he=0A> output is:=0A>=0A> %s\n" % line=0A>=0A> def addcolumn(item,nb_c= olumns):=0A>=A0 =A0 =A0 if nb_columns !=3D 3:=0A>=A0 =A0 =A0 =A0 =A0 return= "%s" % (3 - nb_columns + 1, item)=0A>=A0 =A0 =A0 r= eturn "%s" % item=0A>=0A> output =3D "\n"=0A> for line in f= ile("data.txt"):=0A>=A0 =A0 =A0 items =3D line.strip().split("\t")=0A>=A0 = =A0 =A0 columns =3D ""=0A>=A0 =A0 =A0 for item in items :=0A>=A0 =A0 =A0 = =A0 =A0 columns +=3D addcolumn(item,len(items))=0A>=A0 =A0 =A0 output=A0 += =3D addline(columns)=0A>=0A>=0A> output +=3D "
"=0A> print output=0A= >=A0 >=0A> -- Venlig hilsen=0A> Kurt Hansen=0A> -- http://mail.python.org/m= ailman/listinfo/python-list=0A>=0A>=0A=0A=0A-- =0AVenlig hilsen=0AKurt Hans= en=0A-- =0Ahttp://mail.python.org/mailman/listinfo/python-list ---1546730761-700498275-1357659101=:20095 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Well tell me how do y= ou use this script in gedit, are you using it as a plugin ? are you putting= this code somewhere ? I'll try to do the same on my side and try to unders= tand how it works.




=
=
From: Kurt= Hansen <kurt@ugyldig.invalid>
To: python-list@python.org
Sent: Monday, January 7, 2013 5:42 PM
Subject: Re: How to modify this script= ?

=0ADen 06/01/13 16.12, chaouche yacine skrev:
> I'm not c= onfident this would run on gedit. It works on a python
> interpreter = if you have a file named data.txt in the same directory
> containing = your sample data.
>
> It surely has to do with how gedit works = then, because the "$" sign
> isn't used in python, this business shou= ld be a gedit convention. And
> sorry, I can't help on that, I'm not = a user of gedit myself. Fortunately
> others have answered and I bele= ive one of the solutions worked for you.

It does not seem to be the = case :-(

Thank you for trying to help.

> -----------------= -------------------------------------------------------
> *From:* Kur= t Hansen <kurt@ugyldig.invalid>
> *To:* python-list@python.org
> = *Sent:* Sunday, January 6, 2013 3:21 PM
> *Subject:* Re: How to modif= y this script?
>
> Den 06/01/13 15.01, chaouche yacine wrote:>  > Well, I'm not answering your question since I am rewritin= g the script,
>  > because I prefer it this way :)
>&nb= sp; >
>  > def addline(line):
>  >  &nb= sp;   return "<tr>%s</tr>\n" % line
> [cut]
><= br>> I surpose I shall put your code between $< and >?
>
= >  > printed
>  >
>  >  >>= ;> <table>
>  > <tr><td colspan=3D'3'>Pr= ice table</td></tr>
>  > <tr><td>1 &l= t;/td><td> Green apple </td><td> $1</td></tr&= gt;
>  > <tr><td>5 </td><td> Green apples </td><td> $4</td></tr>
>  > &= lt;tr><td>10 </td><td> Green apples </td><td&= gt; $7</td></tr>
>  > </table>
> = ; >  >>>
>
> Aha, so you tested it yourself?>
> When running this in Gedit on four lines of tab-separated te= xt the
> output is:
>
> %s</tr>\n" % line
>> def addcolumn(item,nb_columns):
>      if nb_co= lumns !=3D 3:
>          return "<td cols= pan=3D'%s'>%s</td>" % (3 - nb_columns + 1, item)
>  &nb= sp;   return "<td>%s</td>" % item
>
> output = =3D "<table>\n"
> for line in file("data.txt"):
>  &= nbsp;   items =3D line.strip().split("\t")
>     = columns =3D ""
>      for item in items :
>&nbs= p;         columns +=3D addcolumn(item,len(items))
>= ;      output  +=3D addline(columns)
>
>> output +=3D "</table>"
> print output
>  ><= br>> -- Venlig hilsen
> Kurt Hansen
> -- http://mail.python.= org/mailman/listinfo/python-list
>
>


--
Venlig h= ilsen
Kurt Hansen
--
http://mail.python.org/mailman/listin= fo/python-list


---1546730761-700498275-1357659101=:20095--