Hướng dẫn dùng mnemonic dictionary python - sử dụng từ điển ghi nhớ python

Luke Pairepinart Rabidpoobear tại gmail.com Thu tháng 7 năm 23 19:11:36 CEST 2009 rabidpoobear at gmail.com
Thu Jul 23 19:11:36 CEST 2009

  • Tin nhắn trước: [Gia sư] Mnemonics để học tốt hơn Python
  • Thông điệp tiếp theo: [Gia sư] Mnemonics để học tốt hơn Python
  • Tin nhắn được sắp xếp bởi: [Ngày] [Chủ đề] [Chủ đề] [Tác giả] [ date ] [ thread ] [ subject ] [ author ]

I approach these things more along the lines of objects rather than looking
at the raw source code to remember what I'm doing.For example, I see (x, y,
z) and I think "ah, it's a little pre-packaged goodie of delicious
variables"
and when I see [x, y, z] I think "ah, it's a box with some candy at the
bottom, but there's plenty of room for me to put more.
I'm guessing all the candy is interrelated somehow because people usually
keep things that are similar in the same container"
and for dictionaries I think "hey, it's just a list that's indexed with
anything you want, instead of only integers."

I wouldn't call it "rote learning" because that would be more along the
lines of
x = {"hello": 1} # dictionary with a string as key and an integer as valuex
= {1: "hello"} # dictionary with an integer as key and a string as value
x = {1: 1} # dictionary with an integer as key and value
x = {"hello": "hello"} # dictionary with a string as key and value
.... etc.

I.E. I'm not forcing myself to learn every possibility.  I learn what
"mutability" is and then I learn what dictionaries are,
and then I understand how to use them.  I don't need mnemonics to remember
them.

I guess my point is that I see syntax more as a means for defining a
specific behavior I want, rather than as an
actual representation of the behavior.  Like, I think "I need a dictionary
here.  Oh, that's the {} thing, right?"
rather than "Oh, there needs to be {} here, I think.   Oh yeah, that's
called a dictionary"
so it doesn't really help to relate syntax to actual behavior.

I think of things on the conceptual level and translate down to Python when
I need to tell the computer how to do it.
And when I read Python code, I translate it up to conceptual level as well.

I don't see "series = form.getvalue('series').strip()" and think "okay,
there's an object called "form".  it has a method called "getvalue" and it's
getting passed "series".
Then the return value is being stripped of whitespace on both ends."

I see it and I think "okay, 'series' was passed to the program in a
user-submitted form and now it's stored in a local variable so I can
manipulate it."

On Thu, Jul 23, 2009 at 1:05 AM, David  wrote:

> Dear List,
>
> in order to memorize which Python sequences are mutable or immutable, I
> focused on the SHAPE of the brackets that are associated with each type
> of sequence.
>
> For instance, a *list* is characterised by square brackets, [].
> My mnemonic device to memorize that lists are mutable is this: "the
> brackets have sharp edges, they could be trimmed, taking their edges off".
>
> The same thing happens with *dictionaries* (which, okay, are not
> sequences). Anyway, their brackets, {}, have sharp edges, hence they are
> mutable.
>
> *Tuples*, in turn, have perfectly 'round' brackets, (), and these
> brackets obviously can't be improved upon by taking anything off them.
> Hence: tuples are immutable.
>
> That leaves us with *strings*, which are also not mutable. Here we have
> no brackets, and this particular mnemonic device breaks down.
>
> What I am interested in is finding out whether you use similar
> techniques, and if so, which ones? How, for examples, do you make sense
> of all those special characters that make regular expressions powerful?
> Do you rely on rote learning, or do you employ some other technique?
>
> I reckon that if we could come up with some tips and techniques as to
> how to uncloud the thick information fog that any beginning programmer
> has to wade through, the very first steps in learning Python could be
> made more easy.
>
> What insights can you share?
>
> Curious,
>
> David
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 

  • Tin nhắn trước: [Gia sư] Mnemonics để học tốt hơn Python
  • Thông điệp tiếp theo: [Gia sư] Mnemonics để học tốt hơn Python
  • Tin nhắn được sắp xếp bởi: [Ngày] [Chủ đề] [Chủ đề] [Tác giả] [ date ] [ thread ] [ subject ] [ author ]

Thông tin thêm về mô tả Danh sách gửi thư gia sư

Project description

python-mnemonic

Việc thực hiện tham chiếu BIP-0039: Mã ghi nhớ để tạo khóa xác định

Nội phân chính

  • Mô tả dự án
  • python-mnemonic
  • Cài đặt
  • Ví dụ sử dụng
  • 0,20-2021-07-27
  • 0.19-2019-10-01
  • Tải tập tin
  • Phân phối nguồn
  • Phân phối xây dựng

trừu tượng

BIP này mô tả việc thực hiện một mã ghi nhớ hoặc câu ghi nhớ - một nhóm các từ dễ nhớ - cho việc tạo ra các ví xác định.

Nó bao gồm hai phần: tạo ra mnenomic và chuyển đổi nó thành hạt nhị phân. Hạt này sau đó có thể được sử dụng để tạo ví xác định bằng BIP-0032 hoặc các phương pháp tương tự.

Giấy Bip

Xem https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki để biết thông số kỹ thuật đầy đủ

Cài đặt

Ví dụ sử dụng

0,20-2021-07-27

Ví dụ sử dụng

0,20-2021-07-27

from mnemonic import Mnemonic

0.19-2019-10-01

  • Tải tập tin

  • Phân phối nguồn

  • chinese_traditional

  • Phân phối xây dựng

  • trừu tượng

  • BIP này mô tả việc thực hiện một mã ghi nhớ hoặc câu ghi nhớ - một nhóm các từ dễ nhớ - cho việc tạo ra các ví xác định.

  • Nó bao gồm hai phần: tạo ra mnenomic và chuyển đổi nó thành hạt nhị phân. Hạt này sau đó có thể được sử dụng để tạo ví xác định bằng BIP-0032 hoặc các phương pháp tương tự.

  • Giấy Bip

mnemo = Mnemonic(language)
mnemo = Mnemonic("english")

Xem https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki để biết thông số kỹ thuật đầy đủ

words = mnemo.generate(strength=256)

Để cài đặt thư viện này và các phụ thuộc của nó sử dụng:

seed = mnemo.to_seed(words, passphrase="")

PIP cài đặt ghi nhớ

entropy = mnemo.to_entropy(words)

Nhập thư viện vào dự án Python thông qua:

Khởi tạo thể hiện lớp, chọn từ từ điển có sẵn:

Anh

0,20-2021-07-27

0.19-2019-10-01

  • Tải tập tin

  • Phân phối nguồn

Phân phối xây dựng

  • trừu tượng

  • BIP này mô tả việc thực hiện một mã ghi nhớ hoặc câu ghi nhớ - một nhóm các từ dễ nhớ - cho việc tạo ra các ví xác định.

Nó bao gồm hai phần: tạo ra mnenomic và chuyển đổi nó thành hạt nhị phân. Hạt này sau đó có thể được sử dụng để tạo ví xác định bằng BIP-0032 hoặc các phương pháp tương tự.

  • Giấy Bip

0.19-2019-10-01

0.19-2019-10-01

  • Tải tập tin

Tải tập tin

Phân phối nguồn

Phân phối nguồn

Phân phối xây dựng