forked from pyvec/naucse.python.cz
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 8eba2ac 🚀
- Loading branch information
1 parent
7e29db5
commit 65f7fcc
Showing
18 changed files
with
2,194 additions
and
1 deletion.
There are no files selected for viewing
305 changes: 305 additions & 0 deletions
305
2024/pyladies-en-vienna-2024-autumn/beginners-en/argparse/index.html
Large diffs are not rendered by default.
Oops, something went wrong.
504 changes: 504 additions & 0 deletions
504
2024/pyladies-en-vienna-2024-autumn/beginners-en/debugging/index.html
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+38.5 KB
...yladies-en-vienna-2024-autumn/beginners-en/debugging/static/breakpoint-stop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+25.8 KB
2024/pyladies-en-vienna-2024-autumn/beginners-en/debugging/static/breakpoint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.5 KB
2024/pyladies-en-vienna-2024-autumn/beginners-en/debugging/static/context.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.97 KB
2024/pyladies-en-vienna-2024-autumn/beginners-en/debugging/static/controls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+21.7 KB
...pyladies-en-vienna-2024-autumn/beginners-en/debugging/static/debugging-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+61.8 KB
2024/pyladies-en-vienna-2024-autumn/beginners-en/debugging/static/exception.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.09 KB
2024/pyladies-en-vienna-2024-autumn/beginners-en/debugging/static/setup-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56.1 KB
2024/pyladies-en-vienna-2024-autumn/beginners-en/debugging/static/setup-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
353 changes: 353 additions & 0 deletions
353
2024/pyladies-en-vienna-2024-autumn/beginners-en/files/index.html
Large diffs are not rendered by default.
Oops, something went wrong.
196 changes: 196 additions & 0 deletions
196
2024/pyladies-en-vienna-2024-autumn/beginners-en/files/index/solutions/0/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
|
||
<!doctype html> | ||
<html lang="cs"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<title> | ||
|
||
Beginners course PyLadies Vienna: Files | ||
|
||
</title> | ||
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-xOolHFLEh07PJGoPkLv1IbcEPTNtaed2xpHsD9ESMhqIYd0nLMwNLD69Npy4HI+N" crossorigin="anonymous"> | ||
|
||
|
||
<link rel="icon" type="image/x-icon" href= "/static/img/who_96px.png"> | ||
<link rel="stylesheet" href="/static/css/naucse.css"> | ||
<link rel="stylesheet" href="/static/css/body.css"> | ||
<link rel="stylesheet" href="/static/css/pygments-lovelace-style.css"> | ||
<link rel="stylesheet" href="/static/css/ipython.css"> | ||
|
||
|
||
<link rel="canonical" href="https://naucse.python.cz/lessons/beginners-en/files/" /> | ||
|
||
|
||
<style> | ||
|
||
|
||
|
||
</style> | ||
</head> | ||
|
||
<body> | ||
<nav class="header"> | ||
<ul class="container menu"> | ||
<li><a href="/" class="logo"><h1>PyLadies Vienna</h1></a></li> | ||
<li><a href="/sponsorship/" class="menu-link"><h2>Support Us</h2></a></li> | ||
<li><a href="/mentorship/" class="menu-link"><h2>Mentorship</h2></a></li> | ||
<li><a href="/runs/" class="menu-link"><h2>Courses</h2></a></li> | ||
</ul> | ||
</nav> | ||
|
||
|
||
|
||
<div class="page"> | ||
<div class="container"> | ||
|
||
|
||
|
||
|
||
|
||
<div class="lesson-content"> | ||
|
||
|
||
<h1>Files – Solution [0]</h1> | ||
|
||
|
||
<p>Each row ends with a newline character (<code>'\n'</code>). | ||
When iterating over a Python file, | ||
this character remains at the end of the string <code>line</code> ¹. | ||
The <code>print()</code> function then adds another newline character. | ||
This function always ends the line. | ||
You can suppress it using the argument <code>end=''</code>). | ||
That is one way how to "fix" this extra spacing. | ||
The other is to use the method <code>rstrip()</code> for each line. | ||
This method removes all spaces and newline characters | ||
that are the end of the string.</p> | ||
<hr> | ||
<p>¹ Why does Python keep the newline character? If the <code>'\n'</code> at the end of line was removed, | ||
it would not be possible to know if the last line ended with <code>'\n'</code> or not.</p> | ||
|
||
|
||
</div> | ||
|
||
|
||
|
||
|
||
|
||
<div class="row prev-next"> | ||
|
||
|
||
|
||
<div class="col text-left"> | ||
<a href="/2024/pyladies-en-vienna-2024-autumn/beginners-en/json/">← <span class="d-none d-sm-inline">JSON</span></a> | ||
</div> | ||
|
||
|
||
|
||
|
||
<div class="col text-left"> | ||
<a href="/2024/pyladies-en-vienna-2024-autumn/sessions/files_cli/">↑ <span class="d-none d-sm-inline">Lesson: Working with Files and Debugging</span></a> | ||
</div> | ||
|
||
|
||
|
||
|
||
<div class="col text-right"> | ||
<a href="/2024/pyladies-en-vienna-2024-autumn/beginners-en/debugging/"><span class="d-none d-sm-inline">Debugging Python</span> →</a> | ||
</div> | ||
|
||
|
||
|
||
</div> | ||
|
||
|
||
|
||
|
||
</div> | ||
</div> | ||
|
||
|
||
|
||
<script type="text/javascript" src="/static/js/solutions.js"></script> | ||
|
||
<div class="footer container"> | ||
<hr> | ||
<div class="lesson-attribution"> | ||
|
||
|
||
<p>Translated by Petr Plavjanik</p> | ||
|
||
<p>Modified by Tyna Dolezalova</p> | ||
|
||
<p>Originally written by Petr Viktorin, 2014-2017 for <a href="https://naucse.python.cz/course/pyladies/beginners/files/">PyLadies CZ</a>.</p> | ||
|
||
|
||
|
||
<p> | ||
Licence: | ||
<a href="https://creativecommons.org/licenses/by-sa/4.0/"> | ||
Creative Commons Attribution-ShareAlike 4.0 International | ||
</a> | ||
</p> | ||
|
||
|
||
|
||
</div> | ||
</div> | ||
<footer> | ||
<div class="container"> | ||
<div class="global-pyladies"> | ||
© 2024 PyLadies Vienna. All rights reserved. | ||
<br> | ||
<a href="/agb/">Impressum, AGB</a> | ||
<br> | ||
We are a part of <a href="https://pyladies.com">international PyLadies</a>. | ||
</div> | ||
<ul> | ||
<li> | ||
<a href="https://discord.gg/v2qdvbD2dn" target="_blank"> | ||
<img src="/static/img/discord-logo.png"> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="mailto:[email protected]" > | ||
<img src="/static/img/mail-white.png"> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://twitter.com/pyladies_vie" target="_blank"> | ||
<img src="/static/img/twitter-white.png"> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://www.instagram.com/pyladies_vienna" target="_blank"> | ||
<img src="/static/img/instagram-logo.png"> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://github.com/UndeadFairy/pyladies_vienna" target="_blank"> | ||
<img src="/static/img/github-white.png"> | ||
</a> | ||
</li> | ||
<li> | ||
<a href="https://www.meetup.com/PyLadies-Vienna/" target="_blank"> | ||
<img src="/static/img/meetup.png"> | ||
</a> | ||
</li> | ||
<li data-toggle="tooltip" title="Linkedin"> | ||
<a href="https://www.linkedin.com/company/pyladies-vienna" target="_blank"> | ||
<img src="/static/img/linkedin-logo.png"> | ||
</a> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="clear"></div> | ||
</footer> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-Fy6S3B9q64WdZWQUiU+q4/2Lc9npb8tCaSX9FK7E8HnRr0Jz8D6OP9dO5Vg3Q9ct" crossorigin="anonymous"></script> | ||
|
||
|
||
|
||
</body> | ||
</html> |
Oops, something went wrong.