Re: Python keyword args can be any string

2016-02-17 Thread Mark Lawrence
On 18/02/2016 05:42, Steven D'Aprano wrote: Today I learned that **kwargs style keyword arguments can be any string: py> def test(**kw): ... print(kw) ... py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17} py> test(**kwargs) {'': 23, '123': 17, '---': 999, 'abc-def': 42} Bug or fea

Re: Guido on python3 for beginners

2016-02-17 Thread Chris Angelico
On Thu, Feb 18, 2016 at 5:47 PM, Steven D'Aprano wrote: > There are more features in Python 3, so in that trivial sense of "more to > learn", I suppose that it is objectively correct that it is harder to learn > than Python 2. But I don't think the learning curve is any steeper. If > anything, the

Re: Guido on python3 for beginners

2016-02-17 Thread Random832
On Thu, Feb 18, 2016, at 01:47, Steven D'Aprano wrote: > There are more features in Python 3, so in that trivial sense of "more to > learn", I suppose that it is objectively correct that it is harder to > learn > than Python 2. But I don't think the learning curve is any steeper. If > anything,

Re: Guido on python3 for beginners

2016-02-17 Thread Paul Rubin
Steven D'Aprano writes: > I suppose that it is objectively correct that it is harder to learn > than Python 2. But I don't think the learning curve is any steeper. If > anything, the learning curve is ever-so-slightly less steep. I think py3 has more learning curve because it uses iterators in pl

Re: Guido on python3 for beginners

2016-02-17 Thread Ben Finney
Steven D'Aprano writes: > There are more features in Python 3, so in that trivial sense of "more to > learn", I suppose that it is objectively correct that it is harder to learn > than Python 2. But I don't think the learning curve is any steeper. Set against the “more features in Python 3” is

Re: Guido on python3 for beginners

2016-02-17 Thread Steven D'Aprano
On Wednesday 17 February 2016 19:51, Rustom Mody wrote: > I hope someone can help me find this link: There is some record that Guido > has said that python3 is probably a bit harder on noobs than python2. > > Does anyone know/have that link? I can't say that I've seen it. I know that Raymond He

Re: Python keyword args can be any string

2016-02-17 Thread Terry Reedy
On 2/18/2016 12:59 AM, Ben Finney wrote: Steven D'Aprano writes: Today I learned that **kwargs style keyword arguments can be any string: py> def test(**kw): ... print(kw) ... py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17} py> test(**kwargs) {'': 23, '123': 17, '---': 999, '

Re: asyncio - run coroutine in the background

2016-02-17 Thread Marko Rauhamaa
Paul Rubin : > Marko Rauhamaa writes: >> @asyncio.coroutine >> def background_task(): ... >> while time.time() - t < 10: >> pass > > Wait, that's a cpu-busy loop, you can't do that in cooperative > multitasking. Of course you need a wait there. That was the very point: to demonstrat

Re: Python keyword args can be any string

2016-02-17 Thread Ben Finney
Steven D'Aprano writes: > Today I learned that **kwargs style keyword arguments can be any string: > > > py> def test(**kw): > ... print(kw) > ... > py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17} > py> test(**kwargs) > {'': 23, '123': 17, '---': 999, 'abc-def': 42} > > > Bug or

Re: Python keyword args can be any string

2016-02-17 Thread Chris Angelico
On Thu, Feb 18, 2016 at 4:42 PM, Steven D'Aprano wrote: > Today I learned that **kwargs style keyword arguments can be any string: > > > py> def test(**kw): > ... print(kw) > ... > py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17} > py> test(**kwargs) > {'': 23, '123': 17, '---': 999

Python keyword args can be any string

2016-02-17 Thread Steven D'Aprano
Today I learned that **kwargs style keyword arguments can be any string: py> def test(**kw): ... print(kw) ... py> kwargs = {'abc-def': 42, '': 23, '---': 999, '123': 17} py> test(**kwargs) {'': 23, '123': 17, '---': 999, 'abc-def': 42} Bug or feature? -- Steve -- https://mail.python

Re: asyncio - run coroutine in the background

