ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Exporting Python Data: Real-time Data Exchange with Other Platforms and Code Generation with ChatGPT

Автор: Kody Powell

Загружено: 2025-02-03

Просмотров: 433

Описание: In this video, we show how to write a Python script that will push data to a csv file and also create a flag file (run.flag) in the folder. When run.flag does not exist, that is the signal for the Python script to push data to the csv file. When the run.flag file does exist, this code should pause and wait for run.flag to be deleted by another application. We generate this code in ChatGPT to highlight ChatGPT's split screen code generation feature. We do a little bit of prompt engineering to show how to edit the code via the ChatGPT interface.

For the prior lecture video in this series, click here:    • Data Exchange Between Python and Simulink:...  

For the next lecture video in this series, click here:    • Real-time Data Exchange and MATLAB Code Ge...  

For a playlist of all lectures for the Smart Systems course, click here:    • Fundamentals of Smart Systems  

==============================================================

Here is the text for the chatGPT prompts that I used in this video:

Write a python script that generates a uniform random number between 0 and 20 for a variable called q_SP.

Before each iteration, the script should check the current folder for a run.flag file. If this file does not exist, it should do the csv write. if the run.flag file does exist, it should wait for 1 second.

The script should write these values into a SetPoints.csv file one line at a time with a timestamp and pause for 1 second before proceeding. After writing one row of values into the csv file, it should create a file called run.flag to indicate that the python script has run for that iteration. The timestamps start at 1/1/25 and increment by one day at each iteration.

The script should terminate after num_days have been written to the csv file.

The script should give a message showing that the values have been written to the csv file or that the script is waiting for run.flag to be deleted.


==================================

The Python code can be downloaded here:

https://kodypowell.che.utah.edu/wp-co...

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Exporting Python Data: Real-time Data Exchange with Other Platforms and Code Generation with ChatGPT

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]