Working with AI code assistant in Anvil?

What I’m trying to do:
I’m new to Python and haven’t coded in years, so I picked up Anvil and am using GPT4 through the chatGPT UI to ask chatGPT for code. I then copy paste it into Anvil.

Ideally, I would like my AI to:

  • Know the code I already have
  • Be able to paste into where I am working

My thoughts are to:

  • set up Anvil locally using git
  • open the python files in VS Code
  • use copilot in VS Code
  • Push to Anvil and test on Anvil whenever I want to see the effects in the UI.

What do you think? Is this a good way? are there better ways to work?

I’m new to Anvil and would love some advice :slight_smile:

You might want to check this out

Another thing that I have started using recently is https://chrome.google.com/webstore/detail/ghosttext/godiecgffnchndlihlpaajjcplehddca

We (@james.campbell and I) have been trying out sweep and the results are impressive. You can see some of what it’s done on our github repo

https://github.com/electora-vote/electora-app/pulls?q=is%3Apr+is%3Aclosed+label%3Asweep

4 Likes

I’m not so familiar with GitHub yet (I’m a product manager, not a programmer so far). Is it common to work on your anvil app outside of the anvil web app? So use git and for instance VS Code (as you seem to be doing? Or am I seeing that wrong?). Could you direct me to some resources about that and maybe explain the broad strokes of best practices on how to do it?

Up to now I’ve only coded and played around in the anvil web app itself, but I wouldnt know how to intregrate sweep or copilot there for instance.

I couldn’t speak as to whether it’s common except to say it’s something I commonly do!

I often use github to share the code for an app such that anyone can contribute to that code. Sometimes I’ll develop locally too, but not always. Often I’ll only use the anvil ide.

I never use github, because I always work alone.

But I like to take advantage of PyCharm, especially for large apps where debugging and troubleshooting complex classes would be a problem in the IDE. And, since I have a PyCharm project setup, I can also use it to run tests.

That almost looks too good to be true! I have to try that out

For local code, this is quite promising. Bit rough in places but works ok most of the time. Based around VSCode :

I’ve never been able to get a smooth ChatGPT extension in “normal” vscode working properly. To me it’s always been no easier than switching tabs and pasting into chatgpt itself.

3 Likes