TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #241 · 5 мај

Можно ли в Python создавать бинарные файлы? Конечно можно. Для этого в Python есть следующие инструменты: ▫️ тип данных bytes и bytearray ▫️ открытие файла в режиме wb (write binary) или rb (read binary) ▫️ модуль struct Про модуль struct поговорим в первую очередь. Файл в формате JSON или Yaml внутри себя содержит разметку данных. Всегда можно определить где список начался а где закончился. Где записана строка а где словарь. То есть формат записи данных содержит в себе элементы разметки данных. В binary-файле данные не имеют визуальной разметки. Это просто байты, записанные один за другим. Правила записи и чтения находятся вне файла. Модуль struct как раз и помогает с организацией данных в таком файле с помощью определения форматов записи для разных частей файла. Модуль struct преобразует Python-объекты в массив байт, готовый к записи в файл и имеющий определённый вид. Для этого всегда следует указывать формат преобразования (или, как оно здесь называется - запаковки). Формат нужен для того, чтобы выделить достаточное количество байт для записи конкретного типа объекта. В последствии с помощью того же формата будет производиться чтение. При этом следует помнить что мы говорим о типах языка С а не Python. Именно формат определяет, что записано в конкретном месте файла, число, строка или что-то еще. Вот какие токены формата у нас есть. Помимо этого, первым символом можно указать порядок байтов. На разных системах одни и те же типы данных могут записываться по-разному, поэтому желательно указать конкретный способ из доступных. Если этого не сделать, то используется символ '@', то есть нативный для текущей системы. В строке формата мы пишем в каком порядке и какие типы собираемся преобразовать в байты. Запакуем в байты простое число, токен "i". >>> import struct >>> struct.pack('=i', 10) b'\n\x00\x00\x00' Теперь несколько float, при этом нужно передавать элементы не массивом а последовательностью аргументов. >>> struct.pack('=fff', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Вместо нескольких токенов можно просто указать нужное количество элементов перед одним токеном, результат будет тот же. >>> struct.pack('=3f', 1.0, 2.5, 4.1) b'\x00\x00\x80?\x00\x00 @33\x83@' Теперь запакуем разные типы >>> data = struct.pack('=fiQ', 1.0, 4, 100500) я запаковал типы float, int и unsigned long long (очень большой int, на 8 байт) b'\x00\x00\x80?\x04\x00\x00...' Распаковка происходит аналогично, но нужно указать тот же формат, который использовался при запаковке. Результат возвращается всегда в виде кортежа. >>> struct.unpack('=fiQ', data) (1.0, 4, 100500) Как видите, ничего страшного! #lib#basic

Hashtags

Резултати

Пронајдени 8 слични објави

Пребарај: #automatedtrading

当前筛选 #automatedtrading清除筛选
SLEX NEWS

@slex_io · Post #69 · 19.07.2023 г., 12:32

🚀Are you ready to elevate into a crypto trading game?🤖 SLEX will bring an array of bots designed to supercharge your trading strategies and maximize your profits. Let us introduce to you the different types of SLEX trading bots: 1️⃣ Grid Bot: This intelligent bot follows a buy-low, sell-high approach by strategically placing orders at predefined price intervals 🌊📈📉 2️⃣ Arbitrage Bot: Say hello to the Arbitrage Bot, which hunts for pricing inefficiencies and swiftly executes trades to exploit them 💸💱 3️⃣ DCA Bot: The DCA Bot allows you to gradually build your crypto position over time by spreading out your orders at regular intervals📉🔄📈 4️⃣ AI Bot: Experience the future of trading with our AI Bot, which executes trades, identifies patterns, and develops robust trading strategies 🤖📊 👉Open the window to the future with the prospects of SLEX trading bots: SLEX.io/registration #SLEX#TradingBots#CryptoTrading#AutomatedTrading Email | Telegram | Reddit | Facebook | Instagram | Medium | Linkedin | Twitter

SLEX NEWS

@slex_io · Post #73 · 01.08.2023 г., 13:32

🚀 Hello, SLEXians! 🤖As you already know SLEX platform will launch an Automatic Trading Feature along with AI-Powered Trading Bots! 💻Trading around the clock, analyzing market trends, executing trades, and even learning from market shifts – that's what our Automatic Trading Feature ensures. 🤔But we're curious... What's your trading style? Are you ready to use Trading Bots and AI? Or do you prefer a hands-on approach to navigating the crypto world? 🌊 Jump into the comments and let us know! 🗣️ We're excited to hear how you plan to use (or not use) these advanced features on the SLEX platform! 💬👥 #SLEX#CryptoTrading#AutomatedTrading#AI#TradingBots Email | Telegram | Reddit | Facebook | Instagram | Medium | Linkedin | Twitter

FX EA TRADER

@fxeatrader2023 · Post #420 · 20.10.2023 г., 08:52

🤖Unlock Automated Trading with Ease: Buy Our Robot with Bitcoin or USDT! Ready to embrace the future of trading with Forex EA Trader? We've got great news for you - now you can purchase our cutting-edge robot using Bitcoin or USDT, making it even more convenient to access our advanced trading technology. Whether you're a cryptocurrency enthusiast or prefer the stability of USDT, we've got you covered. Say goodbye to complicated payment methods and hello to a seamless trading experience. Don't miss out on this opportunity to elevate your trading journey. Get started today and see the power of automation in action! 📈Achieve Consistent Profits 📊Diversify Your Portfolio 🚀Maximize Returns, Minimize Risk Join us on this exciting trading adventure. Buy our robot now with Bitcoin or USDT and watch your investments grow effortlessly! Ready to get started? Simply contact @niko139 to purchase our robot with your preferred cryptocurrency. Let's make trading simpler and more profitable together! 💪✨#ForexEATrader#Bitcoin#USDT#AutomatedTrading

FX EA TRADER

@fxeatrader2023 · Post #366 · 05.10.2023 г., 18:19

🤖Unlock Automated Trading with Ease: Buy Our Robot with Bitcoin or USDT! Ready to embrace the future of trading with Forex EA Trader? We've got great news for you - now you can purchase our cutting-edge robot using Bitcoin or USDT, making it even more convenient to access our advanced trading technology. Whether you're a cryptocurrency enthusiast or prefer the stability of USDT, we've got you covered. Say goodbye to complicated payment methods and hello to a seamless trading experience. Don't miss out on this opportunity to elevate your trading journey. Get started today and see the power of automation in action! 📈Achieve Consistent Profits 📊Diversify Your Portfolio 🚀Maximize Returns, Minimize Risk Join us on this exciting trading adventure. Buy our robot now with Bitcoin or USDT and watch your investments grow effortlessly! Ready to get started? Simply contact @niko139 to purchase our robot with your preferred cryptocurrency. Let's make trading simpler and more profitable together! 💪✨#ForexEATrader#Bitcoin#USDT#AutomatedTrading

Daily Channels

@dailychannels · Post #6471 · 09.11.2025 г., 01:00

Channel: Crypto Signals & Automated Trading Bot Members: ~4K 💢 Username: @cryptosignalalert Description: Founded in 2017 - We provide high quality ALT COIN, Spot & Margin Signals, BTC Signals No of Trial/Free Signals Sent - 290 Success Ratio Of Trial/Free Signals - 100% We do provide Crypto Bot for Automated Trades Contact - @cripexperts for Premium Group 🏷 Tags: #crypto_fx_trading #cryptosignal#automatedtrading#cryptobot#bitcoinbot https://telegramchannels.me/channels/cryptosignalalert

Crypto M - Crypto News

@CryptoM · Post #65410 · 13.04.2026 г., 05:53

🚀 South Korea Warns of Crypto Market Abuse via APIs South Korea's Financial Supervisory Service has issued a warning to consumers regarding increasing abuse in the cryptocurrency market linked to APIs. According to NS3.AI, these application programming interfaces are responsible for approximately 30% of the nation's virtual asset trading volume. The regulator highlighted that automated trading programs are being utilized to artificially inflate transactions and manipulate market conditions. In response, a consumer advisory was released, providing examples of such misconduct to raise awareness among investors. #SouthKorea#Crypto#Cryptocurrency#API#MarketAbuse#Regulation#ConsumerProtection#AutomatedTrading#VirtualAssets#InvestorAwareness

Crypto M - Crypto News

@CryptoM · Post #64557 · 09.04.2026 г., 07:54

🚀 Binance Trading Bot Adds Full USDⓈ-M Futures Support for Position Snowball Strategy Binance Trading Bot will extend Position Snowball support to all existing Futures Grid USDⓈ-M Futures contracts, excluding ETHBTC Perpetual, effective April 9, 2026 at 08:00 UTC, according to a Binance Announcement. Position Snowball is an automated trading strategy that scales positions using unrealized profits, designed for directional trending markets. The expansion broadens the strategy's contract coverage beyond its previous scope, giving users access to a wider range of futures instruments within the automated bot framework. #Binance#TradingBot#USD-MFutures #PositionSnowball#FuturesGrid#AutomatedTrading#CryptoTrading#UnrealizedProfits#TrendingMarkets#BinanceAnnouncement