Re: the best online course

2016-07-07 Thread Rustom Mody
On Thursday, July 7, 2016 at 8:38:15 AM UTC+5:30, Michael Torrie wrote: > On 07/06/2016 06:50 PM, Lawrence D’Oliveiro wrote: > >> I want to be easy and not bored so i can learn python. > > > > There is no Royal Road, nothing is going to be handed to you on a plate. > > Seconded. If he gets bored

Re: Clean Singleton Docstrings

2016-07-07 Thread Michael Selik
> On Jul 7, 2016, at 7:46 PM, Rob Gaddi > wrote: > > I've got a package that contains a global ensmartened dict that allows > all the various parts of my program to share state. The simplest solution would be to use a module as your singleton. For example, "registry.py" would work. Pydoc wil

Re: Clean Singleton Docstrings

2016-07-07 Thread Steven D'Aprano
On Fri, 8 Jul 2016 09:46 am, Rob Gaddi wrote: [...] > So Registry is now a globally accessible mutable object; no reason to > complicate things with singletons or borgs or whathave you. From > within the interactive console, help(foobar.Registry) gives me the > _Registry documentation as expected.

Clean Singleton Docstrings

2016-07-07 Thread Rob Gaddi
I've got a package that contains a global ensmartened dict that allows all the various parts of my program to share state. Things like device handles, information about the application environment, etc. that are inherantly global (i.e. we're not having that debate). Implementation is: class _R

Pylint 1.6.0 released

2016-07-07 Thread Claudiu Popa
Hi folks, I am joyful to announce the release of Pylint 1.6.0. This is the next minor release in the 1.X branch and most probably the last one, since we are preparing the taking off of Pylint 2.0. This release has a couple of small improvements, bug fixes and new checks, comparing to the last on

Re: sqlite3 scrapy

2016-07-07 Thread Thomas Kaufmann
Am Donnerstag, 7. Juli 2016 16:56:48 UTC+2 schrieb Peter Otten: > Thomas Kaufmann wrote: > > > Am Donnerstag, 7. Juli 2016 16:05:14 UTC+2 schrieb Thomas Kaufmann: > >> Hi, > >> > >> I have a little scrapy-script: scrapy gets the links from a webpage; this > >> works fine. Then I want to write the

Re: sqlite3 scrapy

2016-07-07 Thread Thomas Kaufmann
Am Donnerstag, 7. Juli 2016 16:52:12 UTC+2 schrieb Chris Angelico: > On Fri, Jul 8, 2016 at 12:42 AM, Thomas Kaufmann wrote: > > I changed my code in the way you suggested. There is no effect in the db. I > > start this script on the commandline with: > > > > tk@Hamlet:~/myscrapy/tutorial/tutoria

Re: sqlite3 scrapy

2016-07-07 Thread Peter Otten
Peter Otten wrote: More errors than words :( >> There is no effect in the db. > > Did you replace the line > > conn.commit > > with > > con.commit() Of course the updated code should read conn.commit() > ? If not, can you provide the updated code? and that should have been "If yes, ...",

Re: sqlite3 scrapy

2016-07-07 Thread Peter Otten
Thomas Kaufmann wrote: > Am Donnerstag, 7. Juli 2016 16:05:14 UTC+2 schrieb Thomas Kaufmann: >> Hi, >> >> I have a little scrapy-script: scrapy gets the links from a webpage; this >> works fine. Then I want to write these links in a sqlite3-table. There is >> no error-note. But in the database ar

Re: sqlite3 scrapy

2016-07-07 Thread Chris Angelico
On Fri, Jul 8, 2016 at 12:42 AM, Thomas Kaufmann wrote: > I changed my code in the way you suggested. There is no effect in the db. I > start this script on the commandline with: > > tk@Hamlet:~/myscrapy/tutorial/tutorial/spiders$ scrapy crawl webbot You have some print calls in your code. Are t

Re: sqlite3 scrapy

2016-07-07 Thread Thomas Kaufmann
Am Donnerstag, 7. Juli 2016 16:05:14 UTC+2 schrieb Thomas Kaufmann: > Hi, > > I have a little scrapy-script: scrapy gets the links from a webpage; this > works fine. Then I want to write these links in a sqlite3-table. There is no > error-note. But in the database are not any records. What is th

Re: sqlite3 scrapy

2016-07-07 Thread Chris Angelico
On Fri, Jul 8, 2016 at 12:04 AM, wrote: > 34 sql = "INSERT INTO Frisch VALUES(" + unicode(counter) + > ", " + "'" + el.strip() + "');" Don't ever do this. Instead, use parameterized queries: cur.execute("INSERT INTO Frisch VALUES (?, ?)", (counter, el.strip())) > 38

sqlite3 scrapy

2016-07-07 Thread tokauf
Hi, I have a little scrapy-script: scrapy gets the links from a webpage; this works fine. Then I want to write these links in a sqlite3-table. There is no error-note. But in the database are not any records. What is the problem here? My code: # -*- coding: utf-8 -*- 2 3 import scrapy 4

Re: Spot the bug: getoptquestion.py

2016-07-07 Thread Oscar
In article , Chris Angelico wrote: >Yes, it's a third-party dependency. (Sorry, should have mentioned >that.) You're welcome to consider that to be too much risk and/or >hassle to be worth improving on getopt, but personally, I *really* >like the simplicity of just writing docstrings that still r

Re: Spot the bug: getoptquestion.py

2016-07-07 Thread Chris Angelico
On Thu, Jul 7, 2016 at 9:30 PM, Oscar wrote: > Thanks all for the input. I think it all boils down to: "If you don't > want a space in your long_option, don't put a space in there". Yeah, I guess, pretty much! > Mmm... nope. I'm not going to learn a new tool and introduce an extra > dependency j

Re: Spot the bug: getoptquestion.py

2016-07-07 Thread Oscar
In article , Chris Angelico wrote: >On Wed, Jul 6, 2016 at 2:04 PM, Lawrence D’Oliveiro > wrote: >> On Tuesday, July 5, 2016 at 1:42:42 AM UTC+12, Chris Angelico wrote: >> >>> The getopt module is designed to match the C getopt function, which I've >>> never used; for my command-line parsing, I

EuroPython 2016: Last day to get tickets at regular rate

2016-07-07 Thread M.-A. Lemburg
We will be switching to the on-desk rates for tickets tomorrow, so today is your last chance to get tickets at the regular rate, which is about 30% less than the on-desk rate: EuroPython 2016 Registration *** https://ep2016.europython.eu/registration/ *** Day Pa