Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-19 Thread dieter
Chris Angelico writes: > On Fri, Nov 20, 2015 at 5:42 AM, Ian Kelly wrote: >> BartC on the other hand is just complaining about an aspect of Python >> that is legitimately controversial. > > IMO it's controversial mainly because there's an easy and obvious > syntax for early binding, but late bi

Plotting a timeseris graph from pandas dataframe using matplotlib

2015-11-19 Thread Karthik Sharma
I have the following data in a csv file SourceIDBSs hour Type 7208 87 11MAIN 11060 67 11MAIN 3737 88 11MAIN 9683 69 11MAIN 9276 88 11MAIN 7754 62 11MAI

Re: Why doesn't this method have access to its "self" argument?

2015-11-19 Thread dieter
Robert Latest via Python-list writes: > I'm still trying to find a simple way to implement a method (but not the > full class) in C. Suggestions I have recived so far are good, but seem to be > over the top for such a (seemingly) simple problem. The C interface of Python is far from simple - and

Re: PubMed / Entrez

2015-11-19 Thread dieter
writes: > I am looking for a way to use the PubMed (medical research search > engine) API (aka Entrez) with Python3. I am using (on Python 2) "urllib" and "lxml" to interface with the NCBI E-utilities. -- https://mail.python.org/mailman/listinfo/python-list

Re: failing to run python on my pc

2015-11-19 Thread boB Stepp
On Thu, Nov 19, 2015 at 2:22 PM, Daniel Kasuza wrote: > Dear Sir/Madam > I am student with University of the people and a beginner in programming. > My problem is that l have down loaded python 2.7 but l am failing to muse > it. If l try to to use it, I am getting an option which say run. If l pre

Re: Generate a random list of numbers

2015-11-19 Thread Seymore4Head
On Fri, 20 Nov 2015 15:38:36 +1100, Steven D'Aprano wrote: >On Fri, 20 Nov 2015 03:05 pm, Seymore4Head wrote: > >> Why does a work and b doesn't? What I was trying to accomplish with b >> is to get a random list (of random length) that could have digits >> repeat. >> >> I got idea for both meth

Re: Generate a random list of numbers

2015-11-19 Thread Steven D'Aprano
On Fri, 20 Nov 2015 03:05 pm, Seymore4Head wrote: > Why does a work and b doesn't? What I was trying to accomplish with b > is to get a random list (of random length) that could have digits > repeat. > > I got idea for both methods from the Internet. I do see that one uses > brackets and the ot

Re: shorten "compress" long integer to short ascii.

2015-11-19 Thread Paul Rubin
Vincent Davis writes: > My goal is to shorten a long integer into a shorter set of characters. > Below is what I have which gets me about a 45-50% reduction. Any suggestion > on how to improve upon this? You can't improve much. A decimal digit carries log(10,2)=3.32 bits of information. A reaso

Generate a random list of numbers

2015-11-19 Thread Seymore4Head
Why does a work and b doesn't? What I was trying to accomplish with b is to get a random list (of random length) that could have digits repeat. I got idea for both methods from the Internet. I do see that one uses brackets and the other doesn't, but I don't know the difference. import random

Re: Writing a Financial Services App in Python

2015-11-19 Thread William Ray Wing
> On Nov 19, 2015, at 6:59 AM, Cai Gengyang wrote: > > > From YCombinator's new RFS, This is the problem I want to solve as it is a > severe problem I face myself and something I need. I want to write this app > in Python as I heard that Python is a great language that many programmers > use

shorten "compress" long integer to short ascii.

2015-11-19 Thread Vincent Davis
My goal is to shorten a long integer into a shorter set of characters. Below is what I have which gets me about a 45-50% reduction. Any suggestion on how to improve upon this? I not limited to ascii but I didn't see how going to utf8 would help. The resulting string needs to be something I could ty

Re: Why won't this run?

2015-11-19 Thread Mike S via Python-list
On 11/15/2015 12:38 PM, jbak36 wrote: Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. #this program says hello and asks for my name print:('Hello world!') Hello world! print:('What

Re: how do I learn python ?

