-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github codespaces guide #249
Open
icanhackyou
wants to merge
1
commit into
flet-dev:main
Choose a base branch
from
icanhackyou:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
docs/guides/python/deploying-web-app/GitHub_Codespaces_guide.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# GitHub Codespaces | ||
|
||
GitHub Codespaces is a powerful feature that allows developers to create and manage development environments directly within a browser. With Codespaces, you can write, run, and debug code without the need for complex local setup. This guide will help you get started with GitHub Codespaces with Flet. | ||
|
||
--- | ||
|
||
## Creating a Codespace | ||
|
||
Follow these steps to create a Codespace: | ||
|
||
#### 1. Go to github.com/codespaces | ||
![Open with Codespaces](https://github.com/testhere90742/images/blob/main/step1.png?raw=true) | ||
#### 2. Login to your github | ||
![Open with Codespaces](https://github.com/testhere90742/images/blob/main/step2.png?raw=true) | ||
#### 3. Create a blank template | ||
![Open with Codespaces](https://github.com/testhere90742/images/blob/main/step3.png?raw=true) | ||
|
||
# | ||
--- | ||
|
||
# To-Do app in Python with Flet in codespaces | ||
#### 1. Install flet using pip. | ||
``` | ||
pip install flet | ||
``` | ||
#### 2. Create a main.py file. | ||
![Open with Codespaces](https://github.com/testhere90742/images/blob/main/step4.png?raw=true) | ||
|
||
#### 3. Paste this code: | ||
```python | ||
import flet as ft | ||
|
||
def main(page: ft.Page): | ||
def add_clicked(e): | ||
page.add(ft.Checkbox(label=new_task.value)) | ||
new_task.value = "" | ||
page.update() | ||
|
||
new_task = ft.TextField(hint_text="Whats needs to be done?") | ||
|
||
page.add(new_task, ft.FloatingActionButton(icon=ft.icons.ADD, on_click=add_clicked)) | ||
|
||
ft.app(target=main, view=ft.WEB_BROWSER, port=8080) | ||
``` | ||
#### 4. Now run the main.py file using this command. | ||
``` | ||
python3 -m main.py | ||
``` | ||
#### 5. Click on ports (if you want to make your flet app public) otherwise click on open in browser(your flet app will be private and you can only view it). | ||
![Open with Codespaces](https://github.com/testhere90742/images/blob/main/step5.png?raw=true) | ||
#### 6. To make your flet app public right click below visibility. Then click on port and then choose public. | ||
![Open with Codespaces](https://github.com/testhere90742/images/blob/main/step6.png?raw=true) | ||
#### 7. Now click on browser icon (located below fowarded address it's highlited with red in previous image). | ||
# Congrats on making your first flet app in codespaces. | ||
![Open with Codespaces](https://github.com/testhere90742/images/blob/main/new.png?raw=true) | ||
# | ||
# | ||
# |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use image from your repository? Please move this image to your PR repository. Thanks!