<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tomas Staškevičius on Medium]]></title>
        <description><![CDATA[Stories by Tomas Staškevičius on Medium]]></description>
        <link>https://medium.com/@tomasstakeviius?source=rss-703bc8e090e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gW9a1KqgHy0a-SaXwQpINQ.jpeg</url>
            <title>Stories by Tomas Staškevičius on Medium</title>
            <link>https://medium.com/@tomasstakeviius?source=rss-703bc8e090e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 15:21:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tomasstakeviius/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[This VS Code Extension Made Me Stop Using Git!]]></title>
            <link>https://medium.com/@tomasstakeviius/this-vs-code-extension-made-me-stop-using-git-5c30c9734ccd?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c30c9734ccd</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[gitlens]]></category>
            <category><![CDATA[visual-studio-code]]></category>
            <category><![CDATA[gitkraken]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Thu, 02 Oct 2025 11:17:28 GMT</pubDate>
            <atom:updated>2025-10-02T11:20:00.844Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxdgHhkwmbS6t96iM2risQ.png" /><figcaption>AI Generated image of Git being chaotic</figcaption></figure><p>Imagine you need to find out why a specific line of code was changed, and you let out a sigh. You switch over to your terminal, type out</p><pre>git log - pretty=oneline</pre><p>squint at a long list of commit hashes, copy-paste one, and then run</p><pre>git show &lt;hash&gt;</pre><p>or</p><pre>git blame &lt;file&gt;</pre><p>By the time you find what you’re looking for, your focus is GONE, and the context you had in your head is GONE.</p><p>Git is one of the most powerful tools in a developer’s arsenal. It’s the backbone of modern software development. But using it through the command line can feel like a chore. For years, I accepted this as a necessary.</p><p>Until I found <a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a>.</p><p>And yes, the title is a bit of a lie. I didn’t stop using Git. I stopped <em>fighting</em> with it. This single Visual Studio Code extension completely transformed my relationship with version control, moving it from a separate task to an integrated part of my coding environment.</p><blockquote>Notice that I am sharing this information not because I am affiliated by GitKraken in any way. I just like using the tool!</blockquote><h3>What is GitLens?</h3><p>Developed by GitKraken, <a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a> is the most popular Git extension on the VS Code Marketplace, and for good reason. It “supercharges” the Git capabilities built into VS Code, unlocking a level of understanding and efficiency I didn’t know was possible directly within my editor. It’s about bringing your code’s history to life, right where you need it most.</p><h3>Why I Ditched the Command Line: The Killer Features</h3><p><a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a> is packed with features, but a few core functionalities immediately made my terminal feel obsolete for day-to-day Git operations.</p><h4>1. Blame Annotations That Tell a Story</h4><p>Forget running git blame and trying to map line numbers. <a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a> subtly places an annotation at the end of your current line, telling you who last changed it, when, and the commit message. It’s unobtrusive but always there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*BJOG_ZppoE5k0ywk.png" /><figcaption>Blame annotations on GitLens</figcaption></figure><p>But the real magic happens when you hover over it. A rich pop-up appears with detailed information, including the author’s avatar, the full commit message, and clickable links to the commit, pull request, and even associated Jira or GitHub issues. This information is also conveniently available in your status bar. It turns every line of code into a historical artifact you can explore in seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*SMXpPlm6Qip2GgvI.png" /><figcaption>Hovered blame annotations on GitLens</figcaption></figure><h4>2. Time-Travel Through Your Code’s History</h4><p>Understanding how a file has evolved is crucial for debugging and refactoring. <a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a> offers several ways to do this without ever leaving your file.</p><ul><li><strong>File Blame View:</strong> See the blame information for every single line of a file at once.</li><li><strong>File Heatmap View:</strong> Visualize the age of your code. More recently changed lines appear “hotter” (in red/orange), while older, more stable code is “cooler” (in blue). This is fantastic for quickly identifying potential hotspots for bugs.</li><li><strong>Revision History:</strong> Easily compare the current version of a file with any previous version, side-by-side, to see exactly what changed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/0*hB7Cv05uLrgDB2Dh.png" /></figure><h4>3. A Smarter, More Integrated Workflow</h4><p>GitLens is built on the principle of reducing context switching.</p><ul><li><strong>Command Palettes:</strong> It introduces dedicated command palettes for both GitLens and general Git commands. Just type what you want to do (e.g., “Git: Create Branch”), and it guides you through the process.</li><li><strong>Interactive Terminal:</strong> Even the integrated VS Code terminal gets an upgrade. Commit hashes and other Git references become clickable links, opening up a menu of relevant actions.</li><li><strong>Search &amp; Compare:</strong> A dedicated view lets you search your entire repository history by message, author, file, or even specific code changes. You can also compare any two references (branches, tags, commits) to see a detailed breakdown of what’s different.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/0*10yl_0Ped02-DfPZ.gif" /></figure><h3>Your Quick Start Guide to GitLens</h3><p>Convinced? Here’s how to get started in under five minutes.</p><ul><li><strong>Installation:</strong> Open Visual Studio Code, go to the Extensions view (Ctrl+Shift+X), search for “<a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a>,” and click install. That’s it.</li><li><strong>Explore Blame:</strong> Open any file in a Git repository. You’ll immediately see a subtle blame annotation on your current line. Hover over it to see the rich details.</li><li><strong>Discover the Sidebar:</strong> Click the new <a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a> icon in your activity bar. This is your command center. Take a moment to explore the COMMITS, FILE HISTORY, and BRANCHES views.</li><li><strong>Try the Commit Graph:</strong> Find the Commit Graph icon in the bottom status bar or in the sidebar. Open it up and visualize your repository’s history. Even with the free version, this gives you powerful insights.</li><li><strong>Customize Your Experience:</strong> Dive into the <a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a> settings (found in the sidebar). You can tweak almost every feature to perfectly match your workflow.</li></ul><h3>The Verdict: It’s Still Git, Just Better</h3><p>GitLens didn’t make me quit Git. It made me fall in love with it all over again. By bringing its power directly and intuitively into my editor, it saved countless hours, and deepened my understanding of my own codebase.</p><p>It allows me to answer the “who, what, when, and why” of any line of code without breaking my focus. If you’re a developer using VS Code, stop wrestling with the command line! Install <a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens">GitLens</a>. Your future self will thank you.</p><h3>Check out my Telegram to learn more!</h3><p>If you liked my article, you can join my <a href="https://t.me/pythonhustlers">Telegram group</a>, where I share much some resources that will help you become a decent Python programmer!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/0*GNQJ_7poQw8ylJ_F.png" /><figcaption><a href="https://t.me/pythonhustlers">You can scan this QR code to join my free Telegram for free Python tutorials!</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c30c9734ccd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Follow This Python Guide And Never Commit Your API Key To Git!]]></title>
            <link>https://python.plainenglish.io/follow-this-python-guide-and-never-commit-your-api-key-to-git-3208972469bb?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/3208972469bb</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[api-key]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Thu, 25 Sep 2025 19:02:00 GMT</pubDate>
            <atom:updated>2025-09-28T02:01:54.317Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>A simple trick to make your Python projects more secure and easier to manage.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GbOMBjDV83XVK8ca0mOLPA.png" /><figcaption>AI Generated image of a monkey which (probably) commited her .env file to github</figcaption></figure><p>You’re working on a new Python project, you need an API key, so you create a .env file right inside your project folder and add it to your .gitignore.</p><p>It works, but it’s risky. What if you forget to add it to .gitignore? What if you copy the project and accidentally include the secrets? You could leak your credentials to the world.</p><p>There’s a much safer and cleaner way. <strong>Store all your secrets in one central place, completely outside your project folders.</strong></p><p>Let’s do it in two simple steps.</p><h3>Step 1: Create Your Secret Hideout 🔑</h3><p>First, we’ll create a single, hidden folder in your computer’s home directory. This folder will hold the .env files for <em>all</em> your projects.</p><p><strong>On Linux/Mac:</strong></p><p>Open your terminal and run this command:</p><pre>mkdir -p ~/Developer/.secrets</pre><p>The dot . at the beginning makes the folder hidden, keeping things tidy.</p><p>Now, let’s add a secret file. Inside your new ~/.secrets folder, I create a file named .env.openai with example API key inside, as well as .env.pexels file:</p><pre>cd ~/Developer/.secrets</pre><p>Open one of the files and add the API key like this:</p><pre>nano .env.openai</pre><p>Contents of the file:</p><pre>OPENAI_API_KEY=&quot;sk-yourapikeygoeshere12345&quot;</pre><p>Hit CTRL + O to save and CTRL + X to exit.</p><p>Save another file:</p><p>Open it:</p><pre>Hide Your Python Secretsnano .env.pexels</pre><p>Contents of the file:</p><pre>PEXELS_API_KEY=&quot;yourpexelsapikeyhere12345&quot;</pre><p>Hit CTRL + O to save and CTRL + X to exit.</p><p><strong>On Windows:</strong></p><p><em>On Windows, you can just create a folder named .secrets in your</em></p><p><em>C:\Users\YourUser</em></p><p><em>directory</em></p><p>Create files .env.openai with example API key inside, as well as .env.pexels file, fill it with the API keys like specified above.</p><h3>Step 2: Access Your Secrets in Python 🚀</h3><p>In your Python project, you’ll need the python-dotenv library. If you don’t have it, install it first:</p><pre>pip install python-dotenv</pre><p>In your Python code file, import the libraries:</p><pre>import os<br>from dotenv import dotenv_values</pre><p>Defining the secrets:</p><pre>secrets_dir = os.path.expanduser(&quot;~/Developer/.secrets&quot;)<br><br>config = {<br>    **dotenv_values(secrets_dir + &quot;/.env.openai&quot;),<br>    **dotenv_values(secrets_dir + &quot;/.env.pexels&quot;),<br>}</pre><p>Get the API keys like this:</p><pre>OPENAI_API_KEY = config.get(&quot;OPENAI_API_KEY&quot;)</pre><p>Example usage in a Jupyter notebook:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*Q-ZTryxjTwp7x26WUoy4_w.png" /><figcaption>Using self-stored API keys in Jupyter notebook</figcaption></figure><h3>Why is This So Much Better?</h3><ul><li><strong>🛡️ Bulletproof Security:</strong> Your secrets are never in your project folder, so you can’t accidentally commit them to Git. Ever.</li><li><strong>✨ Ultimate Convenience:</strong> All your keys (OpenAI, Stripe, Database, etc.) live in one place. No more copying .env files for every new project.</li><li><strong>🧹 Clean Projects:</strong> Your project directory stays clean and only contains code, not sensitive credentials.</li></ul><p>This tiny change in your workflow will save you headaches and dramatically improve your projects’ security.</p><p>Happy and secure coding!</p><h3>Check out my Telegram to learn more!</h3><p>If you liked my article, you can join my <a href="https://t.me/pythonhustlers">Telegram group</a>, where I share much more resources that will help you become a decent Python programmer!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/0*SK4e8YmrHeJ7KpXw.png" /></figure><p><a href="https://t.me/pythonhustlers">You can scan this QR code to join my free Telegram for free Python tutorials!</a></p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3208972469bb" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/follow-this-python-guide-and-never-commit-your-api-key-to-git-3208972469bb">Follow This Python Guide And Never Commit Your API Key To Git!</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interactive Teaching & Community Building With Python Programming Quizzes!]]></title>
            <link>https://python.plainenglish.io/interactive-teaching-community-building-with-python-programming-quizzes-5ae580be275b?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ae580be275b</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[social-media-growth]]></category>
            <category><![CDATA[ai-in-education]]></category>
            <category><![CDATA[educational-content]]></category>
            <category><![CDATA[quizzing]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Thu, 18 Sep 2025 10:19:46 GMT</pubDate>
            <atom:updated>2025-09-21T06:17:36.169Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NXbHGfwgkgFXoSPNTBCvFg.png" /><figcaption>Educational Instagram account results over a month</figcaption></figure><p>Whether you are programming educator, content creator, or a student, you likely have used AI in your learning or work. What if I told you quizzes can be one of the most engaging types of learning content for Python programming? I post Python programming quizzes daily on my Instagram <a href="https://www.instagram.com/pythonhustlers/">@pythonhustlers</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*jhLfi-PK1BDlC3ZWNCPYZA.png" /><figcaption>Python quiz in Python Hustlers Instagram</figcaption></figure><p>I gained thousands of followers with these posts already, <a href="https://www.instagram.com/pythonhustlers/">go check if you don’t believe it!</a></p><p>These quizzes are catchy and provide new information to the learner!</p><p>Although, it might seem a lot of work, especially if you need a lot of them, let me tell you my secret to making tons of them for my <a href="https://www.instagram.com/pythonhustlers/">Instagram account!</a></p><h3>Step 1: Go to Google AI Studio</h3><p>Go to <a href="https://aistudio.google.com/prompts/new_chat">Google AI Studio</a> following t<a href="https://aistudio.google.com/prompts/new_chat">his link</a>.</p><p>I use this tool because I can set up system message and receive consistent results this way. Also, it uses one of the most advanced Gemini 2.5 models for free!</p><p>You will only need Google account for this!</p><h3>Step 2: Start a new chat, set system prompt</h3><p>Start new chat, make sure you are using Gemini 2.5 pro.</p><p>Lookup where to find system prompt field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4cKC-fOMHoBlWR9RSW2B5Q.png" /><figcaption>Check the model and then add system prompt in Google AI Studio</figcaption></figure><p>Then add this chat system prompt to the dedicated field:</p><pre>write 50 ideas for quiz  content for instagram posts on python programming topics. They should be challenging and make the viewer think. You may or may not add a short code snippet for the question. Examples:<br><br>1)<br>Name: Checking for Types<br>Code:<br>data = [1, &quot;two&quot;, 3.0]<br>has_string = any(isinstance(x, str) for x in data)<br>print(has_string)<br><br>A) True<br>B) False<br>C) two<br>D) Error<br><br><br>Answer: A) True<br>Explanation: This is a concise way to check if any item in a list is of a certain type. The generator expression checks each item, and any() returns True as soon as it finds the string &quot;two&quot;.<br><br>2) <br><br>String .format_map()<br>Name: String Formatting with a Map<br>Code:<br><br>coords = {&#39;x&#39;: 10, &#39;y&#39;: 20}<br><br>print(&quot;Point({x}, {y})&quot;.format_map(coords))<br><br>A) Point(x, y)<br>B) Point(10, 20)<br>C) Point({&#39;x&#39;: 10, &#39;y&#39;: 20})<br>D) Error<br><br>Answer: B) Point(10, 20)<br>Explanation: .format_map() is similar to .format() but takes a dictionary (or other mapping) and uses its keys to fill the placeholders.<br><br>...<br><br>and so on...<br><br>Use inspiration for questions in the uploaded pdfs as they are based on cbse cirriculum.<br>Make sure to cover ALL the topics in the pdf as they are based on cbse curriculum, specify which topics each question matches.<br><br>provide &quot;what is printed&quot; kind of questions if it is with python code, they, all should be &quot;what is printed&quot; type with four options, answer and explanation!<br><br>I it is conceptual (general computer science, not necessarily python only, then no need for code snippet.<br><br>If there is code, then add code snippet, if there is nothing code related, don&#39;t<br><br>Make sure that the code snippets are short, maximum few lines, but best couple of lines!<br><br>Make sure to include all the answer options:, A), B), C), D)</pre><p>You can edit the prompt as you like. This one asks to follow a particular curriculum. But you might not want that. This prompt also makes not necessarily code questions, sometimes general questions, which can be changed. So edit it as you like!</p><h3>Step 3: Upload PDF files, which you want to use as references for your quizzes for better results</h3><p>If you have some sort of curriculum to follow or maybe want to use a good programming book as a reference, go ahead! This enhances quizzes a lot!</p><p>You can just Google “Python programming pdf” to get the resources:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YmV6ojx8-lUH6t6VKb8wyg.png" /><figcaption>Google search results for “Python programming pdf”</figcaption></figure><p>You can then download wanted PDFs and upload them to the Google AI studio chat:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*hO2QY47Wk2OsrVwszU8uBQ.png" /></figure><p>Now it will use your uploaded PDFs as a reference.</p><h3>Step 4: Generate the questions</h3><p>Now, the only step left to do is to request Gemini to generate some quizzes. Notice that you can still impact what questions you want to make, maybe you want to focus more on lists or libraries like numpy?</p><p>Example prompt:</p><pre>Generate the questions for Python programming, based on the pdf uploaded. <br>Focus more on lists or libraries like numpy</pre><p>Example responses:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*495eBsOCZ4C9enRSZAAwVQ.png" /><figcaption>Example responses for Python quizzes in Google AI Studio</figcaption></figure><p>You will receive questions with this structure:</p><ul><li>Name</li><li>Topic</li><li>Code snippet</li><li>Answer options</li><li>Correct answer</li><li>Explanation</li></ul><h3>Step 5: Select your favorite questions, validate and use them!</h3><p>Since the results are AI generated, it is important to select the ones you think provide the most value. Also, validate if the answer and explanation are correct. For code questions, I use Python compiler like <a href="https://code.visualstudio.com/">Visual Studio Code</a> or <a href="https://www.onlinegdb.com/online_python_compiler">Online GDB </a>to check if the result provided by Gemini is correct after the compilation.</p><p>Now you can use the quizzes for your students or for social media posts like I do. They provide a lot of value!</p><h3>Check out my Telegram to learn more!</h3><p>If you liked my article, you can join my <a href="https://t.me/pythonhustlers">Telegram group</a>, where I share much more resources that will help you become a decent Python programmer!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/0*q_srXVhWhSRWL88_.png" /></figure><p><a href="https://t.me/pythonhustlers">You can scan this QR code to join my free Telegram for free Python tutorials!</a></p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ae580be275b" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/interactive-teaching-community-building-with-python-programming-quizzes-5ae580be275b">Interactive Teaching &amp; Community Building With Python Programming Quizzes!</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Free AI API, Text, Image and Speech Generation In Python!]]></title>
            <link>https://python.plainenglish.io/free-ai-api-text-image-and-speech-generation-in-python-2387bd1ff265?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/2387bd1ff265</guid>
            <category><![CDATA[python-ai]]></category>
            <category><![CDATA[ai-voice-generator]]></category>
            <category><![CDATA[ai-image-generator]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[text-to-speech]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Fri, 12 Sep 2025 09:35:31 GMT</pubDate>
            <atom:updated>2025-09-15T01:09:01.227Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve not been asleep the last 3 years, you know what was the hype. Although making lots of mistakes, AI tools did change the way people look for information, study or even work. This is where developers could try making interesting projects as well. The main drawback was that it can be free for the user, but not for developer.</p><p>But don’t worry! There are free options! In this article, I cover one of them, you will be able to use text generation, image generation, voice generation and recognition in Python!</p><h3>The project: Pollinations</h3><p>Before I begin, I have to shout out to the project named <a href="https://pollinations.ai/">Pollinations</a>, which provides the free APIs for everyone in the first case. <a href="https://pollinations.ai/">Pollinations.AI </a>is an open-source platform with <em>easy</em> text &amp; image generation APIs, <strong>no sign-ups or API keys needed</strong>! 🔐✨ It now can also work with voice!</p><p>You can also read the <a href="http://github.com/pollinations/pollinations/blob/master/APIDOCS.md#tiers--rate-limits">project’s documentation</a>.</p><h3>Text generation using Pollinations</h3><p>The most classic use is text-to-text generation. Here is a Python example on how to do it using <a href="https://pollinations.ai/">Pollinations</a>:</p><p>First, we need to install <a href="https://www.python.org/">Python</a>, open the editor and import &amp; install all the necessary libraries. For text generation, we need to make sure we have the <em>requests</em> library installed:</p><pre>pip install requests</pre><p>Next, we need to make a new .py code file and add imports:</p><pre>import random<br>import requests</pre><p>Then we add this method that calls the Pollinations API and receives the answer as text response:</p><pre>def generate_text(prompt, system_prompt=&#39;&#39;):<br>        url = &quot;https://text.pollinations.ai&quot;<br><br>        try:<br>            data = {<br>                &quot;messages&quot;: [<br>                    {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: system_prompt},<br>                    {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: prompt}<br>                ],<br>                &quot;model&quot;: &quot;openai&quot;,<br>                &quot;seed&quot;: random.randint(1, 999999999),<br>                &quot;jsonMode&quot;: False,<br>                &quot;private&quot;: True,<br>                &quot;stream&quot;: False<br>            }<br>            response = requests.post(url, json=data, stream=True)<br>            if response.status_code == 200:<br>                return response.text<br>            else:<br>                print(f&quot;Failed to generate text. Status code: {response.status_code}.&quot;)<br>        except Exception as e:<br>            print(f&quot;Request failed: {e}.&quot;)</pre><p>Now, we can call this method, providing the prompt:</p><pre>response = generate_text(&quot;Is Dua Lipa a doctor?&quot;)<br>print(response)</pre><p>The response:</p><blockquote>No. Dua Lipa is a British singer and songwriter, not a medical doctor. She hasn’t earned a medical degree or a professional doctorate. (If you’re asking about honorary doctorates, there isn’t widely reported evidence that she has one.)</blockquote><p>As you notice in the code, there is the <em>role</em> value in the dictionary of data, which you can use to make chatbots like <em>ChatGPT.</em></p><p>And that is how you can add text generation to your applications for free!</p><h3>Image generation using Pollinations</h3><p>Yes! You can also generate images using the <em>flux</em> model with <a href="https://pollinations.ai/">Pollinations</a>!</p><p>Once again, make sure you have requests library installed.</p><pre>pip install requests</pre><p>No, you have to import the libraries into your .py file:</p><pre>import random<br>import requests<br>import os<br>from datetime import datetime<br>import urllib.parse</pre><p>Then we add this method that calls the Pollinations API and receives the answer as image stream:</p><pre>def generate_image(prompt, save_path, width=1080, height=1920, enhance=True):<br>    params = {<br>    &quot;safe&quot;: True,<br>    &quot;seed&quot;: random.randint(1, 999999999),<br>    &quot;width&quot;: width,<br>    &quot;height&quot;: height,<br>    &quot;nologo&quot;: True,<br>    &quot;private&quot;: True,<br>    &quot;model&quot;: &quot;flux&quot;,<br>    &quot;enhance&quot;: enhance,<br>    &quot;referrer&quot;: &quot;pollinations.py&quot;<br>    }<br><br>    encoded_prompt = urllib.parse.quote(prompt)<br>    query_params = &quot;&amp;&quot;.join(f&quot;{k}={v}&quot; for k, v in params.items())<br>    url = f&quot;https://image.pollinations.ai/prompt/{encoded_prompt}?{query_params}&quot;<br><br>    try:<br>        response = requests.get(<br>            url=url,<br>            headers={&quot;Content-Type&quot;: &quot;application/json&quot;},<br>            timeout=60<br>        )<br>        if response.status_code == 200:<br>            timestamp = datetime.now().strftime(&quot;%Y%m%d_%H%M%S&quot;)<br>            image_save_name = f&quot;img_{timestamp}.png&quot;<br>            image_save_path = os.path.join(save_path, image_save_name)<br>            os.makedirs(os.path.dirname(image_save_path), exist_ok=True)<br>            with open(image_save_path, &#39;wb&#39;) as f:<br>                f.write(response.content)<br>            return image_save_path<br>        else:<br>            print(f&quot;Failed to generate image. Status code: {response.status_code}.&quot;)<br>    except requests.RequestException as e:<br>        print(f&quot;Request failed: {e}.&quot;)</pre><p>As we see in the <em>params</em> dictionary, you can add parameters like:</p><p>safe — makes sure to avoid NSFW results</p><p>seed — Makes sure the results are unique. Use the same number if you want repeatable results</p><p>width, height — resolution of the image</p><p>nologo — remove Pollinations logo automatically</p><p>private — specifies if you want to include the request in a public log</p><p>model — image generation model</p><p>enhance — automatically enhances the prompt</p><p>referrer — reference who is calling the API</p><p>Here is the example use of the method:</p><pre>image_prompt = &quot;Python programming language Logo. Bees flying in the background. Ultra realistic&quot;<br># 2. Get the current working directory<br>current_directory = os.getcwd()<br>generate_image(prompt=image_prompt, save_path=current_directory, width=1000, height=1000, enhance=False)</pre><p>The result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*4unTgyhv8O39722Pja9VpA.png" /><figcaption>AI generated image from Pollinations.ai API</figcaption></figure><h3>Text-To-Speech example</h3><p>I added the example for generating AI voiceover and enhancing it in Python in my <a href="https://t.me/pythonhustlers">FREE Telegram group!</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*lgqZppjM8GYC5NrA0nHcxw.png" /><figcaption>Text-To-Speech full example in my Telegram group!</figcaption></figure><p><a href="https://t.me/pythonhustlers">And there I also share full code files that you can use right away!</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/0*seiM633pTxAHIXXg.png" /><figcaption><a href="https://t.me/pythonhustlers">You can scan this QR code to join my free Telegram for free t</a>ext-to-speech code!</figcaption></figure><h3>⚠️ Drawbacks:</h3><p>❌ The API might rarely be under maintenance, then you have to wait patiently<br>❌ There are limits to the API, <a href="https://github.com/pollinations/pollinations/blob/master/APIDOCS.md#tiers--rate-limits">read here</a><br>❌ There might be some breaking changes. Join <a href="https://discord.com/invite/k9F7SyTgqn">Pollinations Discord</a> to discuss the<br>❌ For the maximum privacy, opt for paid enterprise APIs</p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2387bd1ff265" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/free-ai-api-text-image-and-speech-generation-in-python-2387bd1ff265">Free AI API, Text, Image and Speech Generation In Python!</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is Pythonic coding just a glorified gatekeeping?]]></title>
            <link>https://python.plainenglish.io/is-pythonic-coding-just-a-glorified-gatekeeping-05c36774cef5?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/05c36774cef5</guid>
            <category><![CDATA[pythonic]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-libraries]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Thu, 04 Sep 2025 10:10:05 GMT</pubDate>
            <atom:updated>2025-09-10T00:22:21.361Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDY_O4Ks3EQ5OqPmYZzlDw.jpeg" /><figcaption>AI-Generated gatekeeping Python developer</figcaption></figure><p>The word “<em>Pythonic”</em> is mostly referred as a way to use cleaner code practices in your code, using Python’s shortcuts and special functions.</p><h3>Is “Pythonic” just a glorified gatekeeping?</h3><p>Ever written a piece of Python code that worked flawlessly, only to be told it wasn’t <em>“Pythonic” </em>enough? This term is often held up as the gold standard, representing the art of writing clean, readable, and efficient code that matches Python’s core philosophy.</p><p>This article moves beyond theory to show you <em>“Pythonic” </em>best practices in action, breaking down the specific techniques that separate functional code from truly exceptional code. We’ll explore practical examples, from mastering list comprehensions to handling exceptions gracefully, that you can apply immediately to make your own code more efficient and readable.</p><h3><strong>1. Your code should be just a logical English text</strong></h3><p>Instead of using any complex variable naming methods, just think of English word for it and use it!</p><p>Bad example:</p><pre>def proc_data(d):<br> return [i for i in d if i.startswith(&#39;ERR&#39;)]</pre><p>Better:</p><pre>def find_error_messages(log_entries):<br>    return [entry for entry in log_entries if entry.startswith(&#39;ERR&#39;)]your</pre><p>Suddenly, the code is more self-explanatory!</p><h3>2. Use built-in functions instead of writing them from scratch. Example: list comprehensions.</h3><p>This code works:</p><pre>words = [&quot;hello&quot;, &quot;world&quot;, &quot;this&quot;, &quot;is&quot;, &quot;python&quot;]<br>sentence = &quot;&quot;<br>for word in words:<br>    sentence += word + &quot; &quot;<br>sentence = sentence.strip() # Need to manually remove the last space</pre><p>But this is much cleaner by using the built-in str.join() method:</p><pre>words = [&quot;hello&quot;, &quot;world&quot;, &quot;this&quot;, &quot;is&quot;, &quot;python&quot;]<br>sentence = &quot; &quot;.join(words)</pre><p>Or for even numbers:</p><pre>numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<br>even_numbers = []<br>for num in numbers:<br>    if num % 2 == 0:<br>        even_numbers.append(num)</pre><p>You can use list comprehensions as well:</p><pre># Better:<br>numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]<br>even_numbers = [num for num in numbers if num % 2 == 0]</pre><blockquote>Keep comprehensions simple. When they get too complex(multi-level iterations), a for loop is clearer.</blockquote><h3>3. Loop Like a Pro with enumerate and zip</h3><p>Manual indexing:</p><pre>planets = [&#39;Mercury&#39;, &#39;Venus&#39;, &#39;Earth&#39;, &#39;Mars&#39;]<br>i = 0<br>for planet in planets:<br>    print(f&quot;Planet {i}: {planet}&quot;)<br>    i += 1</pre><p>You can use automatic indexing in Python instead:</p><pre>planets = [&#39;Mercury&#39;, &#39;Venus&#39;, &#39;Earth&#39;, &#39;Mars&#39;]<br>for index, planet in enumerate(planets):<br>    print(f&quot;Planet {index}: {planet}&quot;)</pre><p>Similarly, if you need to loop over multiple lists at the same time, zip() is the perfect tool. It pairs up the elements for you.</p><pre># Zipping two lists together<br>astronauts = [&#39;Armstrong&#39;, &#39;Aldrin&#39;, &#39;Collins&#39;]<br>missions = [&#39;Apollo 11&#39;, &#39;Apollo 11&#39;, &#39;Apollo 11&#39;]<br><br>for astronaut, mission in zip(astronauts, missions):<br>    print(f&quot;{astronaut} was on the {mission} mission.&quot;)</pre><h3>4. Swap Variables in a Single Line</h3><p>The old way:</p><pre># The old way<br>width = 1920<br>height = 1080<br><br>temp = width<br>width = height<br>height = temp</pre><p>Pythonic way of swapping:</p><pre>width, height = height, width</pre><h3>5. Handle Files Safely using with Statements</h3><p>Risky: file might not be closed if an error happens</p><pre>f = open(&#39;config.txt&#39;, &#39;r&#39;)<br>config_data = f.read()<br># ... what if an error happens here? ...<br>f.close()</pre><p>Better: The with statement creates a self-managing context that guarantees the file will be closed, even if errors pop up.</p><pre>with open(&#39;config.txt&#39;, &#39;r&#39;) as f:<br>    config_data = f.read()<br># The file is automatically closed here!</pre><h3>6. Safely Access Dictionary Keys with .get()</h3><p>Accessing a dictionary key that doesn’t exist will crash your program with a KeyError. A common way to prevent this is to check if the key exists first, but this is verbose.</p><pre>user_preferences = {&#39;font_size&#39;: 12, &#39;language&#39;: &#39;en&#39;}<br><br>if &#39;theme&#39; in user_preferences:<br>    theme = user_preferences[&#39;theme&#39;]<br>else:<br>    theme = &#39;dark&#39; # Manually setting a default</pre><p>Python dictionaries have a built-in .get() method that handles this gracefully in one line. It tries to get the key and returns a default value you provide if it’s not found.</p><pre>user_preferences = {&#39;font_size&#39;: 12, &#39;language&#39;: &#39;en&#39;}<br>theme = user_preferences.get(&#39;theme&#39;, &#39;dark&#39;) # Returns &#39;dark&#39; if &#39;theme&#39; key is missing</pre><h3>7. Use Python’s “Truthiness” for Cleaner Checks</h3><p>In Python, empty objects (like an empty list [], an empty string “”, or the number 0) are considered “falsy,” while non-empty objects are “truthy.” You can use this to simplify your conditional statements.</p><p>Overly explicit and not Pythonic:</p><pre>active_users = [&#39;Alice&#39;, &#39;Bob&#39;]<br>if len(active_users) &gt; 0:<br>    print(&quot;There are active users online.&quot;)</pre><p>Better:</p><pre>active_users = [&#39;Alice&#39;, &#39;Bob&#39;]<br>if active_users: # The list is not empty, so it&#39;s &#39;True&#39;<br>    print(&quot;There are active users online.&quot;)</pre><p>This also applies to checking for None. The preferred way is to use is None, which checks for object identity, not just value.</p><p>Avoid:</p><pre>if result == None:<br>    print(&quot;No result found.&quot;)</pre><p>Better:</p><pre>if result is None:<br>    print(&quot;No result found.&quot;)</pre><h3>8. Use F-Strings for Clean and Fast Formatting</h3><p>For years, Python developers combined strings using + or the .format() method. While they work, f-strings (formatted string literals) are now the standard because they are more readable and faster.</p><p>Old ways, a bit clunky:</p><pre>name = &quot;Ada Lovelace&quot;<br>year = 1815<br>print(&quot;The programmer &quot; + name + &quot; was born in &quot; + str(year) + &quot;.&quot;)<br>print(&quot;The programmer {} was born in {}.&quot;.format(name, year))</pre><p>The f-string syntax is cleaner, allowing you to embed expressions directly inside the string.</p><pre>name = &quot;Ada Lovelace&quot;<br>year = 1815<br>print(f&quot;The programmer {name} was born in {year}.&quot;)</pre><h3>9. Condense Simple if/else Blocks with Conditional Expressions</h3><p>When you need to assign a value to a variable based on a single condition, a full if/else statement can feel bulky:</p><pre>user_is_active = True<br>if user_is_active:<br>    status_color = &quot;green&quot;<br>else:<br>    status_color = &quot;red&quot;</pre><p>Python’s conditional expression (often called a “ternary operator”) lets you do this in one elegant, readable line:</p><pre>status_color = &quot;green&quot; if user_is_active else &quot;red&quot;</pre><h3>10. Prefer Asking for Forgiveness, Not Permission (EAFP)</h3><p>This is a core philosophical principle in Python. Instead of checking if something is possible <em>before</em> you do it (Look Before You Leap, or LBYL), you should just try to do it and handle the error if it fails (Easier to Ask for Forgiveness than Permission, or EAFP).</p><p>LBYL: Check first, then act:</p><pre>data = {&quot;name&quot;: &quot;Grace Hopper&quot;}<br>if &quot;age&quot; in data:<br>    age = data[&quot;age&quot;]<br>else:<br>    age = None</pre><p>The Pythonic EAFP approach is often cleaner and can be more efficient, as it assumes the common case will succeed.</p><p>EAFP: Act first, handle potential errors:</p><pre>data = {&quot;name&quot;: &quot;Grace Hopper&quot;}<br>try:<br>    age = data[&quot;age&quot;]<br>except KeyError:<br>    age = None</pre><h3>11. Follow the Official Style Guide: PEP 8</h3><p>Perhaps the most fundamental aspect of writing Pythonic code is adhering to <a href="https://peps.python.org/pep-0008/"><strong>PEP 8</strong></a>, Python’s official style guide. It’s the <a href="https://peps.python.org/pep-0008/">rulebook</a> for formatting that keeps code across the community consistent and readable.</p><p>It covers guidelines such as:</p><ul><li>Using 4 spaces for indentation.</li><li>Naming variables and functions with snake_case.</li><li>Naming classes with CamelCase.</li><li>Keeping lines under 79–99 characters.</li></ul><p>You don’t need to memorize it all. Modern code tools and wrappers like <a href="https://pypi.org/project/flake8/">flake8</a> and <a href="https://pypi.org/project/black/">black</a> can automatically check and format your code to follow these rules, making it effortless to write clean, professional Python.</p><h3>The Pythonic Checklist from this article</h3><blockquote>So, is “Pythonic” coding just glorified gatekeeping? It only becomes gatekeeping when the label is valued more than the reason.</blockquote><p>✅ <strong>Readability:</strong> Write clear, self-explanatory code.</p><p>✅ <strong>Comprehensions:</strong> Use for concise list/dict creation.</p><p>✅ <strong>enumerate / zip:</strong> For cleaner, index-free loops.</p><p>✅ <strong>Unpacking:</strong> For elegant variable swaps and assignments.</p><p>✅ <strong>with Statement:</strong> For safe, automatic resource management.</p><p>✅ <strong>.get():</strong> For safely accessing dictionary keys.</p><p>✅ <strong>Truthiness:</strong> Use for clean boolean checks.</p><p>✅ <strong>F-Strings:</strong> For modern, readable string formatting.</p><p>✅ <strong>Ternary Expressions:</strong> For simple conditional assignments.</p><p>✅ <strong>EAFP:</strong> Use try/except for cleaner error handling.</p><p>✅ <strong>PEP 8:</strong> The official style guide for consistency.</p><h3>Check out my Telegram to learn more!</h3><p>If you liked my article, you can join my <a href="https://t.me/pythonhustlers">Telegram group</a>, where I share much more resources that will help you become a decent Python programmer!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*xjN96ri-cjjoiFX463OQvA.png" /><figcaption><a href="https://t.me/pythonhustlers">You can scan this QR code to join my free Telegram for free VPN and bot tutorial!</a></figcaption></figure><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05c36774cef5" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/is-pythonic-coding-just-a-glorified-gatekeeping-05c36774cef5">Is Pythonic coding just a glorified gatekeeping?</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Save over $100 per year on a Linux Server and VPN!]]></title>
            <link>https://medium.com/@tomasstakeviius/save-over-100-per-year-on-a-linux-server-and-vpn-1c95141ae8bf?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c95141ae8bf</guid>
            <category><![CDATA[vpn]]></category>
            <category><![CDATA[free-vpn]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[oracle]]></category>
            <category><![CDATA[telegram-bot]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Wed, 27 Aug 2025 12:54:34 GMT</pubDate>
            <atom:updated>2025-08-27T12:54:34.713Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EFJiF9ltUQ4WPO5xLEhidw.png" /><figcaption>ChatGPT generated image of Linux penguin roaming freely in Antarctica, using my solution in this article</figcaption></figure><p>If you ever needed to host some scripts, a bot, or maybe interested in setting up your own VPN, this article is a great start for you!</p><p>Several Cloud providers offer free options for a small server for testing, but my favorite one, that I use is on <a href="https://cloud.oracle.com/">Oracle Cloud</a>!</p><h3>Before you begin</h3><p>There is only one prerequisite you need to fulfill in order to use the Always FREE tier in <a href="https://cloud.oracle.com/">Oracle Cloud</a>:</p><ul><li><strong>Have a credit/debit card with your name on it for verification</strong></li></ul><p>You will only need it once and you won’t be charged anything, as long as you keep using the always free tier.</p><blockquote>Important note: “We do not accept virtual cards or prepaid cards. We accept credit cards and debit cards only.”</blockquote><h3><strong>Step 1: Register on </strong><a href="https://cloud.oracle.com/">Oracle Cloud</a>:</h3><p>You must first create an account with your <strong>correct</strong> deatails on <a href="https://signup.cloud.oracle.com/">Oracle Cloud</a>.</p><blockquote>You will need a valid credit card with your name (the same you used for registration) for signup, “We do not accept virtual cards or prepaid cards. We accept credit cards and debit cards only.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZjZoid7KQFo-nl08-csd9A.png" /><figcaption>Oracle Cloud sign up form</figcaption></figure><h3>Step 2: Pick the region (IMPORTANT IF YOU WANT TO SET UP A VPN AS WELL!!):</h3><p>In theory, you should pick the region on the cloud that is closest to your actual location.</p><blockquote>But if you want to set up an actual VPN with the server later, it is important to set the location to where you want your VPN to be. In my case, I selected United States for VPN, even though I live in Europe.</blockquote><p>It is <strong>IMPORTANT</strong> to select the right location, because you can only do this <strong>ONCE</strong>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MmuuF5FQSELO_NXdhHkonQ.jpeg" /><figcaption>Selected Oracle Cloud location</figcaption></figure><h3>Step 3: Creating a Linux virtual machine instance:</h3><p>In the home menu of Oracle Cloud, there should be an option to “Create a VM instance”. Click on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvBIaq4zbtJsPmQ1qhqBNA.jpeg" /><figcaption>Creating a VM instance</figcaption></figure><p>Now, you need to select your OS. Pick Ubuntu or just keep the defaults. But make sure it is free if you want a free VPS!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ld7dEv-H8Rt7aPIMk7kdtA.png" /><figcaption>Selecting image and shape</figcaption></figure><p>Now you can click Next until the <strong>Networking</strong> part. <strong>There you MUST download private and public SSH keys!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bEPeuLVKJVlS7tkg_sFOFQ.jpeg" /><figcaption>Getting the SSH keys</figcaption></figure><p>When creating the instance, you are very likely to encounter error, which says something like that:</p><blockquote>Out of capacity for shape VM.Standard.A1.Flex in availability domain AD-1. Create the instance in a different availability domain or try again later.If you specified a fault domain, try creating the instance without specifying a fault domain. If that doesn’t work, please try again later.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*whshVV1gkJLNMEzDS1Z1mQ.jpeg" /></figure><p>In that case, you can switch your account to paid tier, but still don’t pay anything. Then the account is no longer free. But it does have free resources. If you only use them, you pay nothing.</p><h3>Step 4: Connecting to your Linux server using SSH:</h3><p>Once you have created the server, you need to go to the I<a href="https://cloud.oracle.com/compute/instances">nstances page on Oracle Cloud</a> and check if it is running. There you will need to copy the public IP address!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ri-tdmQPw4BIFiS7pnz1rg.jpeg" /><figcaption>Instances page</figcaption></figure><p>You will also need username. We can get it by clicking on the name of the instance in the instances list. In my case, it is <em>ubuntu</em>, yours might be different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QuLJPD5dJoy6YAv_bYleBw.jpeg" /><figcaption>Instance details with username and public IP for SSH</figcaption></figure><p>Now, we need to connect to the machine via SSH. It is different for Linux/MacOS and Windows.</p><h3>Linux / macOS (Terminal)</h3><p><strong>Create .ssh directory (if it doesn’t exist):</strong></p><pre>mkdir -p ~/.ssh</pre><p><strong>Move your private key to the .ssh directory:</strong><br><em>(Example assumes your key is in Downloads. Adjust /path/to/ if different.)</em></p><pre>mv ~/Downloads/your_actual_key_file ~/.ssh/</pre><ul><li>goodmv ~/Downloads/your_actual_key_file ~/.ssh/</li></ul><p><strong>Set correct permissions for your private key:</strong></p><pre>chmod 600 ~/.ssh/your_actual_key_file</pre><p><strong>Connect to your server:</strong></p><pre>ssh -i ~/.ssh/your_actual_key_file your_server_username@your_server_ip</pre><h3>Windows (PowerShell/CMD — Built-in OpenSSH Client)</h3><p><strong>Create .ssh directory (if it doesn’t exist):</strong></p><p><em>(Replace YourWindowsUsername with your actual Windows user account name, e.g., JohnDoe)</em></p><pre>mkdir C:\Users\YourWindowsUsername\.ssh</pre><ul><li>mkdir C:\Users\YourWindowsUsername\.ssh</li></ul><p><strong>Copy your private key to the .ssh directory:</strong><br><em>(Example assumes your key is in Downloads. Adjust /path/to/ if different.)</em></p><pre>Copy-Item &quot;C:\Users\YourWindowsUsername\Downloads\your_actual_key_file&quot; &quot;C:\Users\YourWindowsUsername\.ssh\&quot;</pre><p><em>(Alternatively, just drag-and-drop the file using File Explorer)</em></p><p><strong>Set correct permissions for your private key (Run PowerShell as Administrator for these commands):</strong><br><em>(Replace YourWindowsUsername and your_actual_key_file)</em></p><pre>icacls C:\Users\YourWindowsUsername\.ssh\your_actual_key_file /inheritance:r icacls C:\Users\YourWindowsUsername\.ssh\your_actual_key_file /grant:r YourWindowsUsername:(R)</pre><ul><li>icacls C:\Users\YourWindowsUsername\.ssh\your_actual_key_file /inheritance:r icacls C:\Users\YourWindowsUsername\.ssh\your_actual_key_file /grant:r YourWindowsUsername:(R)</li></ul><p><strong>Connect to your server (from a regular PowerShell or CMD window):</strong><br><em>(Replace YourWindowsUsername, your_actual_key_file, your_ubuntu_username, your_server_ip)</em></p><pre>ssh -i C:\Users\YourWindowsUsername\.ssh\your_actual_key_file your_server_username@your_server_ip</pre><p>That’s it! Once connected successfully, you should be able to use the server’s command line and build all sorts of things there, deploy apps, bots, even your own free VPN!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*HzRjHQfOq90ySskT7fUoxA.jpeg" /><figcaption>The view once connected with SSH will looks something like this</figcaption></figure><h3>Next steps: Adding a free VPN and Building your own Telegram bot!</h3><p>I share these tutorials on my free <a href="https://t.me/pythonhustlers">Telegram group</a>!</p><p>Make sure to <a href="https://t.me/pythonhustlers">check them out!</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Css55ek9IfIQTCCwBx-jQQ.png" /><figcaption><a href="https://t.me/pythonhustlers">You can scan this QR code to join my free Telegram for free VPN and bot tutorial!</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c95141ae8bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Your Own Realistic AI Image Generator in Python — For Free (No API Keys Required)]]></title>
            <link>https://python.plainenglish.io/creating-your-own-realistic-ai-image-generator-in-python-for-free-no-api-keys-required-f2f8d2b00d35?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2f8d2b00d35</guid>
            <category><![CDATA[image-generation]]></category>
            <category><![CDATA[ai-image-generator]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[flux]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Wed, 05 Feb 2025 21:05:44 GMT</pubDate>
            <atom:updated>2025-09-12T09:37:23.328Z</atom:updated>
            <content:encoded><![CDATA[<h3>Creating Your Own Realistic AI Image Generator in Python — For Free (No API Keys Required)</h3><p><a href="https://medium.com/@tomasstakeviius/free-ai-api-text-image-and-speech-generation-in-python-2387bd1ff265"><strong>WARNING! THIS METHOD IS DEPRACATED! USE CODE FROM MY NEW ARTICLE!</strong></a></p><p>The rise of AI image generation has opened up endless creative possibilities, but many tools require paid subscriptions or restrictive API keys. What if you could build your own AI image generator for free, using Python, without relying on third-party APIs? In this tutorial, I’ll show you how to do exactly that using a clever workaround with open-source resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Qr8HQUK-6UbjNVEorquAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgVTLZalyAQvF5QKmv2baQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1x_qWyUIYVI4k8W6Zfs63A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQmXDMVDxCeWTWTbFkKnZw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ode8KNGA5j7H_ldJSmXfRA.png" /><figcaption>AI generated images using the tool from pollinations.ai</figcaption></figure><h3>Why This Approach Works</h3><p>We’ll leverage the free and publicly accessible service from <strong>pollinations.ai</strong>, a platform that provides AI-generated images through simple URL requests. By reverse-engineering their API, we can generate high-quality images programmatically — no API keys or payments required. The best part? You’ll have full control over the prompts, outputs, and customization.</p><h3>Prerequisites</h3><ol><li>Basic Python knowledge.</li><li>Python installed on your machine.</li><li>The following libraries:</li></ol><ul><li>pillow (for image processing)</li><li>requests (for HTTP requests)</li></ul><p>Install them via pip:</p><pre>pip install pillow requests</pre><h3>Step 1: The Code Setup</h3><p><a href="https://medium.com/@tomasstakeviius/free-ai-api-text-image-and-speech-generation-in-python-2387bd1ff265"><strong>WARNING! THIS METHOD IS DEPRACATED! USE CODE FROM MY NEW ARTICLE!</strong></a></p><p>Here’s the complete Python script. Let’s break it down:</p><pre>from datetime import datetime<br>import time<br>import os<br>import uuid<br>from PIL import Image<br>import requests<br><br>def generate_images_pollynation_ai(prompt, save_path):<br>    prompt += str(uuid.uuid4())  # Ensure unique prompts to bypass caching<br>    formatted_prompt = prompt.replace(&quot; &quot;, &quot;-&quot;)<br>    url = f&quot;https://image.pollinations.ai/prompt/{formatted_prompt}&quot;<br><br>    while True:<br>        try:<br>            response = requests.get(url)<br>            if response.status_code == 200:<br>                timestamp = datetime.now().strftime(&quot;%Y%m%d_%H%M%S&quot;)<br>                image_save_name = f&quot;img_{timestamp}.png&quot;<br>                image_save_path = os.path.join(save_path, image_save_name)<br>                os.makedirs(os.path.dirname(image_save_path), exist_ok=True)<br>                <br>                with open(image_save_path, &#39;wb&#39;) as f:<br>                    f.write(response.content)<br>                <br>                # Crop watermark/artifacts (adjust as needed)<br>                image = Image.open(image_save_path)<br>                image = image.crop((0, 0, image.width, image.height - 48))<br>                cropped_image = image.crop((0, 0, image.width, image.height - 100))<br>                cropped_image.save(image_save_path)<br>                <br>                return image_save_path<br>            else:<br>                print(f&quot;Retrying... Status code: {response.status_code}&quot;)<br>        except requests.RequestException as e:<br>            print(f&quot;Request failed: {e}. Retrying...&quot;)<br>        time.sleep(5)  # Avoid rate-limiting<br><br>if __name__ == &quot;__main__&quot;:<br>    prompts = [<br>        &quot;A futuristic cityscape with neon lights&quot;,<br>        &quot;A cyberpunk street with flying cars&quot;,<br>        &quot;An alien planet with strange creatures&quot;,<br>        # Add your own prompts here!<br>    ]<br>    <br>    save_path = &quot;generated_images&quot;<br>    os.makedirs(save_path, exist_ok=True)<br>    <br>    for prompt in prompts:<br>        image_path = generate_images_pollynation_ai(prompt, save_path)<br>        print(f&quot;Generated: {image_path}&quot;)</pre><h3>Step 2: How It Works</h3><p><a href="https://medium.com/@tomasstakeviius/free-ai-api-text-image-and-speech-generation-in-python-2387bd1ff265"><strong>WARNING! THIS METHOD IS DEPRACATED! USE CODE FROM MY NEW ARTICLE!</strong></a></p><ol><li><strong>Unique Prompts</strong>: By appending a UUID (a random unique identifier) to each prompt, we ensure the URL is always unique, preventing cached or repeated images.</li><li><strong>URL Construction</strong>: The prompt is formatted into a URL (e.g., https://image.pollinations.ai/prompt/a-magical-forest-&lt;uuid&gt;).</li><li><strong>Image Cropping</strong>: Pollinations.ai adds a small watermark at the bottom. We crop the image to remove it (adjust the pixel values in crop() as needed).</li><li><strong>Retry Logic</strong>: If the request fails (e.g., server overload), the code retries every 5 seconds.</li></ol><h3>Customization Tips</h3><p><a href="https://medium.com/@tomasstakeviius/free-ai-api-text-image-and-speech-generation-in-python-2387bd1ff265"><strong>WARNING! THIS METHOD IS DEPRACATED! USE CODE FROM MY NEW ARTICLE!</strong></a></p><ul><li><strong>Experiment with Prompts</strong>: The more detailed the prompt, the better the output. Try styles like “realistic photo of…” or “digital art of…”</li><li><strong>Adjust Cropping</strong>: Modify the crop() parameters if the watermark’s position changes.</li><li><strong>Add Enhancements</strong>: Use the PIL library to resize, filter, or overlay images.</li></ul><h3>Ethical Considerations</h3><p><a href="https://medium.com/@tomasstakeviius/free-ai-api-text-image-and-speech-generation-in-python-2387bd1ff265"><strong>WARNING! THIS METHOD IS DEPRACATED! USE CODE FROM MY NEW ARTICLE!</strong></a></p><p>While this method is free and accessible, always:</p><ol><li>Respect the pollinations.ai service — don’t overload it with excessive requests.</li><li>Check generated images for compliance with content policies.</li><li>Credit the source if used publicly.</li></ol><p>Happy coding!</p><h3>Check out my Telegram to learn more!</h3><p>If you liked my article, you can join my <a href="https://t.me/pythonhustlers">Telegram group</a>, where I share much more resources that will help you become a decent Python programmer!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/0*VOQOANlgqVBpiUHd.png" /><figcaption><a href="https://t.me/pythonhustlers">You can scan this QR code to join my free Telegram for Pytho</a>n learning resources!</figcaption></figure><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2f8d2b00d35" width="1" height="1" alt=""><hr><p><a href="https://python.plainenglish.io/creating-your-own-realistic-ai-image-generator-in-python-for-free-no-api-keys-required-f2f8d2b00d35">Creating Your Own Realistic AI Image Generator in Python — For Free (No API Keys Required)</a> was originally published in <a href="https://python.plainenglish.io/">Python in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I study Spanish With Python]]></title>
            <link>https://medium.com/@tomasstakeviius/how-i-study-spanish-with-python-16a41d87f301?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/16a41d87f301</guid>
            <category><![CDATA[language-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[beginner-coding]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[beginner-programmers]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Sat, 25 Jan 2025 21:40:39 GMT</pubDate>
            <atom:updated>2025-01-25T21:40:39.513Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*0Ml8V2egrZW0ipQ4_8Sm0Q.png" /></figure><p>Studying a new language can be both exciting and challenging. To make the learning process more interactive and engaging, you can create a simple flashcard application using Python. This guide will walk you through building a Spanish learning app that fetches vocabulary from a Google Sheet and quizzes you using a graphical user interface (GUI).</p><p>The application we’ll create uses Python’s tkinter library for the GUI and gspread to interact with Google Sheets. The app displays a Spanish word and multiple English translations as options. Your goal is to select the correct English translation for the given Spanish word.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*sjxu9a1QpTlcCF_ARifYtw.png" /><figcaption>Spanish word guessing app</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*eP292Cl-T8hz_-FHPdqFxw.png" /><figcaption>When you guess wrong</figcaption></figure><h3>Prerequisites</h3><ul><li>Python 3.x installed on your system</li><li>Basic knowledge of Python programming</li><li>Libraries to install:</li><li>tkinter (usually comes with Python)</li><li>gspread</li><li>oauth2client</li></ul><p>You can install the required libraries using pip:</p><pre>pip install gspread oauth2client</pre><h3>Setting Up the Google Sheet</h3><ol><li>Create a Google Sheet with two columns:</li></ol><p><strong>Column A: </strong>Spanish words</p><p><strong>Column B:</strong> English translations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*TKfaDJinSuq3VxiVw-2FhA.png" /><figcaption>Google sheet setup example</figcaption></figure><p>Share the Google Sheet with the service account email that you’ll create in the next steps.</p><p>Note the Spreadsheet ID, which is the part of the URL after /d/ and before /edit.</p><h3>Fetching Data from Google Sheets</h3><p>To access the Google Sheet programmatically, you’ll need to set up Google API credentials.</p><h3>Steps:</h3><p>1. Create a Google Cloud Project and enable the Google Sheets API.</p><p>2. Create a Service Account:</p><ul><li>Go to the <strong>APIs &amp; Services</strong> &gt; <strong>Credentials page</strong>.</li><li>Click <strong>Create credentials</strong> &gt; <strong>Service account</strong>.</li><li>Follow the prompts to create a new service account.</li></ul><p>3. Generate a JSON Key File:</p><ul><li>In your service account, go to the <strong>Keys </strong>section.</li><li>Click <strong>Add Key</strong> &gt; <strong>Create New Key</strong> and select <strong>JSON</strong>.</li><li>Save the keyfile.json securely in your project directory.</li></ul><p>4. Install Required Libraries:</p><pre>pip install gspread oauth2client</pre><p>5. Code to Fetch Data:</p><pre>import gspread<br>from oauth2client.service_account import ServiceAccountCredentials<br><br>def fetch_words_from_google_sheet(sheet_id):<br>    scope = [&#39;https://www.googleapis.com/auth/spreadsheets&#39;, &#39;https://www.googleapis.com/auth/drive&#39;]<br>    creds = ServiceAccountCredentials.from_json_keyfile_name(&#39;keyfile.json&#39;, scope)<br>    client = gspread.authorize(creds)<br><br>    sheet = client.open_by_key(sheet_id).sheet1<br>    all_values = sheet.get_all_values()<br>    spanish_words = [row[0] for row in all_values if row and row[0]]<br>    english_translations = [row[1] for row in all_values if row and len(row) &gt; 1 and row[1]]<br><br>    data = list(zip(spanish_words, english_translations))<br>    return data</pre><p><strong>Note</strong>: Replace &#39;keyfile.json&#39; with the path to your JSON key file and sheet_id with your Google Sheet ID.</p><h3>Building the GUI with Tkinter</h3><p>We will use tkinter to create a simple GUI that presents the Spanish words and multiple-choice answers.</p><h3>Main Components:</h3><ul><li>Label: To display the Spanish word.</li><li>Buttons: For multiple-choice English translations.</li><li>Message Label: To provide feedback.</li></ul><h3>Code:</h3><pre>import tkinter as tk<br>import random<br><br>class SpanishLearningApp:<br>    def __init__(self, root, data):<br>        self.root = root<br>        self.root.title(&quot;Spanish Learning App&quot;)<br>        self.data = data<br>        self.spanish_to_english = {s: e for s, e in self.data}<br>        self.guessed_words = set()<br>        self.max_words = min(len(self.data), 50)<br><br>        self.spanish_label = tk.Label(root, font=(&quot;Arial&quot;, 16))<br>        self.spanish_label.pack(pady=10)<br><br>        self.buttons_frame = tk.Frame(root)<br>        self.buttons_frame.pack()<br><br>        self.message_label = tk.Label(root, text=&quot;&quot;, font=(&quot;Arial&quot;, 12))<br>        self.message_label.pack(pady=10)<br><br>        self.next_word()<br><br>    def next_word(self):<br>        if len(self.guessed_words) &gt;= self.max_words:<br>            self.message_label.config(text=&quot;Great job! You&#39;ve completed the quiz.&quot;)<br>            self.root.after(2000, self.root.destroy)<br>            return<br><br>        for widget in self.buttons_frame.winfo_children():<br>            widget.destroy()<br><br>        remaining_words = [word for word in self.spanish_to_english.keys() if word not in self.guessed_words]<br>        self.current_spanish = random.choice(remaining_words)<br>        correct_english = self.spanish_to_english[self.current_spanish]<br><br>        all_english = list(set(self.spanish_to_english.values()) - {correct_english})<br>        choices = random.sample(all_english, min(len(all_english), 9))<br>        choices.append(correct_english)<br>        random.shuffle(choices)<br><br>        self.spanish_label.config(text=self.current_spanish)<br>        self.message_label.config(text=&quot;&quot;)<br><br>        for i, choice in enumerate(choices):<br>            btn = tk.Button(self.buttons_frame, text=choice, width=20,<br>                            command=lambda c=choice: self.check_answer(c))<br>            btn.grid(row=i//5, column=i%5, padx=5, pady=5)<br><br>    def check_answer(self, selected_option):<br>        correct_english = self.spanish_to_english[self.current_spanish]<br>        if selected_option == correct_english:<br>            self.guessed_words.add(self.current_spanish)<br>            self.next_word()<br>        else:<br>            self.message_label.config(text=&quot;Incorrect! Try again.&quot;)</pre><h3>Putting It All Together</h3><p>Now, we’ll combine the data fetching and the GUI to create the complete application.</p><pre>import tkinter as tk<br>import random<br>import gspread<br>from oauth2client.service_account import ServiceAccountCredentials<br><br># Your Google Sheet ID<br>SHEET_ID = &quot;YOUR_SPREADSHEET_ID_HERE&quot;<br>def fetch_words_from_google_sheet(sheet_id):<br>    scope = [&#39;https://www.googleapis.com/auth/spreadsheets&#39;, &#39;https://www.googleapis.com/auth/drive&#39;]<br>    creds = ServiceAccountCredentials.from_json_keyfile_name(&#39;keyfile.json&#39;, scope)<br>    client = gspread.authorize(creds)<br>    sheet = client.open_by_key(sheet_id).sheet1<br>    all_values = sheet.get_all_values()<br>    spanish_words = [row[0] for row in all_values if row and row[0]]<br>    english_translations = [row[1] for row in all_values if row and len(row) &gt; 1 and row[1]]<br>    data = list(zip(spanish_words, english_translations))<br>    return data<br>def main():<br>    data = fetch_words_from_google_sheet(SHEET_ID)<br>    root = tk.Tk()<br>    app = SpanishLearningApp(root, data)<br>    root.mainloop()<br>if __name__ == &quot;__main__&quot;:<br>    main()</pre><h3>Running the Application</h3><p>1. Ensure all dependencies are installed.</p><p>2. Place the keyfile.json in the same directory as your script.</p><p>3. Replace &#39;YOUR_SPREADSHEET_ID_HERE&#39; with your actual Google Sheet ID.</p><p>4. Run the script:</p><pre>python your_script_name.py</pre><p>5. Interact with the App:</p><ul><li>A window will appear displaying a Spanish word.</li><li>Choose the correct English translation from the options.</li><li>The app will proceed to the next word after a correct answer.</li><li>If incorrect, you’ll be prompted to try again.</li></ul><h3>Conclusion</h3><p>By following this guide, you’ve built a functional flashcard app to help you study Spanish vocabulary. This application can be expanded and customized further:</p><ul><li><strong>Add more words</strong> to your Google Sheet.</li><li><strong>Implement scoring</strong> to track your progress.</li><li><strong>Include additional languages</strong> or categories.</li><li><strong>Add voiceovers</strong> for each word to learn spelling.</li></ul><p>Learning a new language is a rewarding journey, and leveraging programming can make it even more interactive and fun.</p><p>Happy learning!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16a41d87f301" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is buying Bitcoin too risky for you?]]></title>
            <link>https://medium.com/@tomasstakeviius/is-buying-bitcoin-too-risky-for-you-735dc1b49cb3?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/735dc1b49cb3</guid>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[real-estate]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[investing]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Fri, 24 Jan 2025 23:02:03 GMT</pubDate>
            <atom:updated>2025-01-24T23:02:03.774Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ceV9CO8YRP_54zVUIyvoDg.png" /></figure><p>“Any good books on budgeting and managing my bills?” When Mike Tyson asked this question, it struck a chord with many people today. Financial advice can become outdated, especially with how the economy has shifted due to inflation and other factors. It’s essential to keep current because what worked before might not be as effective now.</p><p>Dave Ramsey’s books are considered classics in personal finance. His advice is solid if you’re trying to cut expenses and use common budgeting techniques. He offers practical tips that can assist anyone looking to organize their finances.</p><p>Even with stocks, things keep evolving. You need to keep up with the markets to continue profiting. Real estate investments are great — they offer stability — but they’re kind of boring compared to cryptocurrencies.</p><p>Investing in real estate means putting your money into something stable. It’s a way to store capital. But there’s a balance between the security of real estate and the thrill and possible high crypto returns.</p><p>Traditional budgeting methods and investment advice still have their place, but we need to adapt to the shifting economic scene. Whether learning from experts like Dave Ramsey and Aaron Clary or exploring new investment avenues like cryptocurrency, being informed and adaptable is essential for financial success.</p><p>Another angle to consider is how technology has transformed our financial habits. With mobile apps and online banking, tracking expenses has become easier. But at the same time, it’s also more straightforward to spend money impulsively. Instant purchases and digital wallets make transactions so effortless that we might overlook our budgets if we’re not careful.</p><p>The way we earn money is changing too. The rise of the gig economy and remote work means income can be more flexible but less predictable. Traditional budgeting methods might not fit everyone’s circumstances anymore. New strategies are needed to handle irregular earnings.</p><p>Social media also influences how we spend. Seeing others showcase their lifestyles can tempt us to keep up, even if it’s beyond our means. It takes willpower to stick to a budget when flashy ads and influencer promotions are constantly grabbing our attention.</p><p>Education is a significant factor as well. Many people didn’t get a solid grounding in personal finance during their schooling. This leaves gaps in understanding how to manage money effectively. Resources like books, podcasts, and online courses can help fill in the blanks, providing tools to make smarter financial choices.</p><p>Ultimately, managing money is a personal journey. What works for one person might not suit another. Some prefer the steady growth of traditional investments, while others are attracted to cryptocurrency’s high risks and rewards. The key is to stay informed and choose a path that matches your goals and comfort level.</p><p>Traditional advice on budgeting and investing remains valuable, but adapting to the changing economic landscape is crucial. Whether we’re learning from seasoned experts or exploring new investment opportunities like crypto, staying informed and flexible can lead to financial success.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=735dc1b49cb3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When to take profits?]]></title>
            <link>https://medium.com/@tomasstakeviius/when-to-take-profits-46ff90dbcfd7?source=rss-703bc8e090e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/46ff90dbcfd7</guid>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[profit]]></category>
            <category><![CDATA[bull-run]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[pump]]></category>
            <dc:creator><![CDATA[Tomas Staškevičius]]></dc:creator>
            <pubDate>Fri, 24 Jan 2025 00:57:24 GMT</pubDate>
            <atom:updated>2025-01-24T00:57:24.812Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*gHQ6q2aWF1zRmHUy5UjCbg.png" /></figure><p>Timing-wise for the four-year cycle, it’s like March to the end of October. That’s your window for a top. If you look at global liquidity cycles, they’re bullish into the second half of this year. So, I would say that for me, it pinpoints the more likely scenario of a top between, I would say, July to about the end of October.</p><p>Now, of course, if liquidity is so good and things are pumping and everything’s going well, and Trump, you know, deregulating everything in crypto, and it’s, you know, no taxes for nobody, and everything’s just great, and, you know, crazy like that, then yeah, we could pump into maybe like November, December, January — you know, the end of Q4, maybe into Q1 of ’27. But I wouldn’t bank on it. But it is, you know, an outlier possibility that that’s, you know, something that’s possible.</p><p>So, but within that time period, right — let’s say March to October — you could easily get, you know, multiple areas that look like tops. So, even though in the next Crypto Mindset course — I mean, we’re still in a very much accumulation phase — we’re, you know, going to be talking to you guys about like, okay, here’s how to recognize areas to take profit. You know, this is what it looks like.</p><p>Because sometimes people get so — I mean, you spent, what, the last two years basically accumulating, accumulating, accumulating. And when you do one action so many times for such a long, long time, you sometimes forget to take profits. You basically forgot to take the other action, right? It’s hard to pivot and start doing the opposite because you’ve kind of trained yourself to just buy only.</p><p>And that’s why we are going to have a cash-out course. That’s gonna be an add-on along to the — not this course but the next course we’re gonna have. That’ll be more — yeah, that’ll be more like, what do you call it? Um, okay, we’re getting closer, you know?</p><p>Understanding the timing of the crypto market cycle is crucial for maximizing profits. The period from March to the end of October is generally seen as the window for a market top. Global liquidity cycles are bullish into the second half of this year, suggesting a likely top between July and the end of October.</p><p>Unforeseen factors, such as significant deregulation or changes in policy, could extend this window into November, December, or even into Q1 of 2027. However, these are outlier possibilities and shouldn’t be banked on.</p><p>Within this timeframe, multiple areas might look like tops. It’s essential to recognize these areas to take profit. After spending the last two years accumulating, it’s important not to forget to pivot and start taking profits. Transitioning from buying to selling can be challenging because you’ve trained yourself to buy only.</p><p>Remember, the market doesn’t wait. Being prepared and educated is key to making the most out of the upcoming market movements. Don’t let the habit of only buying hinder your ability to capitalize on your investments.</p><p><strong>Note: This article is intended for informational purposes only and should not be considered financial advice. Always do your own research before making investment decisions.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46ff90dbcfd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>