2015-11-19 Thread Mike S via Python-list
On 11/19/2015 1:00 AM, Michiel Overtoom wrote: On 18 Nov 2015, at 05:58, 夏华林 wrote: (nothing) You might want to start at https://www.python.org/about/gettingstarted/ PS. Leaving the body of an email or usenet article empty is considered bad form. Greetings, Thanks for that, there is a gr

Re: What is a function parameter =[] for?

2015-11-19 Thread Steven D'Aprano
On Fri, 20 Nov 2015 04:30 am, BartC wrote: > On 19/11/2015 16:01, Steven D'Aprano wrote: [...] > The whole concept of 'mutable' default is alien to me. A default is just > a convenient device to avoid having to write: > >fn(0) or fn("") or fn([]) Says who? Here's another use for function

Re: What is a function parameter =[] for?

2015-11-19 Thread Laura Creighton
In a message of Thu, 19 Nov 2015 16:36:17 -0800, Ned Batchelder writes: >On Thursday, November 19, 2015 at 7:28:44 PM UTC-5, Steven D'Aprano wrote: >> On Fri, 20 Nov 2015 05:50 am, BartC wrote: >> >> >> > I said that Python's "=" does a very shallow copy. And I stated that in >> > A=B, something

Re: What is a function parameter =[] for?