2016-02-17 Thread Paul Rubin
Marko Rauhamaa writes: > @asyncio.coroutine > def background_task(): ... > while time.time() - t < 10: > pass Wait, that's a cpu-busy loop, you can't do that in cooperative multitasking. Of course you need a wait there. -- https://mail.python.org/mailman/listinfo/python-list

Re: Will file be closed automatically in a "for ... in open..." statement?

2016-02-17 Thread Tim Chase
On 2016-02-17 16:51, Steven D'Aprano wrote: > If you want the file to be closed immediately, you must: > > - use a with statement; > > - or explicitly call f.close() I have a lot of pre-"with" code (i.e., Py2.4) that looks like f = open(...) try: do_stuff() finally: f.close() To

Re: Will file be closed automatically in a "for ... in open..." statement?

2016-02-17 Thread Cameron Simpson
On 18Feb2016 02:05, Mark Lawrence wrote: On 18/02/2016 01:29, jf...@ms4.hinet.net wrote: The "for ... open ..." is definitely not a good design pattern. It opens a file at "for" block but leaves it closed somewhere in the sky. Hardly, as all ready explained, but how about this handle = ope

Re: Will file be closed automatically in a "for ... in open..." statement?

2016-02-17 Thread Mark Lawrence
On 18/02/2016 01:29, jf...@ms4.hinet.net wrote: The "for ... open ..." is definitely not a good design pattern. It opens a file at "for" block but leaves it closed somewhere in the sky. Hardly, as all ready explained, but how about this handle = open('foo.txt') for line in handle : ...do

Re: Will file be closed automatically in a "for ... in open..." statement?

2016-02-17 Thread jfong
The "for ... open ..." is definitely not a good design pattern. It opens a file at "for" block but leaves it closed somewhere in the sky. > The garbage collector will: > - reclaim the memory used by the object; > - close the file. I suppose (IMO) that the primitive idea of garbage collection do

Re: extending PATH on Windows?

