search
HomeTechnology peripheralsAICursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

Github Copilot X integrating GPT-4 is still in small-scale internal testing, while Cursor integrating GPT-4 has been publicly released. Cursor is an IDE that integrates GPT-4 and can write code in natural language, making writing code as easy as chatting.

There is still a big difference between GPT-4 and GPT-3.5 in their ability to process and write code. A test report from the official website.

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

The first two are GPT-4, one uses text input and the other uses image input; the third one is GPT3.5, which shows the coding capabilities of GPT-4 Compared with GPT-3.5, it has greater capabilities.

Github Copilot X integrating GPT-4 is still in small-scale testing, while Cursor integrating GPT-4 has been publicly released. Cursor is an IDE that integrates GPT-4 and can write code in natural language, making writing code as easy as chatting.

Integrated GPT-4 Cursor, shortcut keys: ctrl k on windows computer, comand k on mac computer to evoke the requirement input box to write code in natural language; ctrl l, comand l to evoke the chat window to write code and Chatting is just as easy.

First, press ctrl k. Write down a requirement: write a python program that converts pictures into characters and pictures and writes them into files. You need to use the pillow library. The araparse library

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

cursor is in a blank space. In the file, a complete python code is generated.

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

# Welcome to Cursor



# 1. Try generating with command K on a new line. Ask for a pytorch script of a feedforward neural network
# 2. Then, select the outputted code and hit chat. Ask if there's a bug. Ask how to improve.
# 3. Try selecting some code and hitting edit. Ask the bot to add residual layers.
# 4. To try out cursor on your own projects, go to the file menu (top left) and open a folder.
from PIL import Image
import argparse

# Command line input parameter processing
parser = argparse.ArgumentParser()

parser.add_argument('file') #Input file
parser.add_argument('-o', '--output' ) # Output file
parser.add_argument('--width', type = int, default = 80) # Output character width
parser.add_argument('--height', type = int, default = 80 ) # Output character drawing height

# Get parameters
args = parser.parse_args()

IMG = args.file
WIDTH = args.width
HEIGHT = args .height
OUTPUT = args.output

