[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
n00b Python question... i have a file that looks like this
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 6
Thread images: 1
File: python.jpg (47 KB, 799x532) Image search: [Google]
python.jpg
47 KB, 799x532
n00b Python question...

i have a file that looks like this

> foo(2016, 7,18)
> foo(2015,12,10)
> foo(2016, 1, 1)

how can i convert it to

> 2016-07-18
> 2015-12-10
> 2016-01-01

should i use regular expressions? is there some date library that can help?
>>
>>55232785
https://www.youtube.com/watch?v=vtgWADSHfuM
>>
>>55232785
you need some sprintf in your life, regex if you're desperate
>>
>>55232837

sprintf in python?
>>
datetime.strptime you fucking nigger
>>
>>55234056

thx faggot
Thread replies: 6
Thread images: 1

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.