2016-02-17 Thread Ulli Horlacher
eryk sun wrote: > >> The AutoRun command (it's a command line, not a script path) > > > > A script path is a legal command line, too. > > If the registry value were just a script path, you'd have to modify > your script to chain to the previous script, if any. Since it's a > command line you can

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-17 Thread William Ray Wing
> On Feb 17, 2016, at 2:49 PM, wrong.addres...@gmail.com wrote: > > I am mostly getting positive feedback for Python. > I would be surprised if you weren’t. > It seems Python is used more for web based applications. Is it equally fine > for creating stand-alone *.exe's? Can the same code be c

How the heck does async/await work in Python 3.5

2016-02-17 Thread Mark Lawrence
Seeing there is a lot of interest in asyncio recently I figured people might be interested in this http://www.snarky.ca/how-the-heck-does-async-await-work-in-python-3-5 -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- h

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-17 Thread paul . hermeneutic
On Wed, Feb 17, 2016 at 12:49 PM, wrote: > Could someone kindly tell me advantages and disadvantages of Python? Or any > better options? I have like 40-50 VB Forms and may be around 2 lines of > code. It will be a task to learn a new language and translate/re-write that > code. Why are yo

Re: extending PATH on Windows?

2016-02-17 Thread eryk sun
On Wed, Feb 17, 2016 at 2:29 PM, Ulli Horlacher wrote: > eryk sun wrote: >> > >> > set PATH=%PATH%;%USERPROFILE%\Desktop >> >> The AutoRun command (it's a command line, not a script path) > > A script path is a legal command line, too. If the registry value were just a script path, you'd have to

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-17 Thread Ray Cote
On Wed, Feb 17, 2016 at 3:54 PM, Rob Gaddi < rgaddi@highlandtechnology.invalid> wrote: > > It seems Python is used more for web based applications. Is it equally > fine for creating stand-alone *.exe's? Can the same code be compiled to run > on Linux or Android or web-based? > > Standalone EXEs ar

Re: Reg: Data frame conversion

2016-02-17 Thread Rob Gaddi
Sushanth wrote: > ​i need to convert r data fr​ame to pandas dataframe and vise versa > Now, now, let's at least _try_ to help. http://lmgtfy.com/?q=convert+r+data+frame+to+pandas -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. S

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-17 Thread Rob Gaddi
wrong.addres...@gmail.com wrote: > I am mostly getting positive feedback for Python. Welcome to the party. Learn to write Python 3. There is no reason whatsoever for someone picking up Python to learn the deprecated problems of Python 2. > It seems Python is used more for web based application

Python 3 in 2016

2016-02-17 Thread Mark Lawrence
rr eat your heart out. https://hynek.me/articles/python3-2016/ -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Reg: Data frame conversion

2016-02-17 Thread Mark Lawrence
On 17/02/2016 18:00, Sushanth wrote: ​i need to convert r data fr​ame to pandas dataframe and vise versa It is very easy, just write some code. When you have finished, please show us your results. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for o

Re: extending PATH on Windows?

2016-02-17 Thread Ulli Horlacher
eryk sun wrote: > > At startup cmd.exe runs a script which is defined by the registry variable > > AutoRun in "HKCU\Software\Microsoft\Command Processor" > > > > I set this variable with: > > > > rc = "HKCU\Software\Microsoft\Command Processor" > > ar = "%USERPROFILE%\Desktop\autorun.cmd" > >

Re: Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-17 Thread sohcahtoa82
On Wednesday, February 17, 2016 at 11:49:44 AM UTC-8, wrong.a...@gmail.com wrote: > I am mostly getting positive feedback for Python. Good! > > It seems Python is used more for web based applications. Is it equally fine > for creating stand-alone *.exe's? Can the same code be compiled to run o

Considering migrating to Python from Visual Basic 6 for engineering applications

2016-02-17 Thread wrong . address . 1
I am mostly getting positive feedback for Python. It seems Python is used more for web based applications. Is it equally fine for creating stand-alone *.exe's? Can the same code be compiled to run on Linux or Android or web-based? Is it possible to create GUI elements with a good IDE? Can they

Are there any pyvcp experts here?

2016-02-17 Thread Gene Heskett
Greetings; I am having difficulty with the resultant gui objects its making that are too tall. They fit in the except the resultant box is 40 to 50 pixels too tall, wasting valueable screen real estate, and I haven't found a way to give the a "40" command that seems to be acceptable. I kno

Re: extending PATH on Windows?

2016-02-17 Thread eryk sun
On Wed, Feb 17, 2016 at 11:49 AM, Ulli Horlacher wrote: > At startup cmd.exe runs a script which is defined by the registry variable > AutoRun in "HKCU\Software\Microsoft\Command Processor" > > I set this variable with: > > rc = "HKCU\Software\Microsoft\Command Processor" > ar = "%USERPROFILE%

Re: Reg: Data frame conversion

2016-02-17 Thread Tony van der Hoff
On 17/02/16 18:00, Sushanth wrote: ​i need to convert r data fr​ame to pandas dataframe and vise versa Wow! How do you plan to do that? -- Tony van der Hoff| mailto:t...@vanderhoff.org Buckinghamshire, England | -- https://mail.python.org/mailman/listinfo/python-list

Reg: Data frame conversion

2016-02-17 Thread Sushanth
​i need to convert r data fr​ame to pandas dataframe and vise versa -- *Regards* *Sushanth* *ph : 91-9444583307* -- https://mail.python.org/mailman/listinfo/python-list

ANN: psutil 4.0.0 released - how to get "real" process memory and environ in Python

2016-02-17 Thread Giampaolo Rodola'
Full blog post: http://grodola.blogspot.com/2016/02/psutil-4-real-process-memory-and-environ.html -- Giampaolo - http://grodola.blogspot.com -- https://mail.python.org/mailman/listinfo/python-list

Re: extending PATH on Windows?

2016-02-17 Thread Ulli Horlacher
Thorsten Kampe wrote: > By the way: there is a script called `win_add2path.py` in your Python > distribution I have "Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32" and there is no "win_add2path.py" But I found another solution: I need the ex

Re: Passing data across callbacks in ThreadPoolExecutor

2016-02-17 Thread Ian Kelly
On Tue, Feb 16, 2016 at 2:48 PM, Joseph L. Casale wrote: > What is the pattern for chaining execution of tasks with ThreadPoolExecutor? > Callbacks is not an adequate facility as each task I have will generate new > output. Can you specify in more detail what your use case is? If you don't mind

Re: TypeError: not all arguments converted during string formatting

2016-02-17 Thread Chris Angelico
On Thu, Feb 18, 2016 at 12:58 AM, Ganesh Pal wrote: > Iam on python 2.6 and Linux , I had replaced print out, err ret with > logging.info(out, err ,ret) in the below code . I am getting > > "TypeError: not all arguments converted during string formatting" > error any quick suggestion > The

Re: TypeError: not all arguments converted during string formatting

2016-02-17 Thread Ganesh Pal
I think logging.info(out) works the problem is when I add logging.info(out,err,ret) ,may be there is a better way to supply this arguments On Wed, Feb 17, 2016 at 7:28 PM, Ganesh Pal wrote: > Hi Team, > > > Iam on python 2.6 and Linux , I had replaced print out, err ret with > logging.info(o

TypeError: not all arguments converted during string formatting

2016-02-17 Thread Ganesh Pal
Hi Team, Iam on python 2.6 and Linux , I had replaced print out, err ret with logging.info(out, err ,ret) in the below code . I am getting "TypeError: not all arguments converted during string formatting" error any quick suggestion try: out, err, ret = run(cmd, timeout=60)

Re: Weird and sparese cgi:error

2016-02-17 Thread Chris Angelico
On Thu, Feb 18, 2016 at 12:47 AM, Jeremy Leonard wrote: > On Tuesday, February 16, 2016 at 3:02:40 PM UTC-5, Φώντας Λαδοπρακόπουλος > wrote: >> Hello, >> >> I recentely changed VPS server and when i try to load my webiste iam >> receiving 500 error which i wasnt receiving in my old VPS server wi

Re: Weird and sparese cgi:error

2016-02-17 Thread Jeremy Leonard
On Tuesday, February 16, 2016 at 3:02:40 PM UTC-5, Φώντας Λαδοπρακόπουλος wrote: > Hello, > > I recentely changed VPS server and when i try to load my webiste iam > receiving 500 error which i wasnt receiving in my old VPS server with the > same exact cgi scripts. > > After looking at Apacher's

Re: Make a unique filesystem path, without creating the file

2016-02-17 Thread Oscar Benjamin
On 16 February 2016 at 19:40, Ben Finney wrote: > Oscar Benjamin writes: > >> If you're going to patch open to return a fake file when asked to open >> fake_file_path why do you care whether there is a real file of that >> name? > > I don't, and have been saying explicitly many times in this thre

Re: [python-uk] URGENT: Volunteers for teacher collaboration please... :-)

2016-02-17 Thread Anubhav Yadav
I met @ntoll at an event in India. It was refreshing to see his passion for teaching kids about programming and python. I would have loved to be there, but I don't reside in the UK. Nevertheless, just replying to wish you guys all the best. On Wed, Feb 17, 2016 at 2:50 PM, Tim Golden wrote: >

Fwd: [python-uk] URGENT: Volunteers for teacher collaboration please... :-)

2016-02-17 Thread Tim Golden
[Forwarding an email from python-uk in the hope that UK-based Pythonistas might see it here who don't hang out there...] From: Nicholas H.Tollervey Reply-To: UK Python Users To: UK Python Users Hi Folks, I realise I must sound like a stuck record about this sort of thing - please accept my si

Guido on python3 for beginners

2016-02-17 Thread Rustom Mody
On Tuesday, February 16, 2016 at 10:54:43 AM UTC+5:30, John Ladasky wrote: > On Monday, February 15, 2016 at 6:02:24 PM UTC-8, Rick Johnson wrote: > > I don't need Python3. And i reckon that by the time i do, > > something more interesting will come along, or, i'll create > > something more inter