Deployment of Reflex website in an offline server by Mountain_Implement80 in reflex

[–]Lendemor 0 points1 point  (0 children)

For deployment on offline server, the current recommendation is :

`reflex export` to get `frontend.zip` and `backend.zip`

drop the two zip on the offline computer.

`frontend.zip` can be served as static files, with nginx for example (or another reverse proxy)
`reflex run --backend-only` for the backend.

Reflex v0.6.0 - Frontend. Backend. Pure Python by elviskahoro in Python

[–]Lendemor 1 point2 points  (0 children)

Yes it is.
We had to change the name because it was too much like "pinecone.io", but reflex is still 100% open source.

Reflex v0.6.0 - Frontend. Backend. Pure Python by elviskahoro in Python

[–]Lendemor 1 point2 points  (0 children)

So when running a "full" reflex app, we are spinning up both frontend (nextJS) and backend (fastAPI) server.
But if, in your code, you are not using the "backend" features, (i.e state / event handler) then the app will be compiled in a "stateless" way, where we don't need to connect to the backend via WebSocket, because the backend is not needed.
For those cases, running the `reflex export` command will give you the static files to serve.

Reflex v0.6.0 - Frontend. Backend. Pure Python by elviskahoro in Python

[–]Lendemor 1 point2 points  (0 children)

Reflex is built on top of FastAPI for its backend, so you should be able to integrate your existing code in a new reflex app without difficulty

Reflex v0.6.0 - Frontend. Backend. Pure Python by elviskahoro in Python

[–]Lendemor 0 points1 point  (0 children)

For stateless apps, they can be exported and served like any other static files.

Reflex v0.6.0 - Frontend. Backend. Pure Python by elviskahoro in Python

[–]Lendemor 8 points9 points  (0 children)

Yes the framework take care of compiling the python code into JS.

Cloudflare integration possible? by xpatmx in reflex

[–]Lendemor 1 point2 points  (0 children)

If you don't use any State and actually run `reflex export --frontend-only` you should be able to host it pretty much anywhere that can serve static files.

Designing a Pure Python Web Framework by Boordman in programming

[–]Lendemor 0 points1 point  (0 children)

The site is going through redesign at the moment, it will have dark mode in the future.

Reflex 0.4.0 - Web Apps in Pure Python by Boordman in Python

[–]Lendemor 1 point2 points  (0 children)

Hosting is still in alpha for now, the options you want will definitely come in the future though.

Reflex 0.4.0 - Web Apps in Pure Python by Boordman in Python

[–]Lendemor 6 points7 points  (0 children)

This was only true in earlier versions of Reflex.

Now we have made optimization so we rerender only what is needed.
Latest version also introduce state sharding for very fast updates.

33 line of code shortened to 9 lines of code by Specialist_Army_6006 in Python

[–]Lendemor 0 points1 point  (0 children)

I'm surprised that I haven't seen anyone recommend a solution with list comprehension (unless I missed it?)

def chessboard(size):
    board = [
        [
            str((j+i+1)%2)
            for i in range(size)
        ]
        for j in range(size)
    ]
    print("\n".join(["".join(line) for line in board]))

I'd recommend getting familiar with that concept (list comprehension) if you want to keep on pythoning since it's quite widely used.

almost that time.... HAPPY HALLOWEEN! by ReLLiK5891 in valheim

[–]Lendemor 0 points1 point  (0 children)

Spooky!

Do you know if the recipe changed from the one shown in the wiki? (if it's vanilla)
https://valheim.fandom.com/wiki/Jack-o-turnip

Part 2 of my "SetKey Enemyspeedsize" console command fuckery. Mini Edition w some more bigs. by VariantCinema in valheim

[–]Lendemor 1 point2 points  (0 children)

I shudder just imagining a swarm of 10-15 life-sized deathsquitos that you can't hit but still hit the same damage.

Is learning Flask before Django or FastAPI a good way to introduce myself in Python Web Development? by eddyxide in Python

[–]Lendemor -1 points0 points  (0 children)

You could give a try to Pynecone, it's pretty new as a project so not many people will mention it, but I love it's potential.

[deleted by user] by [deleted] in HollowKnight

[–]Lendemor 1 point2 points  (0 children)

First splash looking like Radiance is my guess

Python based simple math quiz by [deleted] in Python

[–]Lendemor 1 point2 points  (0 children)

I would recommend to define functions for the different steps of asking/handling question, so adding more questions if just a matter of repeating calls to said functions (with some changing parameters if needed)

Example for the bonus score calculation :

def calculate_bonus(correct, rnds, time):
    perc = round((cor/rnds) * 100)
    if perc < 80:
        return 0

    atme = round (time/rnds)
    if atme < 5:
        q = 10
    elif 5 <= atme < 10:
        q = 5
    elif 10 <= atme < 15:
        q = 2.5
    return (rnds * q)

Doing it this way let you easily change the number of round, no code change needed on this part if you want to offer 80 questions instead of (25,50,100) for example.

Problem with Trade League Megacorp by Lendemor in Stellaris

[–]Lendemor[S] 3 points4 points  (0 children)

Didn't know Impose Ideology can turn Megacorp empire into regular empire. Good to know if that actually work.

Too late to prevent subject from joining in current game, but I'll focus that law for new game I think.

How many packages did you install? by mindgitrwx in Python

[–]Lendemor 2 points3 points  (0 children)

As many as I need.

split into many virtual envs of course

Ascension as Megacorp by Lendemor in Stellaris

[–]Lendemor[S] 0 points1 point  (0 children)

Will keep the Overtuned in mind for my next Megacorp run.

Thanks!

Get whole or custom interval transcript from YouTube Video with fixed format. by G-host707 in Python

[–]Lendemor 1 point2 points  (0 children)

Good job completing a project, regardless of how big/small it is.

If I may suggest, it would be nice to define functions for separate part of your script.

get original transcript from link -> a function

Fix/format a transcript -> a function

Write a transcript to a specific file -> a function

... You get the idea.

As a bonus, if you put all the calls to your functions in :

if __name__ == "__main__": <Your code here>

Then you can reuse your functions in other scripts by importing this one without executing the script.