Re: How to become more motivated to learn Python

2016-05-03 Thread Larry Hudson via Python-list
On 05/03/2016 07:55 PM, Cai Gengyang wrote: Cool, I have finally summoned up enough activation energy to start on Unit 3, now going through the topic on Conditionals and Control Flows (stuff like this) boolthree = 200 == (50 * 5) boolthree False Guess it would be really cool to work on AI an

Re: Fastest way to retrieve and write html contents to file

2016-05-03 Thread DFS
On 5/3/2016 2:41 PM, Tim Chase wrote: On 2016-05-03 13:00, DFS wrote: On 5/3/2016 11:28 AM, Tim Chase wrote: On 2016-05-03 00:24, DFS wrote: One small comparison I was able to make was VBA vs python/pyodbc to summarize an Access database. Not quite a fair test, but interesting nonetheless. A

python chess engines

2016-05-03 Thread DFS
On 5/3/2016 8:00 PM, DFS wrote: How far along are you in your engine development? I can display a text-based chess board on the console (looks better with a mono font). 8 BR BN BB BQ BK BB BN BR 7 BP BP BP BP BP BP BP BP 6 __ __ __ __ __ __ __ __ 5 __ __ __ __ __ __ __ __ 4 __ _

Re: How to become more motivated to learn Python

2016-05-03 Thread Christopher Reimer
On 5/3/2016 8:00 PM, DFS wrote: How far along are you in your engine development? I can display a text-based chess board on the console (looks better with a mono font). 8 BR BN BB BQ BK BB BN BR 7 BP BP BP BP BP BP BP BP 6 __ __ __ __ __ __ __ __ 5 __ __ __ __ __ __ __ __ 4

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Steven D'Aprano
On Wed, 4 May 2016 12:49 am, Jussi Piitulainen wrote: > DFS writes: > >> On 5/3/2016 9:13 AM, Chris Angelico wrote: > >>> It doesn't invert, the way numeric negation does. >> >> What do you mean by 'case inverted'? >> >> It looks like it swaps the case correctly between upper and lower. > > The

Re: How to become more motivated to learn Python

2016-05-03 Thread DFS
On 5/3/2016 10:12 PM, Christopher Reimer wrote: When I realized that I wasn't learning enough about the Python language from translating BASIC games, I started coding a chess engine. If you ever look at the academic literature for chess programming from the last 50+ years, you can spend a lifet

Re: How to become more motivated to learn Python

