Ранее мы уже говорили о том, как выполнить какой-либо код перед открытием интерактивной консоли.
Расскажу еще один способ! На самом деле, даже запустив интерпретатор в обычном режиме с выполнением скрипта из файла вы можете в любом месте активировать интерактивный режим. Или даже несколько по очереди. За это отвечает модуль code.
Как это может пригодиться?
🔸 Вам не хватает pdb и хочется больше "власти"
🔸 Нужно запросить у юзера данные в достаточно сложном виде. В этом случае можно попросить его создать что ему надо и сохранить в определённую переменную, с которой потом и работать.
🔸 Нужна изолированная среда для выполнения каких-либо действий.
🔸 Просто забавы ради😁
Запускается консоль очень просто
import code
ic = code.InteractiveConsole()
try:
ic.interact()
except SystemExit:
pass
Выход обратно на предыдущий уровень происходит как обычно, вызов функции exit() или клавиши Ctrl+D(Ctrl+Z для Windows).
Я набросал простой пример с некоторым функционалом
🔹 Меняются символы приглашения
🔹 В неймспейсы добавляются дополнительные объекты
🔹 Считается время, проведённое в интерактивном режиме
🔹 Скрипт просит юзера заполнить переменную и по выходу распечатывает её значение
Код здесь ↗️
Для запуска сохраните код в файл и запускайте как обычный скрипт.
python my_console.py
Для быстрого запуска можно сделать отдельный алиас
alias py="python3 /home/username/my_console.py"
#tricks#source
Copyright in the Age of AI: Artists Take a Stand
Hey there, AI & Law community! Have you ever wondered about the complex interplay between art and artificial intelligence? A recent legal battle is shedding light on how AI-generated content intersects with copyright law.
Imagine discovering that your artwork has been used to train an AI system without your consent. That's exactly what happened to Kelly McKernan, a talented watercolor and acrylic illustrator. She found her creations uploaded to the LAION dataset, fueling AI image generators. This revelation transformed her relationship with her art, raising concerns about her career and the rights of countless creators.
Kelly McKernan isn't alone in her struggle. Alongside cartoonist Sarah Anderson and illustrator Karla Ortiz, she's taking a stand against AI firm Stability AI, the company behind Stable Diffusion, Midjourney, and DeviantArt. These artists are filing a lawsuit, questioning the use of their work to train AI systems. This legal challenge adds to a growing list of cases that highlight the copyright complexities brought about by AI.
Artists worldwide are coming together to address the concerns surrounding AI's impact on their creations. The European Guild of Artificial Intelligence Regulation is a prime example, aiming to create legislation that safeguards artists from predatory AI practices. The lack of protective measures and the potential for AI-generated art to replace human creativity is a pressing issue that demands attention.
The case brings to the forefront the need for updated copyright laws in the face of AI advancements. The current framework often falls short in addressing the challenges posed by generative AI.
#AIandArt#CopyrightProtection#ArtificialIntelligence#AIinLaw
Artist Lawsuit Over AI Image Generators Faces Challenges
Hello, dear subscribers! In the ongoing lawsuit against AI image generators by artists, several claims were dismissed by US district Judge William H. Orrick. Notably, two of the three plaintiffs in the case had not registered their disputed works with the Copyright Office, leading to the dismissal of their claims. However, the lead plaintiff, Sarah Andersen, has 30 days to amend her complaint and continue the copyright dispute.
The artists allege that AI image generators infringe on their copyrights, claiming direct and vicarious infringement, violations of the Digital Millennium Copyright Act, and California laws related to unfair competition and rights to publicity. They argue that AI-generated images should be considered derivative works based on copyrighted content.
While the case proceeds, the judge has called for clarification on how image generators work, especially regarding "compressed copies" of images and the operation of AI systems like Stable Diffusion.
The lawsuit remains complex, with the core claim of direct copyright infringement proceeding against Stability AI but not against DeviantArt and Midjourney. The artists will need to address the many issues identified in their claims, including specifics regarding copyright management information and rights of publicity.
#AIImageGenerators#CopyrightLawsuit#AIandArt#LegalAction
#ЦифровойКонтекст
sónar+D 2025: как ИИ учат быть человечным 💐
С 12 по 14 июня в Барселоне прошёл фестиваль sónar+D — пространство, где технологии и культура перестают спорить, а начинают сотрудничать 🖼
Что было?
— сенсорные перформансы и звук на уровне кожи
— «разговоры» с растениями через датчики
— квантовая музыка и генеративный звук
Главный посыл
ИИ — не угроза, а медиатор.
Технологии — не инструмент, а соавтор ✉️
sónar+D предлагает не страх, а эмпатию к цифровому.
#Sonar2025#AIandArt#DigitalEmpathy#новости
#ЦифровойКонтекст
Цифровое возвращение: в Базеле стартовала Digital Art Mile ❤️
С 16 по 22 июня, параллельно с Art Basel, в Швейцарии проходит первая Digital Art Mile, организованная платформой ArtMeta 💐
👌Что на повестке?
— художники, работающие с ИИ, NFT и нейросетями
— робототехника как перформанс
— попытка вернуть цифровое искусство в контекст искусства, а не просто блокчейна
👫Ключевой фокус
Историзация цифрового.
ИИ и NFT — не временный хайп, а часть художественной традиции XXI века.
#DigitalArtMile#ArtMeta#AIandArt#новости
#ЦифровойКонтекст
ИИ, цветы и фотоплёнка: названы цифровые художники года 💐
Arab Bank Switzerland назвал победителей Digital Art Prize 2025:
🧝Анна Ридлер и София Креспо — Artists of the Year
за проект "Snapshots: Orchids"
(гибрид аналоговой фотографии и генеративной визуализации, где ИИ выращивает орхидеи памяти)
👼Чезар Мокану — Emerging Artist of the Year
за ¡World Upstream!
(антиутопический дипфейк-фильм о климате, сделанный на грани эстетики и симуляции).
AI здесь — не модный фильтр. Это язык, на котором художники разговаривают с будущим 🌸
#DigitalArt#AnnaRidler#SofiaCrespo#AIandArt#новости
🌟 AI Sunday Wonders: New Tool Empowers Artists in the Fight Against Unauthorized AI Training
Hello everyone! This Sunday Here's the latest from the world of AI and art.
Meet "Nightshade," a groundbreaking tool enabling artists to safeguard their work from being used in AI model training without their consent. By subtly altering the pixels in their artwork before posting it online, artists can introduce invisible changes that, when incorporated into AI training data, can cause unpredictable distortions in the AI-generated output.
This tool is designed to challenge AI companies that exploit artists' creations without authorization to train their models. The result? Future iterations of image-generating AI models may produce bizarre results: dogs might become cats, cars could transform into cows, and so on.
Nightshade aims to shift the balance of power back to artists. It serves as a potent deterrent against AI companies that disregard artists' copyrights and intellectual property.
#AIandArt#ArtProtection#AIInnovation#NightshadeTool#AIandCopyright