Movatterモバイル変換


[0]ホーム

URL:


Sorry, we no longer support your browser
Please upgrade toMicrosoft Edge,Google Chrome, orFirefox. Learn more about ourbrowser support.
Skip to main content
Stack Overflow
  1. About
  2. For Teams
Loading…
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Timeline forString formatting: % vs. .format vs. f-string literal

Current License: CC BY-SA 4.0

46 events
when toggle formatwhatbylicensecomment
Aug 17, 2022 at 7:09historyeditedKarl KnechtelCC BY-SA 4.0
add see-also for dupe closers
Jul 27, 2022 at 3:55commentadded Karl KnechtelFor duplicate closers: See alsostackoverflow.com/questions/2960772 as a target for questions that are simply asking for a way to do it. That one answers the question more directly. This question is explicilty about the pros and cons of the various approaches.
Jul 11, 2022 at 0:25historyeditedMateen UlhaqCC BY-SA 4.0
Reword first question. Generalize second question.; edited tags
Jul 11, 2022 at 0:20historyeditedMateen UlhaqCC BY-SA 4.0
Homogenize examples for quicker reading.
Jul 11, 2022 at 0:14historyeditedMateen UlhaqCC BY-SA 4.0
Reword into quickly readable list to summarize example usages.
May 10, 2021 at 16:45historyeditedCharles DuffyCC BY-SA 4.0
edited title
Aug 13, 2020 at 18:46historyeditedNorthIsUpCC BY-SA 4.0
Add string literals to the question
Dec 6, 2019 at 15:46historyediteddreftymac
edited tags
May 29, 2019 at 21:39historyeditedcodeforesterCC BY-SA 4.0
detag title
Feb 5, 2019 at 9:56answeraddedFelix Martineztimelinescore: 6
Aug 25, 2018 at 1:08answeraddedU13-Forwardtimelinescore: 3
Jul 4, 2018 at 7:13answeraddedzhengcaotimelinescore: 30
Apr 16, 2018 at 14:42answeraddedSylvan LE DEUNFFtimelinescore: 8
Feb 14, 2018 at 22:42answeraddedRoushantimelinescore: 5
Oct 18, 2017 at 20:17commentadded Charles The websitepyformat.info has a side by side comparison of features, and serves as a convenient reference for those less frequently used features!
Sep 20, 2017 at 21:36commentadded yanjost To answer your second question, since 3.2 you can use {} format if you use a custom formatter (seedocs.python.org/3/library/logging.html#logging.Formatter)
Jan 31, 2017 at 21:55history protectedMoinuddin Quadri
Jan 6, 2017 at 9:39commentadded gerrit See also:Pythons many ways of string formatting
Apr 15, 2016 at 11:12answeraddedColonel Panictimelinescore: 135
Apr 12, 2016 at 9:26commentadded Lutz Prechelt For reference: Python 3 documentation for thenewerformat() formatting style and theolder%-based formatting style.
Apr 12, 2016 at 9:24commentadded Lutz Prechelt For beginners: Here is avery nice tutorial that teaches both styles. I personally use the older% style more often, because if you do not need the improved capabilities of theformat() style, the% style is often a lot more convenient.
Apr 9, 2015 at 20:41answeraddedJorge Leitaotimelinescore: 12
Jan 14, 2015 at 19:11historyeditedthe Tin ManCC BY-SA 3.0
added 7 characters in body
Dec 4, 2014 at 18:33answeraddedmatiasgtimelinescore: 39
SNov 10, 2014 at 5:51historysuggestedSriramCC BY-SA 3.0
string.format is different from str.format. string.format refers to the string module
Nov 10, 2014 at 5:14review Suggested edits
SNov 10, 2014 at 5:51
SSep 9, 2014 at 19:02historysuggestedBob SteinCC BY-SA 3.0
showing the output is better
Sep 9, 2014 at 18:10review Suggested edits
SSep 9, 2014 at 19:02
Aug 21, 2014 at 18:00answeraddedDavid Sanderstimelinescore: 17
SAug 1, 2014 at 17:20historysuggestedGabrielCC BY-SA 3.0
add link to method
Aug 1, 2014 at 17:17review Suggested edits
SAug 1, 2014 at 17:20
May 13, 2014 at 17:10answeraddedbalutimelinescore: 33
Jul 5, 2013 at 19:47review Suggested edits
Jul 5, 2013 at 19:56
SMar 12, 2013 at 12:53historysuggestedpradyunsgCC BY-SA 3.0
Formatting
Mar 12, 2013 at 12:52review Suggested edits
SMar 12, 2013 at 12:53
SMar 12, 2013 at 10:20historysuggestedsmciCC BY-SA 3.0
Clarified question has two separate parts; added tags
Mar 12, 2013 at 10:16review Suggested edits
SMar 12, 2013 at 10:20
Sep 3, 2012 at 18:15answeraddedwobmenetimelinescore: 60
Aug 1, 2011 at 3:01answeraddedBrainStormtimelinescore: 64
Jun 13, 2011 at 20:20answeraddedeyquemtimelinescore: 319
Jun 13, 2011 at 18:43answeraddedlcltjtimelinescore: 47
Feb 22, 2011 at 21:56voteacceptNorthIsUp
Feb 22, 2011 at 19:21answeraddedWoobletimelinescore: 158
Feb 22, 2011 at 18:50commentadded carl similar tostackoverflow.com/questions/3691975/…
Feb 22, 2011 at 18:49answeraddedClaudiutimelinescore: 993
Feb 22, 2011 at 18:46history askedNorthIsUpCC BY-SA 2.5
toggle format

[8]ページ先頭

©2009-2025 Movatter.jp