<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915018</guid>
        <pubDate>Wed, 18 Dec 2024 05:26:15 +0000</pubDate>
        <title>Поменять HEX на  Decimal</title>
        <link>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915018</link>
        <description><![CDATA[MBo: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Получилось так : b&#39;\xed\xf3&#39;</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
<br>
Ну вы же не показали, что из себя представляют данные]]></description>
        <author>MBo</author>
        <category>Python</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915014</guid>
        <pubDate>Tue, 17 Dec 2024 19:53:43 +0000</pubDate>
        <title>Поменять HEX на  Decimal</title>
        <link>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915014</link>
        <description><![CDATA[macomics: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=454654&view=findpost&p=3915008'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Alexei &#064; <time class="tag-quote__quoted-time" datetime="2024-12-17T14:58:43+00:00">17.12.24, 14:58</time></span><div class='quote '>В дате не буквы , а байты , которые видны в хекс - редакторе.</div></div><br>
Это и есть бинарная строка, а &quot;<strong class='tag-b'>b&#39;&#092;xed&#092;xf3&#39;</strong>&quot; это её представление при выводе текстовой функцией на устройство работы с текстом]]></description>
        <author>macomics</author>
        <category>Python</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915008</guid>
        <pubDate>Tue, 17 Dec 2024 14:58:43 +0000</pubDate>
        <title>Поменять HEX на  Decimal</title>
        <link>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915008</link>
        <description><![CDATA[Alexei: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=454654&view=findpost&p=3915006'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>macomics &#064; <time class="tag-quote__quoted-time" datetime="2024-12-17T11:28:52+00:00">17.12.24, 11:28</time></span><div class='quote '> бинарной строки</div></div><br>
Там бинарный код.<br>
<br>
В дате не буквы , а байты , которые видны в хекс - редакторе.]]></description>
        <author>Alexei</author>
        <category>Python</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915006</guid>
        <pubDate>Tue, 17 Dec 2024 11:28:52 +0000</pubDate>
        <title>Поменять HEX на  Decimal</title>
        <link>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915006</link>
        <description><![CDATA[macomics: Вообще в десятичных кодах должно выводить по умолчанию. Это только если у вас на самом деле data не записана в виде &quot;<strong class='tag-b'>b&#39;&#092;xed&#092;xf3&#39;</strong>&quot; -- бинарной строки<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">$ cat test_numpy_int16.py </div><div class="code_line">import numpy as np</div><div class="code_line">&nbsp;</div><div class="code_line">data_int16 = np.array([32767, -2, -1, 0, 1, 2, -32768], dtype=np.int16)</div><div class="code_line">data_uint16 = np.array([65535, 5, 4, 3, 2, 1, 0], dtype=np.uint16)</div><div class="code_line">&nbsp;</div><div class="code_line">print(&#39;int16 array:&#39;, data_int16)</div><div class="code_line">print(&#39;uint16 array:&#39;, data_uint16)</div><div class="code_line">&nbsp;</div><div class="code_line">$ python ./test_numpy_int16.py </div><div class="code_line">int16 array: [ 32767 &nbsp; &nbsp; -2 &nbsp; &nbsp; -1 &nbsp; &nbsp; &nbsp;0 &nbsp; &nbsp; &nbsp;1 &nbsp; &nbsp; &nbsp;2 -32768]</div><div class="code_line">uint16 array: [65535 &nbsp; &nbsp; 5 &nbsp; &nbsp; 4 &nbsp; &nbsp; 3 &nbsp; &nbsp; 2 &nbsp; &nbsp; 1 &nbsp; &nbsp; 0]</div></ol></div></div></div></div>Вот вам пример int16, которые нормальные int16, а не чуждые псевод int16 из непонятной библиотеки.]]></description>
        <author>macomics</author>
        <category>Python</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915004</guid>
        <pubDate>Tue, 17 Dec 2024 10:47:16 +0000</pubDate>
        <title>Поменять HEX на  Decimal</title>
        <link>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3915004</link>
        <description><![CDATA[Alexei: Сделал так : <strong class='tag-b'>.write(str(int.from_bytes(data, &quot;little&quot;, signed=&quot;True&quot;)))</strong><br>
Слишком много буковв. Может красивше можно?]]></description>
        <author>Alexei</author>
        <category>Python</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3914999</guid>
        <pubDate>Tue, 17 Dec 2024 08:29:41 +0000</pubDate>
        <title>Поменять HEX на  Decimal</title>
        <link>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3914999</link>
        <description><![CDATA[Alexei: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=454654&view=findpost&p=3914991'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>MBo &#064; <time class="tag-quote__quoted-time" datetime="2024-12-17T03:57:10+00:00">17.12.24, 03:57</time></span><div class='quote '>нужно сделать ... ничего.<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">write(str(data))</div></ol></div></div></div></div></div></div><br>
<br>
Получилось так : <strong class='tag-b'>b&#39;&#092;xed&#092;xf3&#39;</strong><br>
Нужно знаковое десятичное.<br>
<br>
<div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=454654&view=findpost&p=3914989'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>macomics &#064; <time class="tag-quote__quoted-time" datetime="2024-12-16T17:59:41+00:00">16.12.24, 17:59</time></span><div class='quote '>data = int(&quot;ABCD&quot;, 16)</div></div><br>
<br>
Так не пойдет, я не правильно озаглавил . <br>
Надо: байты int16, преобразовать  в десятичные .]]></description>
        <author>Alexei</author>
        <category>Python</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3914991</guid>
        <pubDate>Tue, 17 Dec 2024 03:57:10 +0000</pubDate>
        <title>Поменять HEX на  Decimal</title>
        <link>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3914991</link>
        <description><![CDATA[MBo: Если у вас есть число, то, чтобы оно выводилось именно в десятичном виде, нужно сделать ... ничего.<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">write(str(data))</div></ol></div></div></div></div><br>
<br>
или любую функцию для форматных строк, если требуется определённый формат.]]></description>
        <author>MBo</author>
        <category>Python</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3914989</guid>
        <pubDate>Mon, 16 Dec 2024 17:59:41 +0000</pubDate>
        <title>Поменять HEX на  Decimal</title>
        <link>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3914989</link>
        <description><![CDATA[macomics: <div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">data = int(&quot;ABCD&quot;, 16)</div></ol></div></div></div></div>]]></description>
        <author>macomics</author>
        <category>Python</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3914988</guid>
        <pubDate>Mon, 16 Dec 2024 17:34:55 +0000</pubDate>
        <title>Поменять HEX на  Decimal</title>
        <link>https://forum.sources.ru/index.php?showtopic=454654&amp;view=findpost&amp;p=3914988</link>
        <description><![CDATA[Alexei: В дата считаны байты int16, преобразовывал их в хекс и  выводил в текстовый фаил, теперь надо в десятичные . Ничего типа &quot;.dec()&quot; не нашел.<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">&nbsp;f_out.write (data.hex())</div></ol></div></div></div></div>]]></description>
        <author>Alexei</author>
        <category>Python</category>
      </item>
	
      </channel>
      </rss>
	