Популярное

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

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

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

Топ запросов

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

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

Автор: Kody Powell

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

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

Описание:

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...

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

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

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

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

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

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

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

Real-time Data Exchange and MATLAB Code Generation with ChatGPT

Real-time Data Exchange and MATLAB Code Generation with ChatGPT

Декораторы Python — наглядное объяснение

Декораторы Python — наглядное объяснение

Introducing Simulink: A Versatile and Powerful Tool for Dynamic Simulation

Introducing Simulink: A Versatile and Powerful Tool for Dynamic Simulation

Акунин ошарашил прогнозом! Финал войны уже решён — Кремль скрывает правду

Акунин ошарашил прогнозом! Финал войны уже решён — Кремль скрывает правду

NotebookLM тихо обновился. Как делать Инфографику, Презентации, Видеопересказ.

NotebookLM тихо обновился. Как делать Инфографику, Презентации, Видеопересказ.

Краткий обзор новой версии n8n 2.0  🚀

Краткий обзор новой версии n8n 2.0 🚀

Основы ПЛК: структурированный текст

Основы ПЛК: структурированный текст

Чем ОПАСЕН МАХ? Разбор приложения специалистом по кибер безопасности

Чем ОПАСЕН МАХ? Разбор приложения специалистом по кибер безопасности

Алгоритмы на Python 3. Лекция №1

Алгоритмы на Python 3. Лекция №1

Как работает ChatGPT: объясняем нейросети просто

Как работает ChatGPT: объясняем нейросети просто

Исследовательский анализ данных с помощью Pandas Python

Исследовательский анализ данных с помощью Pandas Python

Резисторный делитель напряжения — 90% делают ОШИБКУ | Правильный расчёт.

Резисторный делитель напряжения — 90% делают ОШИБКУ | Правильный расчёт.

4 Hours Chopin for Studying, Concentration & Relaxation

4 Hours Chopin for Studying, Concentration & Relaxation

Как сжимаются изображения? [46 МБ ↘↘ 4,07 МБ] JPEG в деталях

Как сжимаются изображения? [46 МБ ↘↘ 4,07 МБ] JPEG в деталях

Как устроена База Данных? Кластеры, индексы, схемы, ограничения

Как устроена База Данных? Кластеры, индексы, схемы, ограничения

Автоматизируйте свою работу с помощью Python

Автоматизируйте свою работу с помощью Python

Python for Finance: getting stock data with pandas datareader

Python for Finance: getting stock data with pandas datareader

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

LLM и GPT - как работают большие языковые модели? Визуальное введение в трансформеры

Понимание Z-преобразования

Понимание Z-преобразования

How To Use Git In VS Code Like A Pro!

How To Use Git In VS Code Like A Pro!

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



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



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