2016-05-03 Thread Cai Gengyang
Cool, I have finally summoned up enough activation energy to start on Unit 3, now going through the topic on Conditionals and Control Flows (stuff like this) >>> boolthree = 200 == (50 * 5) >>> boolthree False Guess it would be really cool to work on AI and games. ( I have been addicted to comp

Re: How to become more motivated to learn Python

2016-05-03 Thread Christopher Reimer
On 5/3/2016 4:20 AM, Cai Gengyang wrote: So I have completed up to CodeAcademy's Python Unit 2 , now moving on to Unit3 : Conditionals and Control Flow. But I feel my motivation wavering , at times I get stuck and frustrated when trying to learn a new programming language ? This might not be

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Steven D'Aprano
On Wed, 4 May 2016 12:42 am, Jussi Piitulainen wrote: > Ceterum censeo, the only suggested use for .swapcase I've ever heard of > is encryption. iF YOU'RE PROGRAMMING AN EDITOR, sWAP cASE IS REALLY USEFUL FOR THOSE LITTLE capslock ACCIDENTS THAT PLAGUE TYPISTS. -- Steven -- https://mail.pyt

Re: You gotta love a 2-line python solution

2016-05-03 Thread Steven D'Aprano
On Tue, 3 May 2016 01:56 pm, DFS wrote: > On 5/2/2016 11:27 PM, jf...@ms4.hinet.net wrote: >> DFS at 2016/5/3 9:12:24AM wrote: >>> try >>> >>> from urllib.request import urlretrieve >>> >>> http://stackoverflow.com/questions/21171718/urllib-urlretrieve-file-python-3-3 >>> >>> >>> I'm running pytho

Analytical Geometry in Python with GeoMath

2016-05-03 Thread Vinicius Mesel
Hey guys, I'm back after some time in the darkness(lol). So I'm here to announce my contribution for the mathematicians and physicians and other guys who love geometry like me! I created a library called "GeoMath" that it's intent is to solve all Analytical Geometry problems in a simple wa

Re: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Chris Angelico
On Wed, May 4, 2016 at 4:35 AM, Dan Strohl via Python-list wrote: > I also have never actually used repr() to create code that could be fed back > to the interpreter (not saying it isn’t done, just that I haven’t run into > needing it), and there are so many of the libraries that do not return a

Re: How to call a Python Class?

2016-05-03 Thread Ben Finney
David Shi via Python-list writes: > I found a Python class within an Open Source software. > I would like to use it in my own Python script. > I tried to import it, but I got following message. Your text is mangled in transit. Please post only plain text messages (avoid HTML or other “rich” cont

Re: How to call a Python Class?

2016-05-03 Thread Chris Angelico
On Wed, May 4, 2016 at 8:56 AM, David Shi via Python-list wrote: > I found a Python class within an Open Source software. > I would like to use it in my own Python script. > I tried to import it, but I got following message. > from intersection import *Traceback (most recent call last): File > "

How to call a Python Class?

2016-05-03 Thread David Shi via Python-list
I found a Python class within an Open Source software. I would like to use it in my own Python script. I tried to import it, but I got following message. from intersection import *Traceback (most recent call last):  File "", line 1, in     from intersection import *ImportError: bad magic number i

Re: Trouble porting glob bash behavior with argparse to windows shell

2016-05-03 Thread Terry Reedy
On 5/3/2016 4:55 PM, Sayth Renshaw wrote: Is there something obvious to this I am doing wrong? Sayth Somethin happened so that I don't see what you did. Fortunately, it did show up for Peter, between the '?' and name, so he could answer. -- Terry Jan Reedy -- https://mail.python.org/mailm

RE: How to become more motivated to learn Python

2016-05-03 Thread Clayton Kirkwood
Find some thing that you really need done, but you've put off because you didn't have the programming knowledge to do. Program parts of some thing that you are really interested in doing. For instance, at some point, I need to find duplicate copies of hardcopy photos that I have. I'd love to write

Re: Trouble porting glob bash behavior with argparse to windows shell

2016-05-03 Thread Peter Otten
Sayth Renshaw wrote: > Is there something obvious to this I am doing wrong? > parser.add_argument("path", nargs="+") The "+" implicitly turns args.path into a list > files |= set(glob.glob(args.path + '/*' + args.extension)) so the glob() argument is evaluated as list + str + str T

Re: Fastest way to retrieve and write html contents to file

2016-05-03 Thread Tim Chase
On 2016-05-03 13:00, DFS wrote: > On 5/3/2016 11:28 AM, Tim Chase wrote: > > On 2016-05-03 00:24, DFS wrote: > >> One small comparison I was able to make was VBA vs python/pyodbc > >> to summarize an Access database. Not quite a fair test, but > >> interesting nonetheless. > >> > >> Access 2003 fi

Trouble porting glob bash behavior with argparse to windows shell

2016-05-03 Thread Sayth Renshaw
Is there something obvious to this I am doing wrong? Sayth -- https://mail.python.org/mailman/listinfo/python-list

Broken pipe from gevent/pywsgi.py

2016-05-03 Thread Larry Martell
I have a python server that has this in the main: from gevent import pywsgi try: httpd = pywsgi.WSGIServer(('0.0.0.0', 8000), app) httpd.serve_forever() except KeyboardInterrupt: pass Recently we began getting HTTPError: 504 Server Error: Gateway Time-out on requests to the server. L

Re: Need help understanding list structure

2016-05-03 Thread MRAB
On 2016-05-03 18:54, Dan Strohl via Python-list wrote: I added a __repr__ method at the end of the gedcom library like so: def __repr__(self): """ Format this element as its original string """ result = repr(self.level()) if self.pointer() != "": result += '

Re: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Random832
On Tue, May 3, 2016, at 15:24, moa47...@gmail.com wrote: > I also wanted to understand what character set it was returning. I was > giving it a gedcom file with ansel encoding, which is normal. My > genealogy program can also export its database to gedcom using UTF-8 and > Unicode. But both of thos

Re: crash while using PyCharm / Python3

2016-05-03 Thread Adam
"Jonathan N. Little" wrote in message news:ncqc7j$na1$1...@dont-email.me... > Adam wrote: >> "Adam" wrote in message >> news:ncprqb$tl9$1...@news.albasani.net... >>> >>> "Jonathan N. Little" wrote in message >>> news:ncpjj0$7ug$1...@dont-email.me... Adam wrote: > There ought to be a w

Re: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread moa47401
quote - (Though to be fair, I don't really know what the actual problem was, so I might provide a different approach with a different goal ) Originally I was trying to understand the exact structure of the list being returned by the gedcom library. It worked as it was, but I wanted to add addit

RE: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Dan Strohl via Python-list
> > One other point for you, if your "__repr__(self)" code is the same as > > the "__str__(self)" code (which it looks like it is, at a glance at > > least), you can instead reference the __str__ method and save having a > > duplicate code block... > > Alternatively, consider: the ‘__repr__’ metho

Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Ben Finney
Dan Strohl via Python-list writes: > One other point for you, if your "__repr__(self)" code is the same as > the "__str__(self)" code (which it looks like it is, at a glance at > least), you can instead reference the __str__ method and save having a > duplicate code block... Alternatively, consi

RE: Need help understanding list structure

2016-05-03 Thread Dan Strohl via Python-list
> I added a __repr__ method at the end of the gedcom library like so: > > def __repr__(self): > """ Format this element as its original string """ > result = repr(self.level()) > if self.pointer() != "": > result += ' ' + self.pointer() > result += ' '

Re: How to become more motivated to learn Python

2016-05-03 Thread mm0fmf
On 03/05/2016 17:50, Rob Gaddi wrote: Cai Gengyang wrote: So I have completed up to CodeAcademy's Python Unit 2 , now moving on to Unit3 : Conditionals and Control Flow. But I feel my motivation wavering , at times I get stuck and frustrated when trying to learn a new programming language ?

Re: Need help understanding list structure

2016-05-03 Thread moa47401
I added a __repr__ method at the end of the gedcom library like so: def __repr__(self): """ Format this element as its original string """ result = repr(self.level()) if self.pointer() != "": result += ' ' + self.pointer() result += ' ' + self.tag()

Re: Fastest way to retrieve and write html contents to file

2016-05-03 Thread DFS
On 5/3/2016 11:28 AM, Tim Chase wrote: On 2016-05-03 00:24, DFS wrote: One small comparison I was able to make was VBA vs python/pyodbc to summarize an Access database. Not quite a fair test, but interesting nonetheless. Access 2003 file Access 2003 VBA code Time: 0.18 seconds same Access 200

RE: Need help understanding list structure

2016-05-03 Thread Dan Strohl via Python-list
Take a look at the docs for print() https://docs.python.org/3.5/library/functions.html#print str() https://docs.python.org/3.5/library/stdtypes.html#str repr() https://docs.python.org/3.5/library/functions.html#repr When you do "print(object)", python will run everything through str() and outp

Re: How to become more motivated to learn Python

2016-05-03 Thread Rob Gaddi
Cai Gengyang wrote: > So I have completed up to CodeAcademy's Python Unit 2 , now moving on to > Unit3 : Conditionals and Control Flow. > > But I feel my motivation wavering , at times I get stuck and frustrated when > trying to learn a new programming language ? > > This might not be a technic

Re: Fastest way to retrieve and write html contents to file

2016-05-03 Thread Tim Chase
On 2016-05-03 00:24, DFS wrote: > One small comparison I was able to make was VBA vs python/pyodbc to > summarize an Access database. Not quite a fair test, but > interesting nonetheless. > > Access 2003 file > Access 2003 VBA code > Time: 0.18 seconds > > same Access 2003 file > 32-bit python 2

Re: Saving Consol outputs in a python script

2016-05-03 Thread Terry Reedy
On 5/3/2016 8:14 AM, drewes@gmail.com wrote: Hello, I'm new to python and have a Question. I'm running a c++ file with a python script like: import os import subprocess subprocess.call(["~/caffe/build/examples/cpp_classification/classification", "deploy.prototxt", "this.caffemodel", "mean

Re: installing scipy

2016-05-03 Thread Heli
Yes, the python I have installed is 64bit. Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32 and the scipy wheel I am trying to install from is : scipy-0.17.0-cp34-none-win_amd64.whl At Sayth: Thanks for recommending Anaconda. I already am familiar

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Terry Reedy
On 5/3/2016 11:42 AM, Grant Edwards wrote: Interesting. FWIW, Å and Å definitely look different with the terminal and font I'm using (urxvt with -misc-fixed-medium-r-normal-*-18-120-*-*-*-90-iso10646-*) In the fixed pitch font used by Thunderbird (Courier?), Angstrom Å has the circle touchin

Re: You gotta love a 2-line python solution

2016-05-03 Thread Stephen Hansen
On Mon, May 2, 2016, at 08:57 PM, jf...@ms4.hinet.net wrote: > Stephen Hansen at 2016/5/3 11:49:22AM wrote: > > On Mon, May 2, 2016, at 08:27 PM, jf...@ms4.hinet.net wrote: > > > But when I try to get this forum page, it does get a html file but can't > > > be viewed normally. > > > > What does th

Re: Need help understanding list structure

2016-05-03 Thread moa47401
At the risk of coming across as a complete dunder-head, I think my confusion has to do with the type of data the library returns in the list. Any kind of text or integer list I manually create, doesn't do this. See my questions down below at the end. If I run the following statements on the lis

Re: Saving Consol outputs in a python script

2016-05-03 Thread Stephen Hansen
On Tue, May 3, 2016, at 05:14 AM, drewes@gmail.com wrote: > What I need are the 2 values for the 2 classes saved in a variable in the > .py script, so that I can write them into a text file. > > Would be super nice if someone could help me! You shouldn't use the call() convienence function, b

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Grant Edwards
On 2016-05-03, Jussi Piitulainen wrote: >> Does that mean: >> >> lower(Å) != å ? >> >> and >> >> upper(å) != Å ? > > It means "\N{ANGSTROM SIGN}" != "Å", yet both lower to "å", which then > uppers back to "Å" (U+00c5). > > The Ångström sign (U+212b) looks like this: Å. Indistinguishable from Å >

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Jussi Piitulainen
DFS writes: > On 5/3/2016 10:49 AM, Jussi Piitulainen wrote: >> DFS writes: >> >>> On 5/3/2016 9:13 AM, Chris Angelico wrote: >> It doesn't invert, the way numeric negation does. >>> >>> What do you mean by 'case inverted'? >>> >>> It looks like it swaps the case correctly between upper and l

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread DFS
On 5/3/2016 10:49 AM, Jussi Piitulainen wrote: DFS writes: On 5/3/2016 9:13 AM, Chris Angelico wrote: It doesn't invert, the way numeric negation does. What do you mean by 'case inverted'? It looks like it swaps the case correctly between upper and lower. There's letters that do not com

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Jussi Piitulainen
DFS writes: > On 5/3/2016 9:13 AM, Chris Angelico wrote: >> It doesn't invert, the way numeric negation does. > > What do you mean by 'case inverted'? > > It looks like it swaps the case correctly between upper and lower. There's letters that do not come in exact pairs of upper and lower case, s

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Jussi Piitulainen
Chris Angelico writes: > On Tue, May 3, 2016 at 9:25 PM, Jussi Piitulainen wrote: >> Chris Angelico writes: >> >>> This assumes, of course, that there is a function swapcase which can >>> return a string with case inverted. I'm not sure such a function >>> exists. >> >>str.swapcase("foO") >>

Re: Saving Consol outputs in a python script

2016-05-03 Thread DFS
On 5/3/2016 8:14 AM, drewes@gmail.com wrote: Hello, I'm new to python and have a Question. I'm running a c++ file with a python script like: import os import subprocess subprocess.call(["~/caffe/build/examples/cpp_classification/classification", "deploy.prototxt", "this.caffemodel", "mean

Re: Need help understanding list structure

2016-05-03 Thread Chris Angelico
On Tue, May 3, 2016 at 11:21 PM, wrote: > Thanks for the replies. I definitely need a better understanding of " object at ADDRESS>" when using Python objects. So far no luck with web > searches or my Python books. Could someone point (no pun intended) me to a > good resource? > > Not that it ma

Re: Need help understanding list structure

2016-05-03 Thread moa47401
Thanks for the replies. I definitely need a better understanding of "" when using Python objects. So far no luck with web searches or my Python books. Could someone point (no pun intended) me to a good resource? Not that it matters, but the reason I got off track is there are pointers within m

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Chris Angelico
On Tue, May 3, 2016 at 11:19 PM, DFS wrote: > What do you mean by 'case inverted'? > > It looks like it swaps the case correctly between upper and lower. I gave two examples in my previous post. Did you read them? You trimmed them from the quote. ChrisA -- https://mail.python.org/mailman/listin

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread DFS
On 5/3/2016 9:13 AM, Chris Angelico wrote: On Tue, May 3, 2016 at 11:01 PM, DFS wrote: On 5/3/2016 8:00 AM, Chris Angelico wrote: On Tue, May 3, 2016 at 9:25 PM, Jussi Piitulainen wrote: Chris Angelico writes: This assumes, of course, that there is a function swapcase which can return a

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Chris Angelico
On Tue, May 3, 2016 at 11:01 PM, DFS wrote: > On 5/3/2016 8:00 AM, Chris Angelico wrote: >> >> On Tue, May 3, 2016 at 9:25 PM, Jussi Piitulainen >> wrote: >>> >>> Chris Angelico writes: >>> This assumes, of course, that there is a function swapcase which can return a string with case in

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread DFS
On 5/3/2016 8:00 AM, Chris Angelico wrote: On Tue, May 3, 2016 at 9:25 PM, Jussi Piitulainen wrote: Chris Angelico writes: This assumes, of course, that there is a function swapcase which can return a string with case inverted. I'm not sure such a function exists. str.swapcase("foO")

Saving Consol outputs in a python script

2016-05-03 Thread drewes . mil
Hello, I'm new to python and have a Question. I'm running a c++ file with a python script like: import os import subprocess subprocess.call(["~/caffe/build/examples/cpp_classification/classification", "deploy.prototxt", "this.caffemodel", "mean.binaryproto", "labels.txt", "Bild2.jpg"]) and i

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Chris Angelico
On Tue, May 3, 2016 at 9:25 PM, Jussi Piitulainen wrote: > Chris Angelico writes: > >> This assumes, of course, that there is a function swapcase which can >> return a string with case inverted. I'm not sure such a function >> exists. > >str.swapcase("foO") >'FOo' I suppose for this discu

Re: installing scipy

2016-05-03 Thread Sayth Renshaw
On Wednesday, 27 April 2016 01:33:57 UTC+10, Heli wrote: > Hi all, > > I have a python34 installed on a windows-64bit machine. I am using Eclipse > pydev editor. I need to used griddata from scipy.interpolate. > > I have installed scipy using by downloading the followng wheel file: > scipy-0.

Re: installing scipy

2016-05-03 Thread Fabio Zadrozny
Are you sure that the Python34 you installed is 64-bits and not the 32-bit version? (you can check that by just executing 'python'... the prompt will show the proper info to you). On Tue, Apr 26, 2016 at 12:33 PM, Heli wrote: > Hi all, > > I have a python34 installed on a windows-64bit machine.

Re: How to become more motivated to learn Python

2016-05-03 Thread Sayth Renshaw
On Tuesday, 3 May 2016 21:21:21 UTC+10, Cai Gengyang wrote: > So I have completed up to CodeAcademy's Python Unit 2 , now moving on to > Unit3 : Conditionals and Control Flow. > > But I feel my motivation wavering , at times I get stuck and frustrated when > trying to learn a new programming l

Trouble porting glob bash behavior with argparse to windows shell

2016-05-03 Thread Sayth Renshaw
Hi I had a simple argparse working on ubuntu bash. However now I am trying to run the script on windows and it cannot work because cmd doesn't handle the glob like bash does. So I am attempting to modify my script to accommodate. As i am running python 3.5 i can use glob.glob for a list of fi

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Jussi Piitulainen
Chris Angelico writes: > This assumes, of course, that there is a function swapcase which can > return a string with case inverted. I'm not sure such a function > exists. str.swapcase("foO") 'FOo' -- https://mail.python.org/mailman/listinfo/python-list

How to become more motivated to learn Python

2016-05-03 Thread Cai Gengyang
So I have completed up to CodeAcademy's Python Unit 2 , now moving on to Unit3 : Conditionals and Control Flow. But I feel my motivation wavering , at times I get stuck and frustrated when trying to learn a new programming language ? This might not be a technical question per say, but it is a

Re: Python Madlibs.py code and error message

2016-05-03 Thread Cai Gengyang
Ok, I got it to work with no error message finally ... Enter a name: cai gengyang Enter an adjective: beautiful Enter a second adjective: honest Enter a third adjective: pretty Enter a verb: hit Enter a second verb: run Enter a third verb: jump Enter a noun: honesty Enter a noun: patience

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread Chris Angelico
On Tue, May 3, 2016 at 8:00 PM, wrote: > > What you should have been expecting is a symmetry. Say you have a string G. > islower(G) will return a certain result. Now take every letter in G and swap > the case, and call that string g. isupper(g) will always return the same > result is islow

Python with Oracle Database Course.

2016-05-03 Thread Tarek Abulnaga
I have created Python with Oracle Database Course, and offer 50% discount till 10-5-2016. Any one interested in course just click on below link. https://www.udemy.com/using-python-with-oracle-db/? Then write coupon Code=PYTHON_ORACLE_50%25 -- https://mail.python.org/mailman/listinfo/python-lis

Re: Not x.islower() has different output than x.isupper() in list output...

2016-05-03 Thread pavlovevidence
On Friday, April 29, 2016 at 6:55:56 PM UTC-7, Christopher Reimer wrote: > On 4/29/2016 6:29 PM, Stephen Hansen wrote: > > If isupper/islower were perfect opposites of each-other, there'd be no > > need for both. But since characters can be upper, lower, or *neither*, > > you run into this situat

Re: Client support automation and self service

2016-05-03 Thread jmp
On 05/03/2016 10:02 AM, musoke wilson wrote: Hi Guys Currently working with a team to automate business operations and client support for a small enterprise. Key requirements: Clients to register, log queries and initiate service request through The Web and/or Mobile APP Clear tracking by the

Client support automation and self service

2016-05-03 Thread musoke wilson
Hi Guys Currently working with a team to automate business operations and client support for a small enterprise. Key requirements: Clients to register, log queries and initiate service request through The Web and/or Mobile APP Clear tracking by the CRM team (SR alert through email/mobile APP) R