Заметка начинающим, которые часто сталкиваются с подобной непоняткой.
Ситуация следующая, есть список файлов:
names = [
'image.bmp',
'second.txt.bkp',
'data.db',
'.config.cfg',
'file.ext.bkp'
]
И мы хотим убрать у них окончание ".bkp".
Не знаю зачем, пример довольно надуманный) Но суть он показывает, а это главное.
Те, кто еще не очень знаком с библиотекой os.path или pathlib, вероятно решат обработать имена как строки. И тут вполне подойдет метод строки strip().
Что делает этот метод? Он отрезает указанные символы по обеим сторонам строки. Если ничего не указать, то убирает невидимые символы (пробелы, табуляции и переносы строк).
В нашем случае будет выглядеть вот так:
>>> name.strip('.bkp')
То есть просим удалить строку '.bkp' по краям имени файла, если таковая есть.
Можно применить аналогичный метод rstrip(), чтобы отрезать только справа, но для этого примера используем обычный.
>>> for name in names:
>>> print(name.strip('.bkp'))
image.bm
second.txt
data.d
config.cfg
file.ext
Хм, что-то не то с нашими именами! Что случилось??? Видим нежелательное переименование в именах, где и близко не было указанной строки '.bkp'
А дело всё в том, что данный метод ищет не указанную строку, а указанные символы, и не важно в каком порядке.
Для метода strip() строка '.bkp' это не паттерн для поискаа список символов. Потому он отрезал симовол 'p' от '.bmp' и удалил точку из файла '.config.cfg'.
Как тогда правильно заменить именно паттерн? Для начинающего можно посоветовать метод строки replace(), который как раз использует для замены указанную строку целиком. В нашем примере заменим её на пустую строку.
>>> for name in names:
>>> print(name.replace('.bkp', ''))
image.bmp
second.txt
data.db
.config.cfg
file.ext
Уже лучше, но помните, это лишь пример про strip(). Для работы с именами файлов есть способы и более "правильные", дающие однозначно верный результат. Я взял файлы только в качестве примера. Даже replase() тут может сделать не то что ожидаем.
Просто впредь будьте внимательны с этим strip().
#basic
China Targets Virtual Currency Money Laundering
In 2024, China's Supreme People's Procuratorate plans to prosecute 3,032 individuals for money laundering, particularly involving the use of virtual currency to transfer illicit funds. Read more here.
#China#MoneyLaundering#Crypto#Bitcoin#VirtualCurrency#VC
𝐂𝐨𝐦𝐩𝐥𝐢𝐚𝐧𝐜𝐞 𝐑𝐞𝐦𝐢𝐧𝐝𝐞𝐫
Напоминание для коллег из платежных организаций.
В соответствии с Правилами представления сведений о платежных услугах, утвержденными Постановлением Правления Национального Банка Республики Казахстан от 31 августа 2016 года № 213, платежные организации, прошедшие учетную регистрацию в Национальном Банке, должны представлять регулятору форму "Сведения по принятым мерам, направленным на противодействие легализации (отмыванию) доходов, полученных преступным путем, и финансированию терроризма".
Данная форма представляется на полугодовой основе, не позднее десятого (включительно) числа месяца, следующего за отчетным полугодием.
Пояснение к заполнению формы отражены в приложении 16 к указанным правилам.
#compliancereminder от Compliance Hub призван повысить осведомленность комьюнити о требованиях, затрагивающих вопросы комплаенс и ПОД/ФТ, а также положительно сказаться на формировании комплаенс культуры
#compliancehub#compliance#amlcft#moneylaundering
An organized group engaged in illegal cryptocurrency operations was detained in Tashkent. The suspects are accused of laundering over 180 billion soums through foreign betting companies.
https://yep.uz/en/2025/09/illegal-cryptocurrency-operations-tashkent/
#Tashkent#Uzbekistan#cryptocurrency#illegaltransactions#moneylaundering#MIA
Binance Faces Legal Challenges in France
👑 Binance is under investigation in France for tax fraud, illegal drug trading, and money laundering. French regulators have initiated legal proceedings against the crypto exchange. 🔵Read more here.
#Binance#France#Crypto#Legal#Regulatory#TaxFraud#MoneyLaundering
🚀 U.S. Senate Faces Challenges Over Cryptocurrency Legislation
A cryptocurrency bill led by U.S. Senate Banking Committee Chairman Tim Scott is facing bipartisan challenges due to a controversial clause concerning DeFi developer protections. According to ChainCatcher, the clause proposes exemptions for non-custodial software developers who do not control user funds, allowing them to avoid registration as money transmitters or compliance with anti-money laundering regulations.
Law enforcement organizations, including the National Sheriffs' Association and the National District Attorneys Association, have expressed concerns to Congress, warning that the clause could weaken efforts to combat financial crime. Senate Judiciary Committee Chairman Chuck Grassley has also voiced similar concerns.
The cryptocurrency industry views the clause as central to the bill, with DeFi Education Fund Executive Director Amanda Tuminelli stating that any changes to the text are unacceptable. Democratic Senators Catherine Cortez Masto and Mark Warner are advocating for modifications to the clause. If bipartisan consensus is not reached, the bill may proceed without Democratic support, potentially affecting the required bipartisan majority for a full Senate vote.
#USSenate#Cryptocurrency#Legislation#DeFi#FinancialCrime#MoneyLaundering#Bipartisan#TimScott#LawEnforcement#SenateJudiciary#ChuckGrassley#DeFiDeveloperProtections#AntiMoneyLaundering
SEC Reviews Bitcoin and Ethereum ETFs
Cboe BZX proposed rule changes to SEC for ARK 21Shares Bitcoin ETF and 21Shares Core Ethereum ETF, allowing in-kind creations and redemptions.
Additionally, Venice, founded by Erik Voorhees, opened its API for AI development and launched the Venice token (VVV) with airdrop to over 250k users.
DARPA initiated a pre-crime AML program to combat digital asset money laundering, raising concerns over discrimination. Kucoin pled guilty to unlicensed money transmitter charges, resulting in deferred prosecution agreements.
Bitcoin prices fluctuating, with recent transactions indicating notable movements.
More developments in the crypto market with potential implications on broader economic issues.
📈 Current Bitcoin price: $102,000.
For more: Nate Geraci, Leviathan News, Leviathan News, Leviathan News
#SEC#Bitcoin#Ethereum#ETF#Crypto#AI#VC#Venice#Kucoin#AML#DARPA#DigitalAssets#CryptoMarket#Investing#MoneyLaundering#FinancialRegulation#Cryptocurrency#TokenLaunch#TechInnovation#FutureFinance#MarketTrends
Bitcoin Turns 16: Celebrating Blockchain's Birth
🎉 Bitcoin celebrates its 16th anniversary today, marking the generation of its genesis block on January 3, 2009, by Satoshi Nakamoto. This milestone began a monetary revolution focused on decentralization and sovereignty.
🔗 Read more: Celebrating Bitcoin
🔗 Earlier report: Identity of Satoshi Nakamoto Revealed?
⚖️ On a legal note, Do Kwon faces serious accusations including fraud and money laundering, with a potential prison sentence of 130 years if convicted. His next court hearing is set for January 8. 🔗 More on Kwon: Reuters
🔮 Experts predict significant developments for cryptocurrency and AI integration by 2025, with Bitcoin potentially hitting $500,000.
#Bitcoin#SatoshiNakamoto#DoKwon#Terra#Crypto#Blockchain#Fraud#MoneyLaundering#AI#VC#Economy #2025 #Cryptocurrency#Investment#BlockchainTechnology#Legal#Innovation#Milestone#Anniversary#Decentralization#PeerToPeer
Yakuza Laundering via Pokémon Cards
Japanese yakuza are reportedly laundering money using Pokémon cards, exploiting their high liquidity and easy transport. Some cards can fetch thousands of dollars, enabling the mafia to purchase sets with illicit funds, smuggle them abroad, and sell to collectors for substantial gains. They employ a scheme to locate rare cards, using methods like weighing boosters and employing metal detectors.
#Yakuza#MoneyLaundering#PokémonCards#IllicitTrade#Collectibles#Japan#CriminalScheme#RareCards#HighValue#Smuggling#BlackMarket#Money#Gaming#Investment#Detective#Counterfeit