Most people assume Python can only run on servers or in the terminal. I used to think the same, when I started building projects, I thought about how I could visually execute Python directly in the browser, with no backend, no API, and no JavaScript game logic. Here’s what I found out 👇 Modern browsers can execute Python using WebAssembly, a low-level technology that allows non-JavaScript languages to run safely in the browser. Tools like PyScript (powered by Pyodide) compile Python into WebAssembly, making it possible to write Python that interacts directly with HTML elements, buttons, and user input. In practical terms: -The browser downloads a lightweight Python runtime -My Python code runs entirely on the client side -Button clicks trigger Python functions -The DOM is updated from Python, not JavaScript -The app is hosted as a static site on Netlify/Vercel No servers. No APIs. No backend infrastructure. I have done this on two classic CLI projects: A number guessing game→https://lnkd.in/dCBzHuaq Rock–Paper–Scissors →https://lnkd.in/dXJc9k4U They have a clean UI and run fully in the browser, while keeping the core logic in Python. This project taught me an important lesson: Not all “Python projects” need servers. Sometimes the constraint isn’t the language but how you think about execution. Still learning, still building, and enjoying the process of understanding how things actually work under the hood. If you’re learning Python, I highly recommend exploring how it can run beyond the terminal. #Python #WebAssembly #PyScript #LearningInPublic #Finance #BuildingInPublic
Python in the Browser: No Servers, No APIs
More Relevant Posts
-
Code the Web. Power It with Python. HTML gives structure. CSS gives style. JavaScript gives interaction. But Python? Python gives logic, automation, data, and intelligence. This is where the web stops being static and starts becoming smart: • APIs that actually scale • AI features that solve real problems • Backends that connect everything together I stopped asking “Which language should I learn next?” and started asking “What can I build with what I know?” That shift changed everything. If you’re learning web development: 👉 Don’t chase tools 👉 Build projects 👉 Let Python power the web you create What’s one thing you’ve built (or want to build) with Python + Web? Drop it in the comments 👇
To view or add a comment, sign in
-
$ gemini > write CLI apps named doconvrt in c++ python and julia and golang that support bi-directinal document convert to and from markdown and latex and pdf and html and plain text and a makefile to build static executable binaries of each app impl ✦ This is an extensive request that I'll tackle in two main parts. Part 1: `doconvrt` CLI Applications I will write a new command-line application named doconvrt in four different languages: C++, Python, Julia, and Go. Each version of the app will have the same interface: 1 ./doconvrt <input-file> -o <output-file> It will use pandoc behind the scenes to perform bi-directional conversions between Markdown, LaTeX, PDF, HTML, and plain text, inferring the formats from your file extensions. Part 2: Enhanced `Makefile` I will replace the existing Makefile with a new one designed to build static, executable binaries of each doconvrt application. The new Makefile will include: * `all`: A default target to build all four versions of the app (doconvrt_cpp, doconvrt_go, etc.). * `install_deps`: A target to help you install the necessary compilers and libraries for each language (like pyinstaller for Python and PackageCompiler for Julia).
To view or add a comment, sign in
-
Run Python in the browser now!!! That sentence sounds impressive, but don't believe it. Because Python still doesn’t run in the browser. Yet tools like Pyodide manage to execute Python in the browser. How? Well, Computers don’t understand Python. They don’t understand JavaScript either. They only understand machine instructions. 𝗦𝗼 𝗲𝘃𝗲𝗿𝘆 “𝗵𝗶𝗴𝗵-𝗹𝗲𝘃𝗲𝗹 𝗹𝗮𝗻𝗴𝘂𝗮𝗴𝗲” 𝗶𝘀 𝗿𝗲𝗮𝗹𝗹𝘆 𝗷𝘂𝘀𝘁 𝗮 𝘀𝘁𝗼𝗿𝘆 𝗮𝗯𝗼𝘂𝘁 𝘄𝗵𝗼 𝗶𝘀 𝘁𝗿𝗮𝗻𝘀𝗹𝗮𝘁𝗶𝗻𝗴 𝘄𝗵𝗮𝘁, 𝗮𝗻𝗱 𝘄𝗵𝗲𝗿𝗲. When you write Python on your laptop, this is what really happens: Your Python code → is handled by CPython (written in C) → which ultimately executes on the CPU Python never touches the hardware directly. It never has. Now browsers enter the story. Browsers refuse to run random programs for security reasons. They allow two execution formats: • JavaScript (via the JS engine) • WebAssembly (via the Wasm runtime) So when someone says “Python runs in the browser”, what they actually mean is: 𝗪𝗲 𝘁𝗼𝗼𝗸 𝘁𝗵𝗲 𝗣𝘆𝘁𝗵𝗼𝗻 𝗶𝗻𝘁𝗲𝗿𝗽𝗿𝗲𝘁𝗲𝗿 𝗶𝘁𝘀𝗲𝗹𝗳, 𝗿𝗲𝘄𝗶𝗿𝗲𝗱 𝗶𝘁, 𝗮𝗻𝗱 𝘁𝗮𝘂𝗴𝗵𝘁 𝘁𝗵𝗲 𝗯𝗿𝗼𝘄𝘀𝗲𝗿 𝗵𝗼𝘄 𝘁𝗼 𝗿𝘂𝗻 𝘁𝗵𝗮𝘁. Pyodide works by compiling the actual Python interpreter to WebAssembly, which allows browsers to run Python code without a server. So the real execution chain is: Browser → WebAssembly → CPython → Your Python code Once you see this, a lot of doubts will disappear. So, Python didn’t suddenly become a browser language. Someone just moved the translator.
To view or add a comment, sign in
-
-
🐍 Django Shell: Your Secret Weapon for Rapid Development Ever find yourself writing throwaway scripts just to test a quick database query or experiment with your models? There's a better way: `python manage.py shell` The Django shell gives you an interactive Python environment with your entire project context loaded. You can: ✅ Test model queries without writing views ✅ Debug complex relationships on the fly ✅ Prototype business logic before implementing ✅ Quickly inspect data without hitting your database GUI Pro tip: Use `shell_plus` from django-extensions for auto-imported models and even better productivity. It's one of those tools that seems simple but saves hours of development time once you make it part of your workflow. What's your favorite Django productivity hack? #Django #Python #WebDevelopment #DjangoTips #BackendDevelopment
To view or add a comment, sign in
-
🧠 Hoisting - not a programming universal. Look at the following error of two different snippet in attached image👇 In JavaScript, behavior differs based on how variables are declared. Variables declared with var are hoisted and initialized with undefined, so accessing them before declaration does not throw an error. Variables declared with let and const are also hoisted but remain uninitialized in the Temporal Dead Zone, which is why accessing them before declaration throws a ReferenceError. In Python, variable declarations are not hoisted. The interpreter executes code line by line, from top to bottom. When print(message) runs, the variable message has not been created yet, so Python raises a NameError. Shortly: Python binds names only when their definition executes, while js hoists declarations and knows names before execution begin. 👉 Same intent, same flow, same mistake — different outcome due to different working behavior. #programming #Programming #JavaScript #javascript #Python #python #ProgrammingTips #learning #learn #tips
To view or add a comment, sign in
-
-
🚀 Taking my first steps into modern python backend development with FastAPI! ’m excited to share that I’ve been diving into FastAPI, one of the fastest and most intuitive Python frameworks for building APIs. To put my learning into practice, I built a fully functional Calculator App where the logic doesn't just live in the browser—it's powered by a Python backend! 🐍 What I built: A Clean, responsive Calculator web app where every operation (addition, subtraction, multiplication, division) is processed via API calls to a FastAPI server. Why FastAPI? Coming from a Python background, I was blown away by how fast it is to get up and running. The auto-generated documentation (Swagger UI) made testing my endpoints a breeze. Check it out live and let me know what you think! Live Demo: https://lnkd.in/dSMmBFX5 GitHub Repo: https://lnkd.in/dCYHnfHZ I’m just getting started. Any FastAPI pros out there? specific libraries or best practices I should look into next? #FastAPI #Python #WebDevelopment #CodingJourney #Backend #Render #OpenSource #LearningByDoing https://lnkd.in/dCYHnfHZ
To view or add a comment, sign in
-
-
3 Python Patterns That Instantly Separate Real Developers From Tutorial Coders Most Python tutorials teach syntax. Real developers use patterns. Here are 3 Python patterns I use in production that instantly upgrade your projects. 1. Never Put Business Logic in Your API Bad pattern: @app.post("/analyze") def analyze(data: dict): result = data["sales"] * 1.2 return result Good pattern: def calculate_sales(sales): return sales * 1.2 Your API should call logic, not contain it. This makes your code: ✔ testable ✔ reusable ✔ scalable 2. Treat Data Cleaning as a Product Feature Most bugs come from dirty data. Always isolate cleaning logic: def clean_phone(phone): return str(phone).replace(" ", "").replace("-", "") Clean once. Reuse everywhere. 3. Build for Deployment From Day One If your project can’t be deployed, it’s not real. Minimum requirements: requirements.txt env variables README clear folder structure This single habit multiplies your value. Final Thought You don’t need more tutorials. You need production thinking. If you want weekly breakdowns of real Python web & data projects, subscribe below 👇 https://lnkd.in/dWbi5YRJ? #Python #WebDevelopment #SoftwareEngineering #FastAPI #DataScience #BackendDevelopment
To view or add a comment, sign in
-
-
When init isn't enough: The Python mistake that cost me 3 hours Found a junior dev hardcoding database connections inside every class method. Here's what we fixed: ❌ Before: Python class UserService: def get_user(self, id): db = connect_to_database() # 🔥 New connection every call return db.query(f"SELECT * FROM users WHERE id={id}") ✅ After: Python class UserService: def __init__(self, db_connection): self.db = db_connection # ♻️ Reuse connection def get_user(self, id): return self.db.query("SELECT * FROM users WHERE id=?", [id]) Dependency injection isn't just fancy talk - it's how you avoid 500 database connections crashing prod at 3am. What OOP concept made you facepalm when it finally clicked? #Python #SoftwareEngineering #CodingBestPractices #TechEducation #Programming
To view or add a comment, sign in
-
Headline: Which Python Framework Should You Choose? 🤔 In the world of web development, Flask, Django, and FastAPI are the top contenders, but each serves a different purpose. If you are confused about which one fits your project best, this breakdown is for you! 🚀 The Quick Breakdown: 🟢 Flask: Perfect for those who want simplicity and total control. It's a lightweight "micro-framework" that lets you build your way. 🔵 Django: The "batteries-included" powerhouse. Best for large-scale, secure applications where you need everything built-in. ⚡ FastAPI: The modern speedster. Designed for high-performance APIs with native support for asynchronous programming. Which one is your go-to framework for 2026? Let me know in the comments! 👇 #️⃣ Hashtags High Reach: #Python #WebDevelopment #SoftwareEngineering #Flask #Django #FastAPI #BackendDeveloper #CodingCommunity #ProgrammingTips #TechTrends2026
To view or add a comment, sign in
-
-
JavaScript devs call them Promises. Python devs call them Futures. When people mention async/await, most of us immediately think of JavaScript. But Python has had the same idea for a long time just with a different name and ecosystem. In Python, asynchronous work is built around Futures and the 𝙖𝙨𝙮𝙣𝙘𝙞𝙤 event loop. A Future represents a value that will be available later very similar to how a Promise works in JavaScript. What really clicked for me: • async functions don’t execute immediately • Calling it returns a coroutine object (a task waiting to be executed) • That coroutine is scheduled and wrapped as a Future • await simply pauses execution until that future is resolved • The event loop decides when and what runs next Same concept. Different language. Different syntax. Once you understand Futures, async code in Python stops feeling “magical” and starts feeling predictable. This understanding came up when I started learning WebSockets and Django Channels, and I’ll be sharing more about that in the next post. Learning async isn’t about syntax it’s about understanding how time and execution are managed. #Python #AsyncProgramming #Futures #BackendDevelopment #SoftwareEngineering #EventLoop #Promise #asyncio
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
AMAZING!!!