# The character set used for character painting, a total of 70 characters, can be extended by yourself
ascii_char = list("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&* ()_ -=[]{};':",./?\|`~ ")

# Map 256 grayscale to 70 characters
def get_char( r, g, b, alpha = 256):
if alpha == 0:
return ' '
length = len(ascii_char)
gray = int(0.2126 * r 0.7152 * g 0.0722 * b)

unit = (256.0 1)/length
return ascii_char[int(gray/unit)]

if __name__ == '__main__':
im = Image. open(IMG)
im = im.resize((WIDTH, HEIGHT), Image.NEAREST)

txt = ""

for i in range(HEIGHT):
for j in range(WIDTH):
txt = get_char(*im.getpixel((j, i)))
txt = 'n'

print(txt)

# Output character drawing to file
if OUTPUT:
with open(OUTPUT, 'w') as f:
f.write(txt)
else:
with open("output .txt", 'w') as f:
f.write(txt)

See if the automatically generated code can be run directly.

Select the following image for conversion:

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

(venv) PS C:UsershanweiPycharmProjectspythonProject> python .main.py -h
usage : main.py [-h] [-o OUTPUT] [--width WIDTH] [--height HEIGHT] file

positional arguments:
file

options:
-h, --helpshow this help message and exit
-o OUTPUT, --output OUTPUT
--width WIDTH
--height HEIGHT
(venv) PS C:UsershanweiPycharmProjectspythonProject> python .main .py .golang.png

After running the program, the conversion effect is as follows:

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

Let’s read the code below:

gray = int(0.2126 * r 0.7152 * g 0.0722 * b)

This code is so strange, ask what Cursor means. Press ctrl l to bring up the chat window and enter: What does this code mean

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

Cursor gave an explanation. It turns out that the gray value is calculated by weighting the values ​​​​of r, g, and b, and then the characters are calculated through the gray value. A reference link is also given https://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale​​

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

Press ctrl l to bring up the chat window and let AI explains the entire code, enter: Explain the entire code in Chinese

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

It can be seen that the AI ​​explanation is very accurate and detailed.

The function of the above code is to convert the picture into a black and white ASCII character painting with gray scale. Let's transform it so that it can generate colorful character painting.

Press ctrl k to wake up the demand text box and enter: Please change this code from generating black and white characters to generating colored characters

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

See Animation: AI will scan each line of code line by line, mark the areas that need to be changed, and then provide the changed code below. And keep the original code for easy comparison.

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

The AI ​​only changed 2 lines of code (actually only one line was changed, the second AI may have short-circuited its brain, completely equivalent changes), and achieved the The generation of black and white characters is changed to the generation of color characters. Test it below:

(venv) PS C:UsershanweiPycharmProjectspythonProject> python .main2.py .golang.png

The generated results are as follows. It is found that after the text file is opened, there is a lot more color information

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

Open the text file directly to view, but the original image cannot be seen. You need to view the color effect in the terminal:

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.

It can be seen that the blue information of the original picture is displayed, and two different shades of blue are displayed. Perfect!

The above is the detailed content of Cursor integrated with GPT-4 makes writing code as easy as chatting. A new era of coding in natural language has arrived.. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:51CTO.COM. If there is any infringement, please contact admin@php.cn delete
How to Run LLM Locally Using LM Studio? - Analytics VidhyaHow to Run LLM Locally Using LM Studio? - Analytics VidhyaApr 19, 2025 am 11:38 AM

Running large language models at home with ease: LM Studio User Guide In recent years, advances in software and hardware have made it possible to run large language models (LLMs) on personal computers. LM Studio is an excellent tool to make this process easy and convenient. This article will dive into how to run LLM locally using LM Studio, covering key steps, potential challenges, and the benefits of having LLM locally. Whether you are a tech enthusiast or are curious about the latest AI technologies, this guide will provide valuable insights and practical tips. Let's get started! Overview Understand the basic requirements for running LLM locally. Set up LM Studi on your computer

Guy Peri Helps Flavor McCormick's Future Through Data TransformationGuy Peri Helps Flavor McCormick's Future Through Data TransformationApr 19, 2025 am 11:35 AM

Guy Peri is McCormick’s Chief Information and Digital Officer. Though only seven months into his role, Peri is rapidly advancing a comprehensive transformation of the company’s digital capabilities. His career-long focus on data and analytics informs

What is the Chain of Emotion in Prompt Engineering? - Analytics VidhyaWhat is the Chain of Emotion in Prompt Engineering? - Analytics VidhyaApr 19, 2025 am 11:33 AM

Introduction Artificial intelligence (AI) is evolving to understand not just words, but also emotions, responding with a human touch. This sophisticated interaction is crucial in the rapidly advancing field of AI and natural language processing. Th

12 Best AI Tools for Data Science Workflow - Analytics Vidhya12 Best AI Tools for Data Science Workflow - Analytics VidhyaApr 19, 2025 am 11:31 AM

Introduction In today's data-centric world, leveraging advanced AI technologies is crucial for businesses seeking a competitive edge and enhanced efficiency. A range of powerful tools empowers data scientists, analysts, and developers to build, depl

AV Byte: OpenAI's GPT-4o Mini and Other AI InnovationsAV Byte: OpenAI's GPT-4o Mini and Other AI InnovationsApr 19, 2025 am 11:30 AM

This week's AI landscape exploded with groundbreaking releases from industry giants like OpenAI, Mistral AI, NVIDIA, DeepSeek, and Hugging Face. These new models promise increased power, affordability, and accessibility, fueled by advancements in tr

Perplexity's Android App Is Infested With Security Flaws, Report FindsPerplexity's Android App Is Infested With Security Flaws, Report FindsApr 19, 2025 am 11:24 AM

But the company’s Android app, which offers not only search capabilities but also acts as an AI assistant, is riddled with a host of security issues that could expose its users to data theft, account takeovers and impersonation attacks from malicious

Everyone's Getting Better At Using AI: Thoughts On Vibe CodingEveryone's Getting Better At Using AI: Thoughts On Vibe CodingApr 19, 2025 am 11:17 AM

You can look at what’s happening in conferences and at trade shows. You can ask engineers what they’re doing, or consult with a CEO. Everywhere you look, things are changing at breakneck speed. Engineers, and Non-Engineers What’s the difference be

Rocket Launch Simulation and Analysis using RocketPy - Analytics VidhyaRocket Launch Simulation and Analysis using RocketPy - Analytics VidhyaApr 19, 2025 am 11:12 AM

Simulate Rocket Launches with RocketPy: A Comprehensive Guide This article guides you through simulating high-power rocket launches using RocketPy, a powerful Python library. We'll cover everything from defining rocket components to analyzing simula

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Atom editor mac version download

Atom editor mac version download

The most popular open source editor