<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Marc Abramowitz</title>
	<atom:link href="https://marc-abramowitz.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://marc-abramowitz.com</link>
	<description></description>
	<lastBuildDate>Sat, 08 Aug 2026 19:00:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.3</generator>
	<item>
		<title>A one-liner to install my iOS app on my iPhone, no Xcode GUI</title>
		<link>https://marc-abramowitz.com/archives/2026/08/08/a-one-liner-to-install-my-ios-app-on-my-iphone-no-xcode-gui/</link>
					<comments>https://marc-abramowitz.com/archives/2026/08/08/a-one-liner-to-install-my-ios-app-on-my-iphone-no-xcode-gui/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Sat, 08 Aug 2026 18:36:01 +0000</pubDate>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Lexitaire]]></category>
		<category><![CDATA[Xcode]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/?p=2797</guid>

					<description><![CDATA[I&#8217;ve been building Lexitaire mostly from the command line these days &#8212; Xcode stays open for breakpoints and previews, but building, running, and installing don&#8217;t need it. The one piece I hadn&#8217;t automated yet was getting a build onto my actual phone, so I wrote tools/install-to-iphone.sh: Two small decisions worth calling out: Pin the device [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I&#8217;ve been building <a href="https://apps.apple.com/app/id290594543">Lexitaire</a> mostly from the command line these days &mdash; Xcode stays open for breakpoints and previews, but building, running, and installing don&rsquo;t need it. The one piece I hadn&rsquo;t automated yet was getting a build onto my actual phone, so I wrote <code>tools/install-to-iphone.sh</code>:</p>



<pre class="wp-block-code"><code>#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."

device_id="&lt;your-device-id&gt;"   # find with: xcodebuild -showdestinations ...
bundle_id="&lt;your-bundle-id&gt;"
derived_data="/tmp/lexitaire-device-build"

xcodebuild build -project Lexitaire.xcodeproj -scheme Lexitaire \
  -destination "id=$device_id" -allowProvisioningUpdates \
  -derivedDataPath "$derived_data"

app_path="$derived_data/Build/Products/Debug-iphoneos/Lexitaire.app"
xcrun devicectl device install app --device "$device_id" "$app_path"
xcrun devicectl device process launch --device "$device_id" "$bundle_id" \
  || echo "Installed, but couldn't launch it automatically (often just a locked screen)."</code></pre>



<p class="wp-block-paragraph">Two small decisions worth calling out:</p>



<ul class="wp-block-list">
<li><strong>Pin the device by ID, not by name.</strong> A device name can contain an apostrophe (a shell-quoting headache) and can change if you rename the phone; the ID survives both. Find it with <code>xcodebuild -showdestinations -project Lexitaire.xcodeproj -scheme Lexitaire</code>.</li>
<li><strong>Don&rsquo;t treat a failed launch as a failed run.</strong> <code>devicectl</code> fails to launch on a locked screen, which isn&rsquo;t a broken build &mdash; the install already succeeded by that point, so that step just fails soft with a reminder to unlock and tap the icon.</li>
</ul>



<p class="wp-block-paragraph">Now it&rsquo;s just <code>tools/install-to-iphone.sh</code> and the build&rsquo;s on my phone.</p>



<figure class="wp-block-image size-large is-resized"><a href="https://apps.apple.com/app/id290594543"><img fetchpriority="high" decoding="async" src="https://marc-abramowitz.com/wp-content/uploads/2026/08/lexitaire-appstore-969x1024.jpeg" alt="Lexitaire on the App Store" class="wp-image-2807" width="485" height="512" srcset="https://marc-abramowitz.com/wp-content/uploads/2026/08/lexitaire-appstore-969x1024.jpeg 969w, https://marc-abramowitz.com/wp-content/uploads/2026/08/lexitaire-appstore-284x300.jpeg 284w, https://marc-abramowitz.com/wp-content/uploads/2026/08/lexitaire-appstore-768x811.jpeg 768w, https://marc-abramowitz.com/wp-content/uploads/2026/08/lexitaire-appstore.jpeg 1170w" sizes="(max-width: 485px) 100vw, 485px" /></a></figure>

]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2026/08/08/a-one-liner-to-install-my-ios-app-on-my-iphone-no-xcode-gui/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Flushing the DNS cache on macOS</title>
		<link>https://marc-abramowitz.com/archives/2026/08/04/flushing-the-dns-cache-on-macos/</link>
					<comments>https://marc-abramowitz.com/archives/2026/08/04/flushing-the-dns-cache-on-macos/#respond</comments>
		
		<dc:creator><![CDATA[]]></dc:creator>
		<pubDate>Tue, 04 Aug 2026 21:15:37 +0000</pubDate>
				<category><![CDATA[Mac]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/archives/2026/08/04/flushing-the-dns-cache-on-macos/</guid>

					<description><![CDATA[Every so often macOS holds onto a DNS answer longer than it should — you&#8217;ve just repointed a domain, switched VPNs, or fixed a broken record, and your Mac is still confidently resolving the old one. The fix is a one-liner: It&#8217;s really two separate flushes chained together, because macOS caches DNS answers in two [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Every so often macOS holds onto a DNS answer longer than it should — you&#8217;ve just repointed a domain, switched VPNs, or fixed a broken record, and your Mac is still confidently resolving the old one. The fix is a one-liner:</p>



<pre class="wp-block-code"><code>sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder</code></pre>



<p class="wp-block-paragraph">It&#8217;s really two separate flushes chained together, because macOS caches DNS answers in two different places depending on the OS version:</p>



<ul class="wp-block-list">
<li><code>dscacheutil -flushcache</code> clears the Directory Service cache — the layer that backs <code>dscacheutil -q host</code> lookups and, on older macOS releases, most of what actually cached your DNS answers.</li>



<li><code>killall -HUP mDNSResponder</code> sends a HUP signal to <code>mDNSResponder</code>, the daemon that does the actual DNS (and Bonjour/mDNS) resolution on modern macOS. A HUP tells it to reload rather than crash, which in practice clears its internal cache.</li>
</ul>



<p class="wp-block-paragraph">Which one actually matters has shifted across macOS versions, and Apple doesn&#8217;t document it cleanly — so rather than remember which release needs which command, running both covers you regardless of what you&#8217;re on. The semicolon (rather than <code>&amp;&amp;</code>) matters a little here too: it runs the second command whether or not the first &#8220;succeeded,&#8221; which is what you want, since <code>dscacheutil -flushcache</code> doesn&#8217;t reliably signal failure even when there&#8217;s nothing to flush.</p>



<p class="wp-block-paragraph">You&#8217;ll be prompted for your password (possibly twice, if <code>sudo</code>&#8216;s credential cache has already expired between the two commands). There&#8217;s no output on success — it just quietly works.</p>



<h2 class="wp-block-heading">Make it a one-word command</h2>



<p class="wp-block-paragraph">If you find yourself reaching for this more than once, drop a function in your <code>~/.zshrc</code> (or <code>~/.bashrc</code>):</p>



<pre class="wp-block-code"><code>flush-dns() {
    sudo dscacheutil -flushcache
    sudo killall -HUP mDNSResponder
    echo "DNS cache flushed."
}</code></pre>



<p class="wp-block-paragraph">Reload your shell config, and <code>flush-dns</code> is a real command from then on.</p>



<pre class="wp-block-code"><code>$ flush-dns
DNS cache flushed.</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2026/08/04/flushing-the-dns-cache-on-macos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Unify спас меня от ада ручной расстановки кавычек</title>
		<link>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-ru/</link>
					<comments>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-ru/#respond</comments>
		
		<dc:creator><![CDATA[Marc]]></dc:creator>
		<pubDate>Tue, 22 Jul 2025 21:59:18 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-ru/</guid>

					<description><![CDATA[Бывало ли у вас такое, что причуда в стиле кода медленно сводит с ума? На работе наша команда следует&#160;стилю кода Black — с одним исключением: одинарные кавычки вместо двойных. Кажется безобидным, правда? Оказывается, это крошечное отклонение порождает удивительное количество трений. Усталость от «поиска и замены» Конечно, я&#160;мог бы&#160;вручную искать и заменять кавычки. Но делать это [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Бывало ли у вас такое, что причуда в стиле кода медленно сводит с ума? На работе наша команда следует&nbsp;стилю кода <a href="https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html">Black</a> — с одним исключением: одинарные кавычки вместо двойных. Кажется безобидным, правда?</p>



<p class="wp-block-paragraph">Оказывается, это крошечное отклонение порождает удивительное количество трений.</p>



<h1 class="wp-block-heading">Усталость от «поиска и замены»</h1>



<p class="wp-block-paragraph">Конечно, я&nbsp;<em>мог бы</em>&nbsp;вручную искать и заменять кавычки. Но делать это раз за разом в разных файлах утомительно. Тогда я попробовал использовать&nbsp;Cursor, но это принесло целый новый набор проблем: большой расход токенов, медленную обработку и необходимость подталкивать его на каждом шагу, как упрямого робота-ассистента.</p>



<p class="wp-block-paragraph">Это сбивало мой рабочий процесс.</p>



<h1 class="wp-block-heading">На сцену выходит Unify (и uv)</h1>



<p class="wp-block-paragraph">У меня уже был установлен&nbsp;<code><a href="https://github.com/astral-sh/uv">uv</a></code>, так что подключить <a href="https://github.com/myint/unify">Unify</a> было проще простого:</p>



<pre class="wp-block-code"><code>uv tool install --python=python3.10 unify</code></pre>



<p class="wp-block-paragraph">Этот параметр&nbsp;<code>--python=python3.10</code>&nbsp;— ключевой: иначе&nbsp;<code>uv</code>&nbsp;по умолчанию берёт Python 3.13, что вызывает проблемы с&nbsp;<code>lib2to3</code>&nbsp;(да, это всё ещё актуально!).</p>



<pre class="wp-block-code"><code>Traceback (most recent call last):
  File "/Users/abramowi/.local/bin/unify", line 10, in &lt;module&gt;
    sys.exit(main())
             ~~~~^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 230, in main
    return _main(sys.argv,
                 standard_out=sys.stdout,
                 standard_error=sys.stderr)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 210, in _main
    if format_file(name, args=args, standard_out=standard_out):
       ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 144, in format_file
    encoding = detect_encoding(filename)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 125, in detect_encoding
    from lib2to3.pgen2 import tokenize as lib2to3_tokenize
ModuleNotFoundError: No module named 'lib2to3'</code></pre>



<p class="wp-block-paragraph">Unify зависит от него, так что более старая версия Python спасает положение.</p>



<h1 class="wp-block-heading">Однострочная команда, которая всё исправила</h1>



<p class="wp-block-paragraph">Вот и всё, что нужно, чтобы переключиться на одинарные кавычки прямо в файле:</p>



<pre class="wp-block-code"><code>unify --quote "'" --in-place /path/to/file.py</code></pre>



<p class="wp-block-paragraph">И вот так, без лишней возни. Никакой траты токенов. Никакого подталкивания ИИ-инструментов к послушанию.</p>



<h1 class="wp-block-heading">До и после</h1>



<pre class="wp-block-code"><code># Before
print("Hello, world!")

# After
print('Hello, world!')</code></pre>



<h1 class="wp-block-heading">Вывод</h1>



<p class="wp-block-paragraph">Иногда лучшее решение — точечное. Unify не просто привёл в порядок мой код — он вернул мне время и концентрацию. Если вы застряли в чистилище стилей кавычек, эта однострочная команда может стать вашим спасением.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-ru/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Unify 把我从手动引号地狱中拯救了出来</title>
		<link>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-zh-cn/</link>
					<comments>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-zh-cn/#respond</comments>
		
		<dc:creator><![CDATA[Marc]]></dc:creator>
		<pubDate>Tue, 22 Jul 2025 21:59:18 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-zh-cn/</guid>

					<description><![CDATA[有没有遇到过某个代码风格的小怪癖，慢慢把你逼疯？在工作中，我们团队遵循&#160;Black 代码风格——只有一个例外：使用单引号而不是双引号。听起来无伤大雅，对吧？ 结果这个小小的偏差却带来了惊人的麻烦。 「查找和替换」疲劳 当然，我可以手动查找并替换引号。但在多个文件中反复这样做很繁琐。后来我尝试用&#160;Cursor&#160;来处理，结果却带来了一整套新的麻烦：大量的 token 消耗、缓慢的处理速度，还需要每隔几步就推它一下，就像哄一个固执的机器人助手。 这打乱了我的工作节奏。 Unify（和 uv）登场 我已经安装了&#160;uv&#160;，所以引入 Unify 非常顺畅： 这个&#160;--python=python3.10&#160;的部分很关键——否则&#160;uv&#160;会默认使用 Python 3.13，这会导致&#160;lib2to3&#160;出问题（没错，它现在依然相关！）。 Unify 依赖它，所以用旧版本的 Python 就能解决问题。 解决一切的单行命令 只需要这一步，就能原地切换为单引号： 就这样，不再需要折腾。不再浪费 token。也不用再去哄着 AI 工具听话了。 前后对比 总结 有时候，最好的解决方案就是精准的一刀。Unify 不仅整理了我的代码——还让我重新夺回了时间和专注力。如果你也困在引号风格的炼狱中，这一行命令或许就是你的逃生通道。]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">有没有遇到过某个代码风格的小怪癖，慢慢把你逼疯？在工作中，我们团队遵循&nbsp;<a href="https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html">Black 代码风格</a>——只有一个例外：使用单引号而不是双引号。听起来无伤大雅，对吧？</p>



<p class="wp-block-paragraph">结果这个小小的偏差却带来了惊人的麻烦。</p>



<h1 class="wp-block-heading">「查找和替换」疲劳</h1>



<p class="wp-block-paragraph">当然，我可以手动查找并替换引号。但在多个文件中反复这样做很繁琐。后来我尝试用&nbsp;Cursor&nbsp;来处理，结果却带来了一整套新的麻烦：大量的 token 消耗、缓慢的处理速度，还需要每隔几步就推它一下，就像哄一个固执的机器人助手。</p>



<p class="wp-block-paragraph">这打乱了我的工作节奏。</p>



<h1 class="wp-block-heading">Unify（和 uv）登场</h1>



<p class="wp-block-paragraph">我已经安装了&nbsp;<code><a href="https://github.com/astral-sh/uv">uv</a></code>&nbsp;，所以引入 <a href="https://github.com/myint/unify">Unify</a> 非常顺畅：</p>



<pre class="wp-block-code"><code>uv tool install --python=python3.10 unify</code></pre>



<p class="wp-block-paragraph">这个&nbsp;<code>--python=python3.10</code>&nbsp;的部分很关键——否则&nbsp;<code>uv</code>&nbsp;会默认使用 Python 3.13，这会导致&nbsp;<code>lib2to3</code>&nbsp;出问题（没错，它现在依然相关！）。</p>



<pre class="wp-block-code"><code>Traceback (most recent call last):
  File "/Users/abramowi/.local/bin/unify", line 10, in &lt;module&gt;
    sys.exit(main())
             ~~~~^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 230, in main
    return _main(sys.argv,
                 standard_out=sys.stdout,
                 standard_error=sys.stderr)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 210, in _main
    if format_file(name, args=args, standard_out=standard_out):
       ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 144, in format_file
    encoding = detect_encoding(filename)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 125, in detect_encoding
    from lib2to3.pgen2 import tokenize as lib2to3_tokenize
ModuleNotFoundError: No module named 'lib2to3'</code></pre>



<p class="wp-block-paragraph">Unify 依赖它，所以用旧版本的 Python 就能解决问题。</p>



<h1 class="wp-block-heading">解决一切的单行命令</h1>



<p class="wp-block-paragraph">只需要这一步，就能原地切换为单引号：</p>



<pre class="wp-block-code"><code>unify --quote "'" --in-place /path/to/file.py</code></pre>



<p class="wp-block-paragraph">就这样，不再需要折腾。不再浪费 token。也不用再去哄着 AI 工具听话了。</p>



<h1 class="wp-block-heading">前后对比</h1>



<pre class="wp-block-code"><code># Before
print("Hello, world!")

# After
print('Hello, world!')</code></pre>



<h1 class="wp-block-heading">总结</h1>



<p class="wp-block-paragraph">有时候，最好的解决方案就是精准的一刀。Unify 不仅整理了我的代码——还让我重新夺回了时间和专注力。如果你也困在引号风格的炼狱中，这一行命令或许就是你的逃生通道。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-zh-cn/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Unifyが手動クォート地獄から救ってくれた話</title>
		<link>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-ja/</link>
					<comments>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-ja/#respond</comments>
		
		<dc:creator><![CDATA[Marc]]></dc:creator>
		<pubDate>Tue, 22 Jul 2025 21:59:18 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-ja/</guid>

					<description><![CDATA[少しずつ気が狂いそうになるコーディングスタイルの癖に悩まされたことはありますか？仕事では、私たちのチームは&#160;Blackのコードスタイルに従っています——ただし一つだけ例外があります。二重引用符ではなく単一引用符を使うことです。無害に思えますよね？ ところが、このほんの小さな逸脱が驚くほどの摩擦を生むことが分かりました。 「検索と置換」疲れ もちろん、引用符を手動で検索・置換することもできます。しかし、それを複数のファイルに渡って繰り返すのは面倒です。そこでCursorを使ってみましたが、それはそれで新たな頭痛の種を生みました。大量のトークン消費、遅い処理、そして頑固なロボットアシスタントのように何ステップかごとに突く必要があること。 それは私の作業の流れを乱していました。 Unify（とuv）の登場 すでに&#160;uv&#160;をインストールしていたので、Unifyを導入するのはシームレスでした： この&#160;--python=python3.10&#160;という部分が重要です——そうしないと&#160;uv&#160;はデフォルトでPython 3.13を使ってしまい、&#160;lib2to3&#160;に問題が生じます（そう、今でも関係あるんです！）。 Unifyはこれに依存しているので、古めのPythonバージョンが救いになります。 すべてを解決した一行コマンド その場で単一引用符に切り替えるのに必要なのはこれだけです： それだけで、もう手間はかかりません。トークンの浪費もありません。AIツールを従わせるために突く必要もありません。 変更前と変更後 まとめ 時には、最善の解決策は外科的なものです。Unifyは単にコードを整えただけでなく、時間と集中力を取り戻させてくれました。もしあなたが引用符スタイルの煉獄で立ち往生しているなら、この一行コマンドが脱出口になるかもしれません。]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">少しずつ気が狂いそうになるコーディングスタイルの癖に悩まされたことはありますか？仕事では、私たちのチームは&nbsp;<a href="https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html">Blackのコードスタイル</a>に従っています——ただし一つだけ例外があります。二重引用符ではなく単一引用符を使うことです。無害に思えますよね？</p>



<p class="wp-block-paragraph">ところが、このほんの小さな逸脱が驚くほどの摩擦を生むことが分かりました。</p>



<h1 class="wp-block-heading">「検索と置換」疲れ</h1>



<p class="wp-block-paragraph">もちろん、引用符を手動で検索・置換することもできます。しかし、それを複数のファイルに渡って繰り返すのは面倒です。そこで<em>Cursor</em>を使ってみましたが、それはそれで新たな頭痛の種を生みました。大量のトークン消費、遅い処理、そして頑固なロボットアシスタントのように何ステップかごとに突く必要があること。</p>



<p class="wp-block-paragraph">それは私の作業の流れを乱していました。</p>



<h1 class="wp-block-heading">Unify（とuv）の登場</h1>



<p class="wp-block-paragraph">すでに&nbsp;<code><a href="https://github.com/astral-sh/uv">uv</a></code>&nbsp;をインストールしていたので、<a href="https://github.com/myint/unify">Unify</a>を導入するのはシームレスでした：</p>



<pre class="wp-block-code"><code>uv tool install --python=python3.10 unify</code></pre>



<p class="wp-block-paragraph">この&nbsp;<code>--python=python3.10</code>&nbsp;という部分が重要です——そうしないと&nbsp;<code>uv</code>&nbsp;はデフォルトでPython 3.13を使ってしまい、&nbsp;<code>lib2to3</code>&nbsp;に問題が生じます（そう、今でも関係あるんです！）。</p>



<pre class="wp-block-code"><code>Traceback (most recent call last):
  File "/Users/abramowi/.local/bin/unify", line 10, in &lt;module&gt;
    sys.exit(main())
             ~~~~^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 230, in main
    return _main(sys.argv,
                 standard_out=sys.stdout,
                 standard_error=sys.stderr)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 210, in _main
    if format_file(name, args=args, standard_out=standard_out):
       ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 144, in format_file
    encoding = detect_encoding(filename)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 125, in detect_encoding
    from lib2to3.pgen2 import tokenize as lib2to3_tokenize
ModuleNotFoundError: No module named 'lib2to3'</code></pre>



<p class="wp-block-paragraph">Unifyはこれに依存しているので、古めのPythonバージョンが救いになります。</p>



<h1 class="wp-block-heading">すべてを解決した一行コマンド</h1>



<p class="wp-block-paragraph">その場で単一引用符に切り替えるのに必要なのはこれだけです：</p>



<pre class="wp-block-code"><code>unify --quote "'" --in-place /path/to/file.py</code></pre>



<p class="wp-block-paragraph">それだけで、もう手間はかかりません。トークンの浪費もありません。AIツールを従わせるために突く必要もありません。</p>



<h1 class="wp-block-heading">変更前と変更後</h1>



<pre class="wp-block-code"><code># Before
print("Hello, world!")

# After
print('Hello, world!')</code></pre>



<h1 class="wp-block-heading">まとめ</h1>



<p class="wp-block-paragraph">時には、最善の解決策は外科的なものです。Unifyは単にコードを整えただけでなく、時間と集中力を取り戻させてくれました。もしあなたが引用符スタイルの煉獄で立ち往生しているなら、この一行コマンドが脱出口になるかもしれません。</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-ja/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>O Unify me salvou do inferno das aspas manuais</title>
		<link>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-pt-br/</link>
					<comments>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-pt-br/#respond</comments>
		
		<dc:creator><![CDATA[Marc]]></dc:creator>
		<pubDate>Tue, 22 Jul 2025 21:59:18 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-pt-br/</guid>

					<description><![CDATA[Já teve uma mania de estilo de código que aos poucos te deixa louco? No trabalho, nossa equipe segue&#160;o estilo de código Black — com uma exceção: aspas simples em vez de duplas. Parece inofensivo, né? Acontece que esse pequeno desvio gera uma quantidade surpreendente de atrito. A fadiga do &#8220;localizar e substituir&#8221; Claro, eu&#160;poderia&#160;buscar [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Já teve uma mania de estilo de código que aos poucos te deixa louco? No trabalho, nossa equipe segue&nbsp;o <a href="https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html">estilo de código Black</a> — com uma exceção: aspas simples em vez de duplas. Parece inofensivo, né?</p>



<p class="wp-block-paragraph">Acontece que esse pequeno desvio gera uma quantidade surpreendente de atrito.</p>



<h1 class="wp-block-heading">A fadiga do &#8220;localizar e substituir&#8221;</h1>



<p class="wp-block-paragraph">Claro, eu&nbsp;<em>poderia</em>&nbsp;buscar e substituir as aspas manualmente. Mas fazer isso repetidamente em vários arquivos é cansativo. Então tentei usar o&nbsp;Cursor&nbsp;para cuidar disso, mas isso trouxe um conjunto totalmente novo de dores de cabeça: alto consumo de tokens, processamento lento, e a necessidade de cutucá-lo a cada poucos passos como um assistente robô teimoso.</p>



<p class="wp-block-paragraph">Isso estava atrapalhando meu fluxo de trabalho.</p>



<h1 class="wp-block-heading">Chega o Unify (e o uv)</h1>



<p class="wp-block-paragraph">Eu já tinha o&nbsp;<code><a href="https://github.com/astral-sh/uv">uv</a></code>&nbsp;instalado, então incorporar o <a href="https://github.com/myint/unify">Unify</a> foi tranquilo:</p>



<pre class="wp-block-code"><code>uv tool install --python=python3.10 unify</code></pre>



<p class="wp-block-paragraph">Esse detalhe do&nbsp;<code>--python=python3.10</code>&nbsp;é essencial—caso contrário o&nbsp;<code>uv</code>&nbsp;pega o Python 3.13 por padrão, o que causa problemas com o&nbsp;<code>lib2to3</code>&nbsp;(é, ainda relevante!).</p>



<pre class="wp-block-code"><code>Traceback (most recent call last):
  File "/Users/abramowi/.local/bin/unify", line 10, in &lt;module&gt;
    sys.exit(main())
             ~~~~^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 230, in main
    return _main(sys.argv,
                 standard_out=sys.stdout,
                 standard_error=sys.stderr)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 210, in _main
    if format_file(name, args=args, standard_out=standard_out):
       ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 144, in format_file
    encoding = detect_encoding(filename)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 125, in detect_encoding
    from lib2to3.pgen2 import tokenize as lib2to3_tokenize
ModuleNotFoundError: No module named 'lib2to3'</code></pre>



<p class="wp-block-paragraph">O Unify depende dele, então uma versão mais antiga do Python salva o dia.</p>



<h1 class="wp-block-heading">A linha de comando que resolveu tudo</h1>



<p class="wp-block-paragraph">É só isso que é preciso para trocar para aspas simples direto no arquivo:</p>



<pre class="wp-block-code"><code>unify --quote "'" --in-place /path/to/file.py</code></pre>



<p class="wp-block-paragraph">E pronto, sem mais ajustes manuais. Sem mais gasto de tokens. Sem mais precisar empurrar as ferramentas de IA para obedecerem.</p>



<h1 class="wp-block-heading">Antes e depois</h1>



<pre class="wp-block-code"><code># Before
print("Hello, world!")

# After
print('Hello, world!')</code></pre>



<h1 class="wp-block-heading">Conclusão</h1>



<p class="wp-block-paragraph">Às vezes a melhor solução é uma intervenção cirúrgica. O Unify não só limpou meu código—ele me permitiu recuperar tempo e foco. Se você está preso no purgatório do estilo de aspas, essa linha de comando pode ser sua rota de fuga.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-pt-br/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Unify hat mich vor der manuellen Anführungszeichen-Hölle gerettet</title>
		<link>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-de/</link>
					<comments>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-de/#respond</comments>
		
		<dc:creator><![CDATA[Marc]]></dc:creator>
		<pubDate>Tue, 22 Jul 2025 21:59:18 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-de/</guid>

					<description><![CDATA[Hattet ihr schon mal eine Code-Stil-Marotte, die euch langsam in den Wahnsinn treibt? Bei der Arbeit folgt unser Team&#160;dem Black-Code-Stil — mit einer Ausnahme: einfache statt doppelte Anführungszeichen. Klingt harmlos, oder? Es stellt sich heraus, dass diese winzige Abweichung überraschend viel Reibung erzeugt. Die „Suchen und Ersetzen“-Erschöpfung Klar, ich&#160;könnte&#160;Anführungszeichen manuell suchen und ersetzen. Aber das [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Hattet ihr schon mal eine Code-Stil-Marotte, die euch langsam in den Wahnsinn treibt? Bei der Arbeit folgt unser Team&nbsp;dem <a href="https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html">Black-Code-Stil</a> — mit einer Ausnahme: einfache statt doppelte Anführungszeichen. Klingt harmlos, oder?</p>



<p class="wp-block-paragraph">Es stellt sich heraus, dass diese winzige Abweichung überraschend viel Reibung erzeugt.</p>



<h1 class="wp-block-heading">Die „Suchen und Ersetzen“-Erschöpfung</h1>



<p class="wp-block-paragraph">Klar, ich&nbsp;<em>könnte</em>&nbsp;Anführungszeichen manuell suchen und ersetzen. Aber das wiederholt über mehrere Dateien hinweg zu tun, ist mühsam. Dann versuchte ich es mit&nbsp;Cursor, aber das brachte eine ganz neue Reihe von Kopfschmerzen mit sich: hoher Token-Verbrauch, langsame Verarbeitung, und die Notwendigkeit, es alle paar Schritte anzustupsen wie einen sturen Roboter-Assistenten.</p>



<p class="wp-block-paragraph">Es hat meinen Arbeitsfluss gestört.</p>



<h1 class="wp-block-heading">Unify (und uv) betritt die Bühne</h1>



<p class="wp-block-paragraph">Ich hatte bereits&nbsp;<code><a href="https://github.com/astral-sh/uv">uv</a></code>&nbsp;installiert, also war die Einbindung von <a href="https://github.com/myint/unify">Unify</a> nahtlos:</p>



<pre class="wp-block-code"><code>uv tool install --python=python3.10 unify</code></pre>



<p class="wp-block-paragraph">Das&nbsp;<code>--python=python3.10</code>-Detail ist entscheidend—sonst greift&nbsp;<code>uv</code>&nbsp;standardmäßig auf Python 3.13 zurück, was Probleme mit&nbsp;<code>lib2to3</code>&nbsp;verursacht (ja, immer noch relevant!).</p>



<pre class="wp-block-code"><code>Traceback (most recent call last):
  File "/Users/abramowi/.local/bin/unify", line 10, in &lt;module&gt;
    sys.exit(main())
             ~~~~^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 230, in main
    return _main(sys.argv,
                 standard_out=sys.stdout,
                 standard_error=sys.stderr)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 210, in _main
    if format_file(name, args=args, standard_out=standard_out):
       ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 144, in format_file
    encoding = detect_encoding(filename)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 125, in detect_encoding
    from lib2to3.pgen2 import tokenize as lib2to3_tokenize
ModuleNotFoundError: No module named 'lib2to3'</code></pre>



<p class="wp-block-paragraph">Unify hängt davon ab, also rettet eine ältere Python-Version den Tag.</p>



<h1 class="wp-block-heading">Der Einzeiler, der alles gelöst hat</h1>



<p class="wp-block-paragraph">Das ist alles, was nötig ist, um direkt in der Datei auf einfache Anführungszeichen umzustellen:</p>



<pre class="wp-block-code"><code>unify --quote "'" --in-place /path/to/file.py</code></pre>



<p class="wp-block-paragraph">Und schon war Schluss mit dem Herumfummeln. Schluss mit Token-Verschwendung. Schluss damit, KI-Tools zur Fügsamkeit zu drängen.</p>



<h1 class="wp-block-heading">Vorher und nachher</h1>



<pre class="wp-block-code"><code># Before
print("Hello, world!")

# After
print('Hello, world!')</code></pre>



<h1 class="wp-block-heading">Fazit</h1>



<p class="wp-block-paragraph">Manchmal ist die beste Lösung ein chirurgischer Eingriff. Unify hat nicht nur meinen Code bereinigt—es hat mir Zeit und Konzentration zurückgegeben. Wenn du im Anführungszeichen-Fegefeuer feststeckst, könnte dieser Einzeiler genau dein Fluchtweg sein.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-de/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Unify m&#8217;a sauvé de l&#8217;enfer des guillemets manuels</title>
		<link>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-fr/</link>
					<comments>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-fr/#respond</comments>
		
		<dc:creator><![CDATA[Marc]]></dc:creator>
		<pubDate>Tue, 22 Jul 2025 21:59:18 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-fr/</guid>

					<description><![CDATA[Avez-vous déjà eu une manie de style de code qui vous rend peu à peu fou ? Au travail, notre équipe suit&#160;le style de code Black — à une exception près : les guillemets simples plutôt que doubles. Ça a l&#8217;air inoffensif, non ? Il s&#8217;avère que cette petite entorse engendre une friction surprenante. La lassitude du « Rechercher [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Avez-vous déjà eu une manie de style de code qui vous rend peu à peu fou ? Au travail, notre équipe suit&nbsp;le <a href="https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html">style de code Black</a> — à une exception près : les guillemets simples plutôt que doubles. Ça a l&#8217;air inoffensif, non ?</p>



<p class="wp-block-paragraph">Il s&#8217;avère que cette petite entorse engendre une friction surprenante.</p>



<h1 class="wp-block-heading">La lassitude du « Rechercher et remplacer »</h1>



<p class="wp-block-paragraph">Bien sûr, je&nbsp;<em>pourrais</em>&nbsp;rechercher et remplacer les guillemets manuellement. Mais le faire à répétition sur plusieurs fichiers est fastidieux. J&#8217;ai alors essayé d&#8217;utiliser&nbsp;Cursor&nbsp;pour s&#8217;en charger, mais cela a introduit toute une nouvelle série de tracas : une grosse consommation de tokens, un traitement lent, et le besoin de le relancer à chaque étape comme un assistant robot têtu.</p>



<p class="wp-block-paragraph">Cela perturbait mon flux de travail.</p>



<h1 class="wp-block-heading">Entrée en scène de Unify (et uv)</h1>



<p class="wp-block-paragraph">J&#8217;avais déjà&nbsp;<code><a href="https://github.com/astral-sh/uv">uv</a></code>&nbsp;installé, donc intégrer <a href="https://github.com/myint/unify">Unify</a> a été sans accroc :</p>



<pre class="wp-block-code"><code>uv tool install --python=python3.10 unify</code></pre>



<p class="wp-block-paragraph">Ce détail&nbsp;<code>--python=python3.10</code>&nbsp;est essentiel—sinon&nbsp;<code>uv</code>&nbsp;récupère Python 3.13 par défaut, ce qui pose des problèmes avec&nbsp;<code>lib2to3</code>&nbsp;(eh oui, toujours d&#8217;actualité !).</p>



<pre class="wp-block-code"><code>Traceback (most recent call last):
  File "/Users/abramowi/.local/bin/unify", line 10, in &lt;module&gt;
    sys.exit(main())
             ~~~~^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 230, in main
    return _main(sys.argv,
                 standard_out=sys.stdout,
                 standard_error=sys.stderr)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 210, in _main
    if format_file(name, args=args, standard_out=standard_out):
       ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 144, in format_file
    encoding = detect_encoding(filename)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 125, in detect_encoding
    from lib2to3.pgen2 import tokenize as lib2to3_tokenize
ModuleNotFoundError: No module named 'lib2to3'</code></pre>



<p class="wp-block-paragraph">Unify en dépend, donc une version plus ancienne de Python sauve la mise.</p>



<h1 class="wp-block-heading">La ligne de commande qui a tout réglé</h1>



<p class="wp-block-paragraph">Voici tout ce qu&#8217;il faut pour passer aux guillemets simples directement dans le fichier :</p>



<pre class="wp-block-code"><code>unify --quote "'" --in-place /path/to/file.py</code></pre>



<p class="wp-block-paragraph">Et comme ça, plus de bricolage. Plus de gaspillage de tokens. Plus besoin de forcer les outils d&#8217;IA à obéir.</p>



<h1 class="wp-block-heading">Avant et après</h1>



<pre class="wp-block-code"><code># Before
print("Hello, world!")

# After
print('Hello, world!')</code></pre>



<h1 class="wp-block-heading">Ce qu’il faut retenir</h1>



<p class="wp-block-paragraph">Parfois, la meilleure solution est chirurgicale. Unify n&#8217;a pas seulement nettoyé mon code—il m&#8217;a permis de récupérer du temps et de la concentration. Si vous êtes coincé dans le purgatoire du style des guillemets, cette ligne de commande pourrait bien être votre porte de sortie.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-fr/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Unify me salvó del infierno de las comillas manuales</title>
		<link>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-es/</link>
					<comments>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-es/#respond</comments>
		
		<dc:creator><![CDATA[Marc]]></dc:creator>
		<pubDate>Tue, 22 Jul 2025 21:59:18 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-es/</guid>

					<description><![CDATA[¿Alguna vez has tenido una manía de estilo de código que poco a poco te vuelve loco? En el trabajo, nuestro equipo sigue&#160;el estilo de código Black — con una excepción: comillas simples en lugar de dobles. Parece inofensivo, ¿verdad? Resulta que esta pequeña desviación genera una cantidad sorprendente de fricción. La fatiga del &#8220;buscar [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">¿Alguna vez has tenido una manía de estilo de código que poco a poco te vuelve loco? En el trabajo, nuestro equipo sigue&nbsp;el <a href="https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html">estilo de código Black</a> — con una excepción: comillas simples en lugar de dobles. Parece inofensivo, ¿verdad?</p>



<p class="wp-block-paragraph">Resulta que esta pequeña desviación genera una cantidad sorprendente de fricción.</p>



<h1 class="wp-block-heading">La fatiga del &#8220;buscar y reemplazar&#8221;</h1>



<p class="wp-block-paragraph">Claro, <em>podría</em>&nbsp;buscar y reemplazar comillas manualmente. Pero hacerlo repetidamente en varios archivos es tedioso. Luego probé usar&nbsp;Cursor&nbsp;para encargarse de eso, pero eso trajo un conjunto totalmente nuevo de dolores de cabeza: mucho consumo de tokens, procesamiento lento, y tener que empujarlo cada pocos pasos como a un asistente robot testarudo.</p>



<p class="wp-block-paragraph">Estaba arruinando mi flujo de trabajo.</p>



<h1 class="wp-block-heading">Llega Unify (y uv)</h1>



<p class="wp-block-paragraph">Ya tenía&nbsp;<code><a href="https://github.com/astral-sh/uv">uv</a></code>&nbsp;instalado, así que incorporar <a href="https://github.com/myint/unify">Unify</a> fue muy sencillo:</p>



<pre class="wp-block-code"><code>uv tool install --python=python3.10 unify</code></pre>



<p class="wp-block-paragraph">Ese detalle de&nbsp;<code>--python=python3.10</code>&nbsp;es clave—de lo contrario&nbsp;<code>uv</code>&nbsp;toma Python 3.13 por defecto, lo cual causa problemas con&nbsp;<code>lib2to3</code>&nbsp;(sí, ¡todavía relevante!).</p>



<pre class="wp-block-code"><code>Traceback (most recent call last):
  File "/Users/abramowi/.local/bin/unify", line 10, in &lt;module&gt;
    sys.exit(main())
             ~~~~^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 230, in main
    return _main(sys.argv,
                 standard_out=sys.stdout,
                 standard_error=sys.stderr)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 210, in _main
    if format_file(name, args=args, standard_out=standard_out):
       ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 144, in format_file
    encoding = detect_encoding(filename)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 125, in detect_encoding
    from lib2to3.pgen2 import tokenize as lib2to3_tokenize
ModuleNotFoundError: No module named 'lib2to3'</code></pre>



<p class="wp-block-paragraph">Unify depende de él, así que una versión más antigua de Python salva el día.</p>



<h1 class="wp-block-heading">La línea de código que lo arregló todo</h1>



<p class="wp-block-paragraph">Esto es todo lo que se necesita para cambiar a comillas simples en el mismo archivo:</p>



<pre class="wp-block-code"><code>unify --quote "'" --in-place /path/to/file.py</code></pre>



<p class="wp-block-paragraph">Y así, sin más, se acabaron los ajustes manuales. Se acabó el consumo de tokens. Se acabó tener que empujar a las herramientas de IA para que obedezcan.</p>



<h1 class="wp-block-heading">Antes y después</h1>



<pre class="wp-block-code"><code># Before
print("Hello, world!")

# After
print('Hello, world!')</code></pre>



<h1 class="wp-block-heading">Conclusión</h1>



<p class="wp-block-paragraph">A veces la mejor solución es una intervención quirúrgica. Unify no solo limpió mi código—me permitió recuperar tiempo y concentración. Si estás atrapado en el purgatorio del estilo de comillas, este pequeño comando podría ser tu vía de escape.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code-es/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Unify Saved Me from Manual Quote Hell</title>
		<link>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code/</link>
					<comments>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code/#respond</comments>
		
		<dc:creator><![CDATA[Marc]]></dc:creator>
		<pubDate>Tue, 22 Jul 2025 21:59:18 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<guid isPermaLink="false">https://marc-abramowitz.com/?p=2734</guid>

					<description><![CDATA[Ever had a coding style quirk that slowly drives you mad? At work, our team follows&#160;the Black code style — with one exception: single quotes over double. Seems harmless, right? It turns out this one tiny deviation spawns a surprising amount of friction. The “Find and Replace” Fatigue Sure, I&#160;could&#160;manually search and replace quotes. But [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Ever had a coding style quirk that slowly drives you mad? At work, our team follows&nbsp;the <a href="https://black.readthedocs.io/en/stable/the_black_code_style/current_style.html">Black code style</a> — with one exception: single quotes over double. Seems harmless, right?</p>



<p class="wp-block-paragraph">It turns out this one tiny deviation spawns a surprising amount of friction.</p>



<h1 class="wp-block-heading">The “Find and Replace” Fatigue</h1>



<p class="wp-block-paragraph">Sure, I&nbsp;<em>could</em>&nbsp;manually search and replace quotes. But doing it repeatedly across files is tedious. Then I tried using&nbsp;Cursor&nbsp;to handle it, but that introduced a whole new set of headaches: large token usage, slow processing, and needing to nudge it every few steps like a stubborn robot assistant.</p>



<p class="wp-block-paragraph">It was messing with my flow.</p>



<h1 class="wp-block-heading">Enter Unify (and uv)</h1>



<p class="wp-block-paragraph">I already had&nbsp;<code><a href="https://github.com/astral-sh/uv">uv</a></code>&nbsp;installed, so bringing in <a href="https://github.com/myint/unify">Unify</a> was seamless:</p>



<pre class="wp-block-code"><code>uv tool install --python=python3.10 unify</code></pre>



<p class="wp-block-paragraph">That&nbsp;<code>--python=python3.10</code>&nbsp;bit is key—otherwise&nbsp;<code>uv</code>&nbsp;grabs Python 3.13 by default, which causes problems with&nbsp;<code>lib2to3</code>&nbsp;(yep, still relevant!).</p>



<pre class="wp-block-code"><code>Traceback (most recent call last):
  File "/Users/abramowi/.local/bin/unify", line 10, in &lt;module&gt;
    sys.exit(main())
             ~~~~^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 230, in main
    return _main(sys.argv,
                 standard_out=sys.stdout,
                 standard_error=sys.stderr)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 210, in _main
    if format_file(name, args=args, standard_out=standard_out):
       ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 144, in format_file
    encoding = detect_encoding(filename)
  File "/Users/abramowi/.local/share/uv/tools/unify/lib/python3.13/site-packages/unify.py", line 125, in detect_encoding
    from lib2to3.pgen2 import tokenize as lib2to3_tokenize
ModuleNotFoundError: No module named 'lib2to3'</code></pre>



<p class="wp-block-paragraph">Unify depends on it, so an older Python version saves the day.</p>



<h1 class="wp-block-heading">The One-Liner That Fixed Everything</h1>



<p class="wp-block-paragraph">Here’s all it takes to switch to single quotes in-place:</p>



<pre class="wp-block-code"><code>unify --quote "'" --in-place /path/to/file.py</code></pre>



<p class="wp-block-paragraph">And just like that, no more fiddling. No more token burn. No more nudging AI tools into submission.</p>



<h1 class="wp-block-heading">Before &amp; After</h1>



<pre class="wp-block-code"><code># Before
print("Hello, world!")

# After
print('Hello, world!')</code></pre>



<h1 class="wp-block-heading">Takeaway</h1>



<p class="wp-block-paragraph">Sometimes the best fix is a surgical one. Unify didn’t just clean up my code—it let me reclaim time and focus. If you’re stuck in quote-style purgatory, this one-liner might just be your escape route.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://marc-abramowitz.com/archives/2025/07/22/easy-way-to-convert-quotes-in-python-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