2015-11-19 Thread Ian Kelly
On Nov 19, 2015 5:31 PM, "Steven D'Aprano" wrote: > > [Aside: there is some ambiguity here. If I say "a reference to B", I > actually mean a reference to the object referenced to by B. I don't mean a > reference to the *name* B. Python doesn't support that feature: names are > not values in Python

Re: What is a function parameter =[] for?

2015-11-19 Thread Ned Batchelder
On Thursday, November 19, 2015 at 7:28:44 PM UTC-5, Steven D'Aprano wrote: > On Fri, 20 Nov 2015 05:50 am, BartC wrote: > > > > I said that Python's "=" does a very shallow copy. And I stated that in > > A=B, something of B must be copied into A. > > > > I (and probably others) would like to kno

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-19 Thread Steven D'Aprano
On Fri, 20 Nov 2015 07:57 am, Marko Rauhamaa wrote: > Laura Creighton : > >> My experience says that the people who are confused want lists to >> behave like tuples. period. i.e. they don't want lists to be mutable. > > I think it's simpler than that. When you have: > >def f(x=[]): >

Re: What is a function parameter =[] for?

2015-11-19 Thread Steven D'Aprano
On Fri, 20 Nov 2015 05:50 am, BartC wrote: > I said that Python's "=" does a very shallow copy. And I stated that in > A=B, something of B must be copied into A. > > I (and probably others) would like to know why none of that is correct. > But I suspect I'm not wrong. Nothing of B is copied. H

Re: What is a function parameter =[] for?

2015-11-19 Thread Ned Batchelder
On Thursday, November 19, 2015 at 7:11:52 PM UTC-5, BartC wrote: > On 19/11/2015 22:55, Michael Torrie wrote: > > On 11/19/2015 02:21 PM, BartC wrote: > >> (Python returns 42; so that means my languages are more dynamic than > >> Python? That's hard to believe!) > > > > It tells me your language do

Re: What is a function parameter =[] for?

2015-11-19 Thread BartC
On 19/11/2015 22:55, Michael Torrie wrote: On 11/19/2015 02:21 PM, BartC wrote: (Python returns 42; so that means my languages are more dynamic than Python? That's hard to believe!) It tells me your language does late binding for default arguments, which does mean the default argument can dyna

Re: Dabbling in web development

2015-11-19 Thread Dietmar Schwertberger
Am 19.11.2015 um 22:53 schrieb bSneddon: I know there are a plethora of web frameworks out there for Python and to be serious about website developement I should learn on like Django. Really thought, I just want to dabble and do some easy stuff. Does anyone have any suggestons? I have a

Re: Dabbling in web development

2015-11-19 Thread Laura Creighton
In a message of Fri, 20 Nov 2015 01:07:24 +0200, Marko Rauhamaa writes: >Laura Creighton : > >> There are lots of other choices than Django. >> >> see: https://wiki.python.org/moin/WebFrameworks/ > >However, are there any good web applications? I have seen some heroic >attempts but most fail mise

Re: Dabbling in web development

2015-11-19 Thread Laura Creighton
In a message of Fri, 20 Nov 2015 10:09:01 +1100, Chris Angelico writes: >On Fri, Nov 20, 2015 at 9:53 AM, Laura Creighton wrote: >> It is not the case that 'serious website developers use heavyweight >> systems like Django' --- lots and lots of serious developers use >> Flask or Bottle because Dja

Re: Dabbling in web development

2015-11-19 Thread Marko Rauhamaa
Laura Creighton : > There are lots of other choices than Django. > > see: https://wiki.python.org/moin/WebFrameworks/ However, are there any good web applications? I have seen some heroic attempts but most fail miserably or at least have some annoying glitches. The cardinal sin of web developm

Re: Dabbling in web development

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 9:53 AM, Laura Creighton wrote: > It is not the case that 'serious website developers use heavyweight > systems like Django' --- lots and lots of serious developers use > Flask or Bottle because Django makes you do it the Django way. > Flask lets you do it however you like.

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?) (fwd)

2015-11-19 Thread Laura Creighton
Arrgh! I got Ned Batchelder's email wrong. Forgot the t. (for somebody whose irc nick is nedbat. ) sending this to him again. warning any repliers that the mail address is wrong apologies, Laura --- Forwarded Message From: Laura Creighton Subject: Re: Late-binding of function def

Re: What is a function parameter =[] for?

2015-11-19 Thread Michael Torrie
On 11/19/2015 02:21 PM, BartC wrote: > (Python returns 42; so that means my languages are more dynamic than > Python? That's hard to believe!) It tells me your language does late binding for default arguments, which does mean the default argument can dynamically change at call time, which would s

Re: Dabbling in web development

2015-11-19 Thread Laura Creighton
In a message of Thu, 19 Nov 2015 13:53:09 -0800, bSneddon writes: >I know there are a plethora of web frameworks out there for Python and to be serious about website developement I should learn on like Django. Really thought, I just want to dabble and do some easy stuff. Does anyone have any

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-19 Thread Laura Creighton
In a message of Thu, 19 Nov 2015 22:57:10 +0200, Marko Rauhamaa writes: >Laura Creighton : > >> My experience says that the people who are confused want lists to >> behave like tuples. period. i.e. they don't want lists to be mutable. > >I think it's simpler than that. When you have: > > def f(x=

Re: Dabbling in web development

2015-11-19 Thread Mark Lawrence
On 19/11/2015 21:53, bSneddon wrote: I know there are a plethora of web frameworks out there for Python and to be serious about website developement I should learn on like Django. Really thought, I just want to dabble and do some easy stuff. Does anyone have any suggestons? I have a a we

Re: Dabbling in web development

2015-11-19 Thread Ian Kelly
On Thu, Nov 19, 2015 at 2:53 PM, bSneddon wrote: > I know there are a plethora of web frameworks out there for Python and to be > serious about website developement I should learn on like Django. Really > thought, I just want to dabble and do some easy stuff. Does anyone have any > suggesto

Dabbling in web development

2015-11-19 Thread bSneddon
I know there are a plethora of web frameworks out there for Python and to be serious about website developement I should learn on like Django. Really thought, I just want to dabble and do some easy stuff. Does anyone have any suggestons? I have a a website hosted with a hosting company who

Re: What is a function parameter =[] for?

2015-11-19 Thread BartC
On 19/11/2015 19:19, Chris Angelico wrote: On Fri, Nov 20, 2015 at 5:19 AM, BartC wrote: But every choice has consequences. Steven gave you a few examples of the consequences of late-binding default arguments. For example, can you translate this into (one of) your language(s), and explain the

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-19 Thread Marko Rauhamaa
Laura Creighton : > My experience says that the people who are confused want lists to > behave like tuples. period. i.e. they don't want lists to be mutable. I think it's simpler than that. When you have: def f(x=[]): y = [] the first [] is evaluated when "def" is executed, while the

Re: Unsuccessful installation

2015-11-19 Thread Ian Kelly
On Thu, Nov 19, 2015 at 12:45 PM, Kaufman, Stan wrote: > Python would not run on this Windows XP computer. After four attempts at > "change/remove" it still gives the same message: > > [cid:image001.png@01D122D0.93CC3270] > > The first trip through "change/remove" appeared to be a further step

Unsuccessful installation

2015-11-19 Thread Kaufman, Stan
Python would not run on this Windows XP computer. After four attempts at "change/remove" it still gives the same message: [cid:image001.png@01D122D0.93CC3270] The first trip through "change/remove" appeared to be a further step in installation. The second through fourth trips indicated "repa

Re: How can I export data from a website and write the contents to a text file?

2015-11-19 Thread Patrick Hess
ryguy7272 wrote: > text_file = open("C:/Users/rshuell001/Desktop/excel/Text1.txt", "wb") > [...] > It doesn't seem like the '\n' is doing anything useful. All the text is > jumbled together. > [...] > I finally got it working. It's like this: > "\r\n" The better solution would be to open text f

failing to run python on my pc

2015-11-19 Thread Daniel Kasuza
Dear Sir/Madam I am student with University of the people and a beginner in programming. My problem is that l have down loaded python 2.7 but l am failing to muse it. If l try to to use it, I am getting an option which say run. If l press run, it just run and come back to the same option. I want to

Re: Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-19 Thread Laura Creighton
In a message of Fri, 20 Nov 2015 06:46:42 +1100, Chris Angelico writes: >Would this satisfy the people who get confused about "=[]"? > >ChrisA My experience says that the people who are confused want lists to behave like tuples. period. i.e. they don't want lists to be mutable. Which means wh

Re: What is a function parameter =[] for?

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 6:48 AM, BartC wrote: > On 19/11/2015 19:09, Chris Angelico wrote: >> >> On Fri, Nov 20, 2015 at 5:50 AM, BartC wrote: >>> >>> But you're not going to tell me what it is I got wrong! >>> >>> I said that Python's "=" does a very shallow copy. And I stated that in >>> A=B, >

Re: What is a function parameter =[] for?

2015-11-19 Thread BartC
On 19/11/2015 19:09, Chris Angelico wrote: On Fri, Nov 20, 2015 at 5:50 AM, BartC wrote: But you're not going to tell me what it is I got wrong! I said that Python's "=" does a very shallow copy. And I stated that in A=B, something of B must be copied into A. I (and probably others) would lik

Late-binding of function defaults (was Re: What is a function parameter =[] for?)

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 5:42 AM, Ian Kelly wrote: > BartC on the other hand is just complaining about an aspect of Python > that is legitimately controversial. IMO it's controversial mainly because there's an easy and obvious syntax for early binding, but late binding doesn't have syntactic suppo

Re: What is a function parameter =[] for?

2015-11-19 Thread Ian Kelly
On Thu, Nov 19, 2015 at 12:19 PM, Chris Angelico wrote: > But you're > saying that it "simply substitute[s] the expression", which would mean > that "func()" is exactly the same as "func(y)". A function default > argument is therefore able to STEAL STUFF FROM THE CALLER'S SCOPE. > Sorry for shouti

Re: What is a function parameter =[] for?

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 5:19 AM, BartC wrote: > Yes. In the languages I create, pretty much everything is mutable, provided > it can supply an l-value. Constructs such as those for empty lists ([] in > Python, () in mine) aren't l-values. > > But it doesn't apply default values. The language is ve

Re: What is a function parameter =[] for?

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 5:50 AM, BartC wrote: > But you're not going to tell me what it is I got wrong! > > I said that Python's "=" does a very shallow copy. And I stated that in A=B, > something of B must be copied into A. > > I (and probably others) would like to know why none of that is correc

Re: What is a function parameter =[] for?

2015-11-19 Thread BartC
On 19/11/2015 18:26, Mark Lawrence wrote: On 19/11/2015 18:19, BartC wrote: if you write A=B then something of B needs to have been copied into A, even if it's just the reference that B contains. Otherwise it would be difficult to get A to refer to the same object as B. Please, PLEASE, go an

Re: What is a function parameter =[] for?

2015-11-19 Thread Oscar Benjamin
On 19 November 2015 at 18:19, BartC wrote: >>> >>> if you write A=B then something of B needs to have been copied into >>> A, even if it's just the reference that B contains. Otherwise it would be >>> difficult to get A to refer to the same object as B. >> >> Please, PLEASE, go and read/watch Ned'

Re: What is a function parameter =[] for?

2015-11-19 Thread Ian Kelly
On Thu, Nov 19, 2015 at 11:26 AM, Mark Lawrence wrote: > To summarize, it once again shows that you haven't got the faintest idea > what you're talking about. You're now in a very exclusive club with the RUE > and Nick the Greek, the world's leading webmaster. Eh. Ranting Rick and Mark Janssen /

Re: What is a function parameter =[] for?

2015-11-19 Thread Marko Rauhamaa
BartC : > Yes. In the languages I create, pretty much everything is mutable, > provided it can supply an l-value. Constructs such as those for empty > lists ([] in Python, () in mine) aren't l-values. > > But it doesn't apply default values. Python's default-value semantics is analogous to C++:

Re: What is a function parameter =[] for?

2015-11-19 Thread Mark Lawrence
On 19/11/2015 18:19, BartC wrote: On 19/11/2015 17:45, Chris Angelico wrote: On Fri, Nov 20, 2015 at 4:30 AM, BartC wrote: The whole concept of 'mutable' default is alien to me. A default is just a convenient device to avoid having to write: fn(0) or fn("") or fn([]) You just write fn() i

Re: What is a function parameter =[] for?

2015-11-19 Thread Mark Lawrence
On 19/11/2015 17:30, BartC wrote: On 19/11/2015 16:01, Steven D'Aprano wrote: On Fri, 20 Nov 2015 12:19 am, BartC wrote: You know, for somebody who claims to design and implement your own languages, you sometimes go to a remarkable effort to claim to be a dummy. You write your own interpreter

Re: What is a function parameter =[] for?

2015-11-19 Thread BartC
On 19/11/2015 17:45, Chris Angelico wrote: On Fri, Nov 20, 2015 at 4:30 AM, BartC wrote: The whole concept of 'mutable' default is alien to me. A default is just a convenient device to avoid having to write: fn(0) or fn("") or fn([]) You just write fn() instead. But it shouldn't come at th

Re: Why doesn't this method have access to its "self" argument?

2015-11-19 Thread Peter Otten
Robert Latest via Python-list wrote: > I found a workaround using a wrapper method which calls a C function, > passing the instance as a separate argument. It works, and I cannot see > any disadvantage. It's just not as elegant as I'd like it to be, and I > don't understand WHY the C "method" does

Re: What is a function parameter =[] for?

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 4:30 AM, BartC wrote: > The whole concept of 'mutable' default is alien to me. A default is just a > convenient device to avoid having to write: > > fn(0) or fn("") or fn([]) > > You just write fn() instead. But it shouldn't come at the cost of completely > different sema

Re: Why doesn't this method have access to its "self" argument?

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 3:13 AM, Robert Latest via Python-list wrote: > rl@dc:~/c/cwsf/python_module$ python test.py > > Minimal example files: > > == test.py === > > import cmethod > > class Test(): > > # add methods to the class "after the

Re: What is a function parameter =[] for?

2015-11-19 Thread BartC
On 19/11/2015 16:01, Steven D'Aprano wrote: On Fri, 20 Nov 2015 12:19 am, BartC wrote: You know, for somebody who claims to design and implement your own languages, you sometimes go to a remarkable effort to claim to be a dummy. You write your own interpreter, but can't understand early versus

Re: What is a function parameter =[] for?

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 3:01 AM, Steven D'Aprano wrote: > You know, for somebody who claims to design and implement your own > languages, you sometimes go to a remarkable effort to claim to be a dummy. > You write your own interpreter, but can't understand early versus late > binding? I don't thin

Re: Writing a Financial Services App in Python

2015-11-19 Thread Michael Torrie
On 11/19/2015 09:20 AM, Cai Gengyang wrote: > Sure ... is this : https://www.codecademy.com/learn/python a good > place to learn Python ? Why not have a look first at the many tutorials, including the ones on Python's web site? You need to explore feasibility first before you go too far. Python i

Re: non-blocking getkey?

2015-11-19 Thread Michael Torrie
On 11/19/2015 08:48 AM, Ulli Horlacher wrote: > > The focus is moved to another, unrelated window, but not back to the > window in which the python scripts run. > Same behaviour on Linux (XFCE) and windows 7. That's because an app that communicates with standard in and standard out could be runn

Re: Is there an meaning of '[[]]' in a list?

2015-11-19 Thread Mark Lawrence
On 19/11/2015 11:28, fl wrote: Hi, In the previous exercises, I see list: cc=[[],[],[]] Then, I can have this: ccc=[[[]],[[]],[[]]] I can also have ccc[0] Out[158]: [[]] ccc[0]='o' ccc Out[163]: ['o', [[]], [[]]] I have question: Is there any difference between [[]] and []? [[]] can have

Re: Writing a Financial Services App in Python

2015-11-19 Thread Cai Gengyang
Sure ... is this : https://www.codecademy.com/learn/python a good place to learn Python ? Are you wanting to contract with some programmers to create this application for you? Eventually I will have to find programming co-founders and employees to create and iterate the product as user fee

Why doesn't this method have access to its "self" argument?

2015-11-19 Thread Robert Latest via Python-list
Hi all, I'm still trying to find a simple way to implement a method (but not the full class) in C. Suggestions I have recived so far are good, but seem to be over the top for such a (seemingly) simple problem. I came up with the idea of implementing the class in Python, and just setting the method

Re: Writing a Financial Services App in Python

2015-11-19 Thread Michael Torrie
On 11/19/2015 08:24 AM, Cai Gengyang wrote: > It will be a web-based application. Contract it out. Or attract people who are interested in making an open source application. What you are thinking of is a massive undertaking. Web-based application design is even more complicated than desktop app

Re: What is a function parameter =[] for?

2015-11-19 Thread Steven D'Aprano
On Fri, 20 Nov 2015 12:19 am, BartC wrote: > On 19/11/2015 12:19, Steven D'Aprano wrote: >> On Thu, 19 Nov 2015 10:14 am, BartC wrote: > >> Consider this pair of functions: >> >> >> def expensive(): >> # Simulate some expensive calculation or procedure. >> time.sleep(100) >> return

Re: Writing a Financial Services App in Python

2015-11-19 Thread Michael Torrie
On 11/19/2015 04:59 AM, Cai Gengyang wrote: > > From YCombinator's new RFS, This is the problem I want to solve as it > is a severe problem I face myself and something I need. I want to > write this app in Python as I heard that Python is a great language > that many programmers use ... How / wher

Re: non-blocking getkey?

2015-11-19 Thread Ulli Horlacher
Terry Reedy wrote: > On 11/18/2015 11:50 AM, Ulli Horlacher wrote: > > Ulli Horlacher wrote: > > > >> from Tkinter import Tk > >> from tkFileDialog import askopenfilename > >> > >> Tk().withdraw() > >> file = askopenfilename() > > > > I found another glitch: >

Re: What is a function parameter =[] for?

2015-11-19 Thread Ian Kelly
On Thu, Nov 19, 2015 at 5:45 AM, Steven D'Aprano wrote: > But if you want the default value to be evaluated exactly once, and once > only, there is no real alternative to early binding. You could use a global > variable, of course, but that is no solution -- that's a problem waiting to > happen.

Re: Writing a Financial Services App in Python

2015-11-19 Thread Cai Gengyang
It will be a web-based application. Something like this : https://www.slicedinvesting.com/, but with different, better, more features and also graphics , forums, a system to track your daily, monthly expenses and earnings, a graphical tutorial system to teach users financial literacy , learn a

Re: Writing a Financial Services App in Python

2015-11-19 Thread Jeremy Leonard
On Thursday, November 19, 2015 at 7:00:05 AM UTC-5, Cai Gengyang wrote: > From YCombinator's new RFS, This is the problem I want to solve as it is a > severe problem I face myself and something I need. I want to write this app > in Python as I heard that Python is a great language that many progr

EuroPython 2016: Kick-off

2015-11-19 Thread M.-A. Lemburg
The EuroPython 2016 Team is ready for starting the organization of next year’s event: *** http://ep2016.europython.eu/ *** July 17 - 24 2016 If you would like to actively help with the organization, we’d love to have you as volunteer in one of our workg

Re: What is a function parameter =[] for?

2015-11-19 Thread Chris Angelico
On Fri, Nov 20, 2015 at 12:19 AM, BartC wrote: > You presumably think differently because you have some inside knowledge of > how Python works, and know that that [] undergoes a one-time assignment to a > local, persistent 'default' variable where it's value can indeed by changed. > (Thanks to ano

Re: pyinstaller and Python 3.5 on Windows?

2015-11-19 Thread Ulli Horlacher
Ulli Horlacher wrote: > C:\Users\admin>pip install pypiwin32 > Collecting pypiwin32 > Downloading pypiwin32-219-cp35-none-win32.whl (7.9MB) > 100% || 7.9MB 61kB/s > Installing collected packages: pypiwin32 > Exception: (...) > PermissionError: [Errno 13] Perm

Re: What is a function parameter =[] for?

2015-11-19 Thread BartC
On 19/11/2015 12:19, Steven D'Aprano wrote: On Thu, 19 Nov 2015 10:14 am, BartC wrote: Consider this pair of functions: def expensive(): # Simulate some expensive calculation or procedure. time.sleep(100) return random.randint(1, 6) def demo(arg=expensive()): return arg

Re: What is a function parameter =[] for?

2015-11-19 Thread Steven D'Aprano
On Thu, 19 Nov 2015 10:41 pm, BartC wrote: > I expect the version with the default argument to be > exactly the same as the last lot of calls, namely for: > > fn() > fn() > fn() > > to be equivalent to: > > temp=[] > fn(temp) > temp=[] > fn(temp) > temp=[] > fn(temp) Why on earth would you ex

Re: pyinstaller and Python 3.5 on Windows?

2015-11-19 Thread Ulli Horlacher
Kevin Walzer wrote: > I understand that Python 3.5 has shipped how the MS dll's from Visual > Studio are shipped, and perhaps the freezing tools (pyinstaller, py2exe) > haven't yet caught up. Consider filing a bug with the pyinstaller > developers. http://pythonhosted.org/PyInstaller/#windows

Re: What is a function parameter =[] for?

2015-11-19 Thread Steven D'Aprano
On Thu, 19 Nov 2015 10:14 am, BartC wrote: > On 18/11/2015 22:11, Ian Kelly wrote: >> The list0 parameter has a default value, which is [], an initially >> empty list. The default value is evaluated when the function is >> defined, not when it is called, so the same list object is used each >> ti

Re: PubMed / Entrez

2015-11-19 Thread Laura Creighton
In a message of Thu, 19 Nov 2015 09:17:35 +0100, c.bu...@posteo.jp writes: >I am looking for a way to use the PubMed (medical research search >engine) API (aka Entrez) with Python3. > >Does anyone know packages for that? https://pypi.python.org/pypi/Bio_Eutils/1.63 Or just get BioPython and use t

Writing a Financial Services App in Python

2015-11-19 Thread Cai Gengyang
>From YCombinator's new RFS, This is the problem I want to solve as it is a >severe problem I face myself and something I need. I want to write this app in >Python as I heard that Python is a great language that many programmers use >... How / where do I start ? The problem is detailed below :

Re: What is a function parameter =[] for?

2015-11-19 Thread Chris Angelico
On Thu, Nov 19, 2015 at 10:41 PM, BartC wrote: > As I said, it's bizarre. It means that for certain types, Python doesn't > have a default that works per call, but only a default that works once per > program. No, it's not "for certain types". Regardless of the type, the expression that defines t

Re: Public key encryption example.

2015-11-19 Thread Laura Creighton
In a message of Wed, 18 Nov 2015 16:18:28 -0700, Vincent Davis writes: >This might be a "Let me Google that for you question", I tried. >I am looking for the "simplest" example of sending(encrypting) and >receiving(decrypting) using public key encryption. I am think of something >along the lines of

Re: how do I learn python ?

2015-11-19 Thread Steve Hayes
On Wed, 18 Nov 2015 04:58:30 +, ÏÄ»ªÁÖ wrote: > -- Steve Hayes from Tshwane, South Africa Web: http://www.khanya.org.za/stevesig.htm Blog: http://khanya.wordpress.com E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk --

Re: What is a function parameter =[] for?

2015-11-19 Thread BartC
On 19/11/2015 01:59, Chris Angelico wrote: On Thu, Nov 19, 2015 at 12:41 PM, BartC wrote: On 18/11/2015 23:22, Chris Angelico wrote: On the contrary, it is certain always to be that exact object. But, not the same value that appears as the default? Nope. Mutable objects are never guarantee

Re: pyinstaller and Python 3.5 on Windows?

2015-11-19 Thread Kevin Walzer
On 11/18/15 5:46 PM, Ulli Horlacher wrote: ImportError: DLL load failed: The specified module could not be found. Is there a solution available? I understand that Python 3.5 has shipped how the MS dll's from Visual Studio are shipped, and perhaps the freezing tools (pyinstaller, py2exe) h

Re: Is there an meaning of '[[]]' in a list?

2015-11-19 Thread Peter Otten
fl wrote: > Hi, > In the previous exercises, I see list: > cc=[[],[],[]] > > Then, I can have this: > > ccc=[[[]],[[]],[[]]] > > I can also have > > ccc[0] > Out[158]: [[]] > > ccc[0]='o' > > ccc > Out[163]: ['o', [[]], [[]]] > > > I have question: Is there any difference between [[]] and

Re: What is a function parameter =[] for?

2015-11-19 Thread Steven D'Aprano
On Thu, 19 Nov 2015 11:34 am, fl wrote: > This is my new > question: What does 'del' do? It does not look like a thorough list > deletion from the effect. Of course not. Did you Read The Fine Manual? Or at least use the interactive help function? At the Python prompt, enter: help("del") and you

Re: Is there an meaning of '[[]]' in a list?

2015-11-19 Thread Nagy László Zsolt
> I have question: Is there any difference between [[]] and []? Yes. [] - a list with zero elements. That is an empty list. [[]] - A list with one element. (That element is an empty list.) > [[]] can have deeper assignment and use than You can have it as deep as you want, if you have enough mem

Is there an meaning of '[[]]' in a list?

2015-11-19 Thread fl
Hi, In the previous exercises, I see list: cc=[[],[],[]] Then, I can have this: ccc=[[[]],[[]],[[]]] I can also have ccc[0] Out[158]: [[]] ccc[0]='o' ccc Out[163]: ['o', [[]], [[]]] I have question: Is there any difference between [[]] and []? [[]] can have deeper assignment and use than

Re: how do I learn python ?

2015-11-19 Thread Michiel Overtoom
> On 18 Nov 2015, at 05:58, 夏华林 wrote: > (nothing) You might want to start at https://www.python.org/about/gettingstarted/ PS. Leaving the body of an email or usenet article empty is considered bad form. Greetings, -- https://mail.python.org/mailman/listinfo/python-list

PubMed / Entrez

2015-11-19 Thread c.buhtz
I am looking for a way to use the PubMed (medical research search engine) API (aka Entrez) with Python3. Does anyone know packages for that? -- GnuPGP-Key ID 0751A8EC -- https://mail.python.org/mailman/listinfo/python-list

how do I learn python ?

2015-11-19 Thread 夏华林
-- https://mail.python.org/mailman/listinfo/python-list

Re: handling of non-ASCII filenames?

2015-11-19 Thread Christian Gollwitzer
Am 19.11.15 um 08:54 schrieb Ulli Horlacher: Christian Gollwitzer wrote: Am 18.11.15 um 17:45 schrieb Ulli Horlacher: This is my encoding function: def url_encode(s): u = '' for c in list(s): if match(r'[_=:,;<>()+.\w\-]',c): u += c else: u += '%' + c.encod

Re: handling of non-ASCII filenames?

2015-11-19 Thread Ulli Horlacher
Christian Gollwitzer wrote: > Am 18.11.15 um 17:45 schrieb Ulli Horlacher: > > This is my encoding function: > > > > def url_encode(s): > >u = '' > >for c in list(s): > > if match(r'[_=:,;<>()+.\w\-]',c): > >u += c > > else: > >u += '%' + c.encode("hex").upper() >