Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Peter Otten
Steven D'Aprano wrote: > On Sun, 04 Jun 2017 02:15:33 +, Grant Edwards wrote: > >> On 2017-06-03, Thomas Jollans wrote: >>> On 03/06/17 21:10, 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

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Chris Angelico
On Sun, Jun 4, 2017 at 2:17 PM, Jon Forrest wrote: > On 6/3/2017 4:58 PM, Chris Angelico wrote: > >> A sequence doesn't necessarily "contain" anything. > > > Maybe not always, but doesn't > > "abc" > > contain three characters? Is 'contain' the right word? That's a tricky thing to pin down. Since

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Steven D'Aprano
On Sat, 03 Jun 2017 21:06:19 -0700, Jon Forrest wrote: > I wasn't thinking so much about the objects produced by an operation on > a sequence as I was about when the sequence is created. A trivial > sequence is > > "abc" > > As I understand it, this is one object, not three. The original excerpt

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Steven D'Aprano
On Sun, 04 Jun 2017 02:15:33 +, Grant Edwards wrote: > On 2017-06-03, Thomas Jollans wrote: >> On 03/06/17 21:10, 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

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread 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 be a clear definition of "ele

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Jon Forrest
On 6/3/2017 4:58 PM, Chris Angelico wrote: A sequence doesn't necessarily "contain" anything. Maybe not always, but doesn't "abc" contain three characters? Is 'contain' the right word? As has been mentioned, a range object is a sequence, but it creates integer objects lazily. So there mu

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Jon Forrest
On 6/3/2017 5:03 PM, Ben Finney wrote: Jon Forrest writes: I'm learning about Python. A book I'm reading about it Can you say which book, and where in the book it says this? With all due respect, I'd rather not. The author has been very responsive when I raised this issue, and I don't want

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Grant Edwards
On 2017-06-03, Thomas Jollans wrote: > On 03/06/17 21:10, 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 o

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Erik
On 04/06/17 00:42, Jon Forrest wrote: On 6/3/2017 12:38 PM, Thomas Jollans wrote: >> I'd like to suggest an explanation of what a sequence is >> that doesn't use the word 'object' because an object has >> a specific meaning in Python. >> >> Am I on the right track here? > > No, strings do

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Steve D'Aprano
On Sun, 4 Jun 2017 05:10 am, 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. Which book is this? Because

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Ben Finney
Jon Forrest writes: > I'm learning about Python. A book I'm reading about it Can you say which book, and where in the book it says this? > 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 o

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Chris Angelico
On Sun, Jun 4, 2017 at 9:42 AM, Jon Forrest wrote: > On 6/3/2017 12:38 PM, Thomas Jollans wrote: > >>> I'd like to suggest an explanation of what a sequence is >>> that doesn't use the word 'object' because an object has >>> a specific meaning in Python. >>> >>> Am I on the right track here? >> >>

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Jon Forrest
On 6/3/2017 12:38 PM, Thomas Jollans wrote: >> I'd like to suggest an explanation of what a sequence is >> that doesn't use the word 'object' because an object has >> a specific meaning in Python. >> >> Am I on the right track here? > > No, strings don't internally store the characters as objects

Re: Bug or intended behavior?

2017-06-03 Thread Chris Angelico
On Sun, Jun 4, 2017 at 7:59 AM, Sean DiZazzo wrote: > I get what it's doing, it just doesn't make much sense to me. Looking at > operator precedence, I only see the % operator in regards to modulus. > Nothing in regards to string formatting. Is it just a side effect of the % > being overload

Re: Bug or intended behavior?

2017-06-03 Thread Sean DiZazzo
On Friday, June 2, 2017 at 10:46:03 AM UTC-7, bob gailer wrote: > On 6/2/2017 1:28 PM, Jussi Piitulainen wrote: > > sean.diza...@gmail.com writes: > > > >> Can someone please explain this to me? Thanks in advance! > >> > >> ~Sean > >> > >> > >> Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 12:

Are celery threads independent?

2017-06-03 Thread Heron Rossi
Are they independent in a way that each thread will spawn a new process and won't share resources? -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] How to improve my programming skills?

2017-06-03 Thread mbg1708
> I'm looking for a way (*the* way, ie. the "BEST(tm)" way) to improve > my coding skills. While I'm a quite hard-core computer geek since 25 > years and a really good (hobbyist) Linux-SOHO-Admin, my programming > skills are less than sub-par. I wish to change that and become at > least am ave

Re: Transitioning from Linux to Windows

2017-06-03 Thread Wolfgang Maier
On 03.06.2017 15:44, chitt...@uah.edu wrote: I am looking for suggestions, ideas. I have developed python (3.6.x, 2.7.x) scripts that run well as a user on an ubuntu/16.04 system - the scripts look for files, parses the files, assembles an output for the user. I first cd into a particular dir

Re: Is An Element of a Sequence an Object?

2017-06-03 Thread Thomas Jollans
On 03/06/17 21:10, 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 doesn't seem right to me, but

Is An Element of a Sequence an Object?

2017-06-03 Thread Jon Forrest
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 doesn't seem right to me, but since I'm just learning Python I questioned the

Re: Transitioning from Linux to Windows

2017-06-03 Thread Chris Angelico
On Sun, Jun 4, 2017 at 12:24 AM, wrote: > On Saturday, June 3, 2017 at 8:50:27 AM UTC-5, Chris Angelico wrote: > >> Hmm. ISTM the easiest way would be to run an explicit server, probably >> HTTP (hence Django as you mentioned), and then you can have people >> access it using a client on Windows.

Re: [OT] How to improve my programming skills?

2017-06-03 Thread Paul Rubin
Mirko writes: > TLDR: Sorry for OT. Long-time Linux geek and hobby programmer wants to > improve his coding skills. What's most important: project planing, > algorithms and data structures, contributing to FOSS, web development, > learning other languages or something else? If it's specifically

Re: noCaptcha cracking handler

2017-06-03 Thread Paul Rubin
skyteacherus...@gmail.com writes: > Please check out my latest repository > https://github.com/gubrul/noCaptcha Thanks. Captchas have gotten to be a real PITA lately, even as someone who doesn't want to run automated clients on the infected sites. I remember getting sick of trying to identify pi

noCaptcha cracking handler

2017-06-03 Thread skyteacherusers
Hey, Please check out my latest repository https://github.com/gubrul/noCaptcha Thanks:) -- https://mail.python.org/mailman/listinfo/python-list

Re: Transitioning from Linux to Windows

2017-06-03 Thread justin walters
On Jun 3, 2017 7:28 AM, wrote: On Saturday, June 3, 2017 at 8:50:27 AM UTC-5, Chris Angelico wrote: > Hmm. ISTM the easiest way would be to run an explicit server, probably > HTTP (hence Django as you mentioned), and then you can have people > access it using a client on Windows. With HTTP, that

Re: Transitioning from Linux to Windows

2017-06-03 Thread chitturk
On Saturday, June 3, 2017 at 8:50:27 AM UTC-5, Chris Angelico wrote: > Hmm. ISTM the easiest way would be to run an explicit server, probably > HTTP (hence Django as you mentioned), and then you can have people > access it using a client on Windows. With HTTP, that client would > simply be a web b

Re: Transitioning from Linux to Windows

2017-06-03 Thread Chris Angelico
On Sat, Jun 3, 2017 at 11:44 PM, wrote: > 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 w

Transitioning from Linux to Windows

2017-06-03 Thread chitturk
I am looking for suggestions, ideas. I have developed python (3.6.x, 2.7.x) scripts that run well as a user on an ubuntu/16.04 system - the scripts look for files, parses the files, assembles an output for the user. I first cd into a particular directory on the system (where I know the files e

Re: how to convert json to csv with python?

2017-06-03 Thread Peter Otten
Ho Yeung Lee wrote: > after edit the file, > > Traceback (most recent call last): > File "json2csv.py", line 148, in > loader.load(args.json_file) > File "json2csv.py", line 53, in load > self.process_each(json.load(json_file)) > File "C:\Python27\lib\json\__init__.py", line 291, i

Re: Python DB API - commit() v. execute("commit transaction")?

2017-06-03 Thread Jon Ribbens
On 2017-06-02, Chris Angelico wrote: > On Sat, Jun 3, 2017 at 5:31 AM, Jon Ribbens wrote: >> I'm not saying that transactional DDL is insane (it isn't), but MyISAM >> tables having transactions *only* for DDL is... surprising. Especially >> when it suddenly appeared as a "feature" in between two

Re: how to convert json to csv with python?

2017-06-03 Thread Ho Yeung Lee
after edit the file, Traceback (most recent call last): File "json2csv.py", line 148, in loader.load(args.json_file) File "json2csv.py", line 53, in load self.process_each(json.load(json_file)) File "C:\Python27\lib\json\__init__.py", line 291, in load **kw) File "C:\Python27

Re: how to convert json to csv with python?

2017-06-03 Thread Chris Warrick
On 3 June 2017 at 13:00, Ho Yeung Lee wrote: > i use > https://github.com/evidens/json2csv > > Error: > Traceback (most recent call last): > File "json2csv.py", line 148, in > loader.load(args.json_file) > File "json2csv.py", line 53, in load > self.process_each(json.load(json_file))

how to convert json to csv with python?

2017-06-03 Thread Ho Yeung Lee
i use https://github.com/evidens/json2csv Error: Traceback (most recent call last): File "json2csv.py", line 148, in loader.load(args.json_file) File "json2csv.py", line 53, in load self.process_each(json.load(json_file)) File "C:\Python27\lib\json\__init__.py", line 291, in load