🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.programming
Article #217412

Re: Python 3, string, bytes i bytearray

#217412
From: Maciej Sobczak
Date: Mon, 01 Mar 2021 16:25
14 lines
1476 bytes
> Potrzebuję przekazać do metody zmienną typu bytes, czyli łańcuch z b'', 
> ale chciałbym tam wsadzić zera (nie kody ascii cyfry zero, tylko bajty o 
> wartości zero) i nie umiem, jak to zrobić? 

PorĂłwnaj:

s1 = 'abc\0xyz'
for v in s1: print(v)

s2 = b'abc\0xyz'
for v in s2: print(v)

-- 
Maciej Sobczak * http://www.inspirel.com
Technical Details
Message-ID: <5e249941-9913-4fac-a07e-197c1070655an@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!goblin1!goblin.stu.neva.ru!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
References: <603d032b$0$525$65785112@news.neostrada.pl>

Show Full Headers
Complete Article Headers
X-Received: by 2002:a37:de0e:: with SMTP id h14mr15835913qkj.472.1614615931229;        Mon, 01 Mar 2021 08:25:31 -0800 (PST)
X-Received: by 2002:a0c:8623:: with SMTP id p32mr7115111qva.23.1614615930999; Mon, 01 Mar 2021 08:25:30 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!wsisiz.edu.pl!goblin1!goblin.stu.neva.ru!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: pl.comp.programming
Date: Mon, 1 Mar 2021 08:25:30 -0800 (PST)
In-Reply-To: <603d032b$0$525$65785112@news.neostrada.pl>
Injection-Info: google-groups.googlegroups.com; posting-host=213.108.152.51; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S
NNTP-Posting-Host: 213.108.152.51
References: <603d032b$0$525$65785112@news.neostrada.pl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5e249941-9913-4fac-a07e-197c1070655an@googlegroups.com>
Subject: Re: Python 3, string, bytes i bytearray
From: Maciej Sobczak <see.my.homepage@gmail.com>
Injection-Date: Mon, 01 Mar 2021 16:25:31 +0000
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit