Re: Is An Element of a Sequence an Object?

2017-06-04 Thread Marko Rauhamaa
Jon Forrest : > On 6/3/2017 5:23 PM, Steve D'Aprano wrote: >> On Sun, 4 Jun 2017 05:10 am, Jon Forrest wrote: > >> We can fix the book's statement by changing it to: >> >> A sequence is an ordered collection of *elements* ... > > That's exactly what I was thinking, but then there'd have to >

Re: Is An Element of a Sequence an Object?

2017-06-04 Thread Larry Hudson via Python-list
On 06/03/2017 09:39 PM, Chris Angelico wrote: That's a tricky thing to pin down. Since it's possible for a sequence to contain itself, or to contain something which contains it, Like a Tardis? [Sorry, couldn't resist...] ;-) OTOH, On-Topic... It might be worth while to point out that a 'ch

Re: Is An Element of a Sequence an Object?

2017-06-04 Thread Rustom Mody
On Sunday, June 4, 2017 at 12:45:23 AM UTC+5:30, Jon Forrest wrote: > I'm learning about Python. A book I'm reading about it > says "... a string in Python is a sequence. A sequence is an ordered > collection of objects". This implies that each character in a string > is itself an object. > > This

Re: Transitioning from Linux to Windows

2017-06-04 Thread Pavol Lisy
If I understand well then you like to have simple quick solution without need to learn much. And that you don't need to support big traffic... Maybe cherrypy ( http://cherrypy.org/ ) is what you like to look at. Probably this is good enough on your ubuntu: sudo apt-get install python3-cherr

Re: Is An Element of a Sequence an Object?

2017-06-04 Thread Steve D'Aprano
On Sun, 4 Jun 2017 05:48 pm, Larry Hudson wrote: > On 06/03/2017 09:39 PM, Chris Angelico wrote: >> That's a tricky thing to pin down. Since it's possible for a sequence >> to contain itself, or to contain something which contains it, > > Like a Tardis? > > [Sorry, couldn't resist...] ;-) Exa

Re: Is An Element of a Sequence an Object?

2017-06-04 Thread Steve D'Aprano
On Sun, 4 Jun 2017 04:50 pm, Peter Otten wrote: > Steven D'Aprano wrote: >> In Python 3, for example: >> >> > import sys > sys.getsizeof("abcde") # actual memory consumption >> 54 > sum(sys.getsizeof(c) for c in "acbde") # theoretical >> 250 >> >> >> So we can tell the two imple

Re: Is An Element of a Sequence an Object?

2017-06-04 Thread Thomas Jollans
On 04/06/17 09:52, Rustom Mody wrote: > On Sunday, June 4, 2017 at 12:45:23 AM UTC+5:30, Jon Forrest wrote: >> I'm learning about Python. A book I'm reading about it >> says "... a string in Python is a sequence. A sequence is an ordered >> collection of objects". This implies that each character i

error when import private key in python

2017-06-04 Thread Ho Yeung Lee
#step 1 from Crypto.PublicKey import RSA keypair = RSA.generate(2048) alice_privkey = keypair.exportKey('PEM', 'mysecret', pkcs=1) #alice_privkey = keypair.exportKey() alice_pubkey = keypair.publickey().exportKey() text_file = open("alice_pubkey.txt", "w") text_file.write(alice_pubkey) text_file.c

Re: error when import private key in python

2017-06-04 Thread Thomas Jollans
On 04/06/17 13:22, Ho Yeung Lee wrote: > # [snip] > alice_privkey=text_file.read().replace('\n', '') Why are you removing newlines? Does the documentation tell you to do this? privkey = RSA.importKey(alice_privkey,passphrase="mysecret") > Traceback (most recent call last): > File "", line

Re: Transitioning from Linux to Windows

2017-06-04 Thread Akira Li
chitt...@uah.edu writes: > ... > Ideally, I would like to set up the user on their Windows 7/10 system > so that they can "login" to the ubuntu system (say putty) - change > working directory (to where desired) - run the script (on the ubuntu > system) - and scp the file back to the windows deskto

Re: error when import private key in python

2017-06-04 Thread Ho Yeung Lee
i use wb to write pubic and private key and succeed to import private, but after decrypt, it return hex number not a clear text from Crypto.PublicKey import RSA keypair = RSA.generate(2048) alice_privkey = keypair.exportKey('PEM', 'mysecret', pkcs=1) #alice_privkey = keypair.exportKey() alice_pubk

Re: error when import private key in python

2017-06-04 Thread Ho Yeung Lee
i use "wb" to write public and private key and succeed to import private key but after decrypt, it is not clear text, it is hex number from Crypto.PublicKey import RSA keypair = RSA.generate(2048) alice_privkey = keypair.exportKey('PEM', 'mysecret', pkcs=1) #alice_privkey = keypair.exportKey() al

Re: Is An Element of a Sequence an Object?

2017-06-04 Thread Akira Li
Jon Forrest writes: > I'm learning about Python. A book I'm reading about it > says "... > a string in Python is a sequence. correct. > A sequence is an ordered collection of objects". correct. https://docs.python.org/3/glossary.html#term-sequence > This implies that each character in a strin

Re: Transitioning from Linux to Windows

2017-06-04 Thread Michael Torrie
On 06/03/2017 07:44 AM, chitt...@uah.edu wrote: > I stumbled onto "paramiko" - is that a possible answer? I'm confused why you would need to ssh anywhere. Command-line programs in Python should work perfectly fine in Windows and work about the same as on Linux, if you wrote them in a portable w

Re: Transitioning from Linux to Windows

2017-06-04 Thread Chris Angelico
On Mon, Jun 5, 2017 at 2:41 AM, Michael Torrie wrote: > I'm confused why you would need to ssh anywhere. Command-line programs > in Python should work perfectly fine in Windows and work about the same > as on Linux, if you wrote them in a portable way. I don't understand > the need to complicate

Re: Transitioning from Linux to Windows

2017-06-04 Thread chitturk
Precisely - (as Chris wrote) - the problem is NOT python itself (and yes, it can indeed run on windows machines - though I have run into some minor issues) - it is about the "user"/"users" who are pretty clueless if there is no "GUI" - several have suggested django (am going through the tutoria

Re: Transitioning from Linux to Windows

2017-06-04 Thread Thomas Jollans
On 04/06/17 22:56, chitt...@uah.edu wrote: > I was looking for the "simplest" possible solution to take a script that runs > on a Linux box and figure out a way to have it run from a windows client Care to comment on why getting the script to run on Windows directly is so difficult? I'm sure you

Re: Transitioning from Linux to Windows

2017-06-04 Thread chitturk
It is not difficult (for me) - I developed the scripts to analyze files created by two different linux boxes (why two boxes is a longer story) (these are linux machines connected to gene sequencers) - the users are likely going to be fairly naive when it comes to running/using programs - and whi

Re: Transitioning from Linux to Windows

2017-06-04 Thread Thomas Jollans
On 05/06/17 00:35, chitt...@uah.edu wrote: > It is not difficult (for me) - I developed the scripts to analyze files > created by two different linux boxes (why two boxes is a longer story) (these > are linux machines connected to gene sequencers) - the users are likely going > to be fairly naiv

Re: Is An Element of a Sequence an Object?

2017-06-04 Thread Peter Otten
Thomas Jollans wrote: > On 04/06/17 09:52, Rustom Mody wrote: >> On Sunday, June 4, 2017 at 12:45:23 AM UTC+5:30, Jon Forrest wrote: >>> I'm learning about Python. A book I'm reading about it >>> says "... a string in Python is a sequence. A sequence is an ordered >>> collection of objects". This