[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Python - How to suppress the header to the first row only?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 13
Thread images: 1

File: 2bc.jpg (15KB, 600x583px) Image search: [Google]
2bc.jpg
15KB, 600x583px
Been stuck on this for hours and other places don't seem to be quite helpful...

Every time I output my code to a file all the headers show up for each file read in.

How do I suppress the header to only the first index?

Here is my code:
http://dpaste.com/164R131

What output I should be getting: http://dpaste.com/23YFSG7.txt

What my crappy code is getting:
http://dpaste.com/2MMY224
>>
>>361780
Delete line 6
>>
>>361795
I deleted line 6 (one_header) but it still makes no difference. Header still outputs for each file
>>
>>361816
Can you post all your code?

I'm assuming there's an outer loop that you didn't post, you need to move line 3 to be outside the loop.
>>
>>361852
>Trying to steal my full code
Nice try fella.
>>
>>361914
You're writing for loops in Python.

No-one wants your code.
>>
>>361780

Why the hell are you printing the header inside of a loop? I'm assuming the code you posted is enclosed in a loop. Why? Just print it before the loop.
>>
>>361967

Otherwise delete line 3 so it doesn't reset. You're a fucking moron, man.
>>
post more code, including mock `data1`, `data2`, and `base`
>>
>>361967
>>361968
Wow dude take a chillerino. I'm new.
>>361969
I don't see why that's ralevant.
>>
>>362016
kys then faggot
>>
>>362016

Did you delete line 3 and moved it to OUTSIDE the loop or not?
>>
>>362020
Rude!
>>362031
No because I'm not really the OP. Lol.
Thread posts: 13
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.