Re: Mimick tac with python.

2016-01-29 Thread Random832
On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote: > Hi all, > > I can use the following methods for mimicking tac command bellow: > > awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file > perl -e 'print reverse<>' input_file Well, both of those read the whole file into memory - tac is so

Mimick tac with python.

2016-01-29 Thread Hongyi Zhao
Hi all, I can use the following methods for mimicking tac command bellow: awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file perl -e 'print reverse<>' input_file Is it possible to do the same thing with python? Regards -- .: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :

Re: Mimick tac with python.

2016-01-29 Thread Hongyi Zhao
On Fri, 29 Jan 2016 23:58:38 -0500, Random832 wrote: > python <(echo 'import sys;print("".join(reversed(list(sys.stdin') Why do you write it as follows: cat input_file | python -c 'import sys;print("".join(reversed(list (sys.stdin' Regards -- .: Hongyi Zhao [ hongyi.zhao AT gmail.com ]

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Rustom Mody
On Saturday, January 30, 2016 at 3:01:09 AM UTC+5:30, Rick Johnson wrote: > On Friday, January 29, 2016 at 6:21:21 AM UTC-6, Ulli Horlacher wrote: > > I nearly gave up with Python at the very beginning before > > I realised that OO-programming is optional in Python! :-) > > Most tutorials I found s

Re: Mimick tac with python.

2016-01-29 Thread Christian Gollwitzer
Am 30.01.16 um 05:58 schrieb Random832: On Fri, Jan 29, 2016, at 23:46, Hongyi Zhao wrote: awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file perl -e 'print reverse<>' input_file Well, both of those read the whole file into memory - tac is sometimes smarter than that, but that makes fo

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Chris Angelico
On Sat, Jan 30, 2016 at 2:08 PM, Terry Reedy wrote: > On 1/29/2016 3:51 PM, Chris Angelico wrote: >> >> On Sat, Jan 30, 2016 at 7:42 AM, Fillmore >> wrote: > > >>> - Is there a good IDE that can be used for debugging? all free IDEs for >>> Perl >>> suck and it would be awesome if Python was bette

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Terry Reedy
On 1/29/2016 3:51 PM, Chris Angelico wrote: On Sat, Jan 30, 2016 at 7:42 AM, Fillmore wrote: - Is there a good IDE that can be used for debugging? all free IDEs for Perl suck and it would be awesome if Python was better than that. Debugging Python code is generally easy enough without an I

Re: Mimick tac with python.

2016-01-29 Thread Chris Angelico
On Sat, Jan 30, 2016 at 3:46 PM, Hongyi Zhao wrote: > I can use the following methods for mimicking tac command bellow: > > awk '{a[NR]=$0} END {while (NR) print a[NR--]}' input_file > perl -e 'print reverse<>' input_file > > Is it possible to do the same thing with python? python -c 'import sys;

Re: show instant data on webpage

2016-01-29 Thread Grobu
On 26/01/16 17:10, mustang wrote: I've built a sensor to measure some values. I would like to show it on a web page with python. This is an extract of the code: file = open("myData.dat", "w") while True: temp = sensor.readTempC() riga = "%f\n" % temp file.write(rig

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Rustom Mody
On Saturday, January 30, 2016 at 3:01:09 AM UTC+5:30, Rick Johnson wrote: > On Friday, January 29, 2016 at 6:21:21 AM UTC-6, Ulli Horlacher wrote: > > I nearly gave up with Python at the very beginning before > > I realised that OO-programming is optional in Python! :-) > > Most tutorials I found s

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ben Finney
Fillmore writes: > On 1/29/2016 4:30 PM, Rick Johnson wrote: > > People who are unwilling to "expanding their > > intellectual horizons" make me sick!!! > > did I miss something or is this aggressiveness unjustified? Indeed it is unjustified. The person to whom you respond is best ignored (auto

Re: Pyhon Icon

2016-01-29 Thread Terry Reedy
On 1/29/2016 6:00 AM, Walter Nakatana wrote: Every time I install python , I don't see the icon on my desktop Correct. The Windows installer puts 5 icons-entries under a Python x.y entry in the Start Menu (or All apps in Win 10). It does not put any on the desktop. You can easily copy fro

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Josef Pktd
On Friday, January 29, 2016 at 4:50:25 PM UTC-5, Cody Piersall wrote: > On Fri, Jan 29, 2016 at 2:42 PM, Fillmore > wrote: > > I actually have a few followup question. > > > - will iNotebook also work in Python 3? > Yes! And just FYI, it's called they Jupyter Notebook now, but pretty much > ever

How to resize an animated gif to fit the window

2016-01-29 Thread kwekey
Hi, I am able to display animated gif using pyglet using below code, but I would like the image to stretch and fit the window as i resize the window. Any one can help me? import pyglet # pick an animated gif file you have in the working directory CODE: SELECT ALL def animate(str): ag_file =

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Cameron Simpson
On 29Jan2016 18:12, Steven D'Aprano wrote: On Fri, 29 Jan 2016 11:25 am, Chris Angelico wrote: Probably the biggest thing to take note of is the Python object model - how names and objects and assignment work. It's pretty straight-forward, but if it's not what you're used to, you'll need to ge

Re: psss...I want to move from Perl to Python

2016-01-29 Thread MRAB
On 2016-01-30 00:57:10, "Fillmore" wrote: On 1/29/2016 4:30 PM, Rick Johnson wrote: People who are unwilling to "expanding their intellectual horizons" make me sick!!! did I miss something or is this aggressiveness unjustified? In the past, he has posted under the name "Ranting Rick", whic

Re: Font issues Tkinter/Python 3.5

2016-01-29 Thread MRAB
On 2016-01-29 22:04:57, "KP" wrote: import tkinter as tk from tkinter import ttk from tkinter import font ... def __init__(self): self.root = tk.Tk() self.root.title('Main Window') self.root.geometry('1000x800+200+200') self.root.minsize(width=1000, height=

Re: The computer that mastered Go

2016-01-29 Thread Bernardo Sulzbach
On Fri, Jan 29, 2016 at 8:25 PM, mm0fmf via Python-list wrote: > > Why did he post it in comp.lang.python then? > I don't know. I must say that it is a pretty good video, though. Much more interesting than the average "How to install Python? What have you tried? Asking here." that goes on every n

Re: The computer that mastered Go

2016-01-29 Thread Bernardo Sulzbach
On Fri, Jan 29, 2016 at 8:13 PM, Paul Rubin wrote: > One would expect it to be written in Go, but it turns out to be C++ and > Lua :(. I can only contribute with my sadness and disappointment. =( -- Bernardo Sulzbach -- https://mail.python.org/mailman/listinfo/python-list

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Fillmore
On 1/29/2016 4:30 PM, Rick Johnson wrote: People who are unwilling to "expanding their intellectual horizons" make me sick!!! did I miss something or is this aggressiveness unjustified? -- https://mail.python.org/mailman/listinfo/python-list

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ben Finney
Steven D'Aprano writes: > You should have started with the official tutorial: > > https://docs.python.org/2/tutorial/ And these days the default recommendation should be to start with the official tutorial for the current stable version of the Python language, Python 3 https://docs.python.org/3/

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Rick Johnson
On Friday, January 29, 2016 at 2:49:24 PM UTC-6, sohca...@gmail.com wrote: > I'm convinced that anyone who actually prefers Perl's > syntax over Python is suffering from Stockholm Syndrome. > > [...] > > Readability counts. I'd say readability is one of the > most important features of a language

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Gregory Ewing
sohcahto...@gmail.com wrote: On Thursday, January 28, 2016 at 6:34:34 PM UTC-8, Chris Angelico wrote: https://xkcd.com/353/ I have this comic pinned to the outside wall of my cubicle at work, where I use Python for 98% of my work. Another good thing to pin to your wall: http://www.gentooge

Re: The computer that mastered Go

2016-01-29 Thread mm0fmf via Python-list
On 29/01/2016 22:13, Paul Rubin wrote: mm0fmf writes: Is it written in Python? One would expect it to be written in Go, but it turns out to be C++ and Lua :(. Why did he post it in comp.lang.python then? -- https://mail.python.org/mailman/listinfo/python-list

Re: The computer that mastered Go

2016-01-29 Thread Paul Rubin
mm0fmf writes: > Is it written in Python? One would expect it to be written in Go, but it turns out to be C++ and Lua :(. -- https://mail.python.org/mailman/listinfo/python-list

Font issues Tkinter/Python 3.5

2016-01-29 Thread KP
import tkinter as tk from tkinter import ttk from tkinter import font ... def __init__(self): self.root = tk.Tk() self.root.title('Main Window') self.root.geometry('1000x800+200+200') self.root.minsize(width=1000, height=800) default_font = tkFon

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Cody Piersall
On Fri, Jan 29, 2016 at 2:42 PM, Fillmore wrote: > I actually have a few followup question. > - will iNotebook also work in Python 3? Yes! And just FYI, it's called they Jupyter Notebook now, but pretty much everyone still (colloquially) calls it the IPython Notebook so you're in good company.

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Chris Angelico
On Sat, Jan 30, 2016 at 7:41 AM, wrote: > It's funny...when I first started using Python, I hated it because it held > your hand and made everything too easy. I was a major C, C++ and Java > fanatic. Now, I LOVE Python because it holds your hand and makes everything > so easy. > Exactly. >

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ben Finney
"Sven R. Kunze" writes: > On 29.01.2016 01:01, Fillmore wrote: > > How was the Python 2.7 vs Python 3.X solved? which version should I > > go for? > > Python 3 is the new and better one. More importantly: Python 2 will never improve; Python 3 is the only one that is actively developed. -- \

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Gregory Ewing
Random832 wrote: The main source of confusion is that $foo[5] is an element of @foo. $foo{'x'} is an element of %foo. Both of these have absolutely nothing to do with $foo. And this is where Perl seems totally insane to me. Obviously it knows from the square brackets that foo[5] is referring to

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Nathan Hilterbrand
On Fri, Jan 29, 2016 at 3:42 PM, Fillmore wrote: > > I actually have a few followup question. > > - will iNotebook also work in Python 3? > > - What version of Python 3 do you recommend I install on Windows? > > - Is Python 3 available also for CygWin? > > - I use Ubuntu at home. Will I be able t

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Rick Johnson
On Friday, January 29, 2016 at 6:21:21 AM UTC-6, Ulli Horlacher wrote: > I nearly gave up with Python at the very beginning before > I realised that OO-programming is optional in Python! :-) > Most tutorials I found so far makes OO mandatory. Just more evidence that old dogs are incapable of learn

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Chris Angelico
On Sat, Jan 30, 2016 at 7:42 AM, Fillmore wrote: > I actually have a few followup question. > > - will iNotebook also work in Python 3? You mean the IPython notebook? Yep! > - What version of Python 3 do you recommend I install on Windows? The latest stable - currently, that's 3.5. > - Is Pyth

Re: psss...I want to move from Perl to Python

2016-01-29 Thread sohcahtoa82
On Friday, January 29, 2016 at 1:12:34 AM UTC-8, Ulli Horlacher wrote: > Steven D'Aprano wrote: > > > Every time I make a half-hearted attempt to learn enough Perl syntax to get > > started, I keep running into the differences between $foo, %foo and @foo > > and dire warnings about what happens i

Re: psss...I want to move from Perl to Python

2016-01-29 Thread sohcahtoa82
On Thursday, January 28, 2016 at 6:34:34 PM UTC-8, Chris Angelico wrote: > On Fri, Jan 29, 2016 at 1:06 PM, Paul Rubin wrote: > > Fillmore writes: > >> I look and Python and it looks so much more clean > > > > Yes it is, I forgot everything I knew about Perl shortly after starting > > to use

Re: The computer that mastered Go

2016-01-29 Thread mm0fmf via Python-list
On 29/01/2016 19:46, Seymore4Head wrote: https://www.youtube.com/watch?v=g-dKXOlsf98 Is it written in Python? -- https://mail.python.org/mailman/listinfo/python-list

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Fillmore
I actually have a few followup question. - will iNotebook also work in Python 3? - What version of Python 3 do you recommend I install on Windows? - Is Python 3 available also for CygWin? - I use Ubuntu at home. Will I be able to install Python 3 with apt-get? will I need to uninstall previo

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Fillmore
+1 On 1/29/2016 10:07 AM, Random832 wrote: The main source of confusion is that $foo[5] is an element of @foo. $foo{'x'} is an element of %foo. Both of these have absolutely nothing to do with $foo. -- https://mail.python.org/mailman/listinfo/python-list

The computer that mastered Go

2016-01-29 Thread Seymore4Head
https://www.youtube.com/watch?v=g-dKXOlsf98 -- https://mail.python.org/mailman/listinfo/python-list

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Fillmore
So many answers. So much wisdom...thank you everyone On 01/28/2016 07:01 PM, Fillmore wrote: -- https://mail.python.org/mailman/listinfo/python-list

Re: Error message

2016-01-29 Thread Oscar Benjamin
On 28 January 2016 at 18:51, Emeka Ikele wrote: > Please I downloaded Python 3.5 (32 bit) for Windows software. I installed > it but it keeps giving me an error message that a file was not found and I > should please re-install to fix the problem. I've tried that severally but > to no avail. Plea

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Sven R. Kunze
Hi, On 29.01.2016 01:01, Fillmore wrote: I look and Python and it looks so much more clean add to that that it is the language of choice of data miners... add to that that iNotebook looks powerful All true. :) Does Python have Regexps? "import re" https://docs.python.org/3.5/li

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Random832
On Fri, Jan 29, 2016, at 04:12, Ulli Horlacher wrote: > Steven D'Aprano wrote: > > > Every time I make a half-hearted attempt to learn enough Perl syntax to get > > started, I keep running into the differences between $foo, %foo and @foo > > and dire warnings about what happens if you use the wro

Re: Pyhon Icon

2016-01-29 Thread Oscar Benjamin
On 29 January 2016 at 11:00, Walter Nakatana wrote: > Every time I install python , I don't see the icon on my desktop neither in > my C: drive Hi Walter, I guess you're using Windows. There are many different ways to run Python. One way that beginners often use is to run IDLE. You can find some

Re: Python 3.5.1

2016-01-29 Thread Joel Goldstick
On Fri, Jan 29, 2016 at 10:35 AM, Joel Cotto wrote: > Hi, > > I'm using the new release of python ver 3.5.1 but i got problem using its > code to communicate w/ serial port. I'm receiving port error. Hope you can > guide me if there are change made in the command. Thanks and Good Day > > import s

Re: Pyhon Icon

2016-01-29 Thread Joel Goldstick
On Fri, Jan 29, 2016 at 6:00 AM, Walter Nakatana wrote: > Good day, > > Every time I install python , I don't see the icon on my desktop neither > in my C: drive > > > Try searching the list. There are dozens of questions and answers about installing python on windows. Failing that, be specific

Python 3.5.1

2016-01-29 Thread Joel Cotto
Hi, I'm using the new release of python ver 3.5.1 but i got problem using its code to communicate w/ serial port. I'm receiving port error. Hope you can guide me if there are change made in the command. Thanks and Good Day import serial ser = 0 def init_serial(): COMNUM = 1 global ser ser = seria

Re: show instant data on webpage

2016-01-29 Thread Joel Goldstick
On Fri, Jan 29, 2016 at 6:48 AM, mustang wrote: > > Then I'd use gnuplot or matplotlib. >> >> ok, but then I can upload/plot them online? > -- > https://mail.python.org/mailman/listinfo/python-list > Confusing mustang. You said: anyway I'm not interested in building website I've only to plot/s

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ulli Horlacher
James Harris wrote: > I nearly gave up with Python at the very beginning before I realised not > to mix tabs and spaces. I nearly gave up with Python at the very beginning before I realised that OO-programming is optional in Python! :-) Most tutorials I found so far makes OO mandatory. -- Ul

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Steven D'Aprano
On Fri, 29 Jan 2016 11:21 pm, Ulli Horlacher wrote: > Most tutorials I found so far makes OO mandatory. You should have started with the official tutorial: https://docs.python.org/2/tutorial/ which doesn't get into classes until Chapter 9, after: - using Python as a calculator; - numbers, st

Re: psss...I want to move from Perl to Python

2016-01-29 Thread James Harris
On 29/01/2016 09:12, Ulli Horlacher wrote: Steven D'Aprano wrote: Every time I make a half-hearted attempt to learn enough Perl syntax to get started, I keep running into the differences between $foo, %foo and @foo and dire warnings about what happens if you use the wrong sigil I have starte

Pyhon Icon

2016-01-29 Thread Walter Nakatana
Good day, Every time I install python , I don't see the icon on my desktop neither in my C: drive Have a great day Kind Regards, Walter Nakatana IT Help-Desk Administrator Meat Corporation of Namibia, MEATCO Tel : +264 (0)61 321 6459 Fax : +264 (0)61 321 6401 Mobile : +264 (0)81 744 7474 E-m

Re: show instant data on webpage

2016-01-29 Thread mustang
Then I'd use gnuplot or matplotlib. ok, but then I can upload/plot them online? -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about asyncio and blocking operations

2016-01-29 Thread Frank Millman
"Frank Millman" wrote in message news:n8et0d$hem$1...@ger.gmane.org... I have read the other messages, and I can see that there are some clever ideas there. However, having found something that seems to work and that I feel comfortable with, I plan to run with this for the time being. A quic

Re: Question about asyncio and blocking operations

2016-01-29 Thread Maxime Steisel
Le 28 janv. 2016 22:52, "Ian Kelly" a écrit : > > On Thu, Jan 28, 2016 at 2:23 PM, Maxime S wrote: > > > > 2016-01-28 17:53 GMT+01:00 Ian Kelly : > >> > >> On Thu, Jan 28, 2016 at 9:40 AM, Frank Millman wrote: > >> > >> > The caller requests some data from the database like this. > >> > > >> >

[ANN] Gajja 0.1: Fake objects for real tests

2016-01-29 Thread Ben Finney
Howdy all, I am pleased to announce the first release of the testing library I've named Gajja https://pypi.python.org/pypi/gajja/>. Its purpose is to allow fine-grained control of not only file content, but metadata and system access behaviour, for in-memory test doubles. Currently it provides c

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Chris Angelico
On Fri, Jan 29, 2016 at 6:12 PM, Steven D'Aprano wrote: > On Fri, 29 Jan 2016 11:25 am, Chris Angelico wrote: > >> Probably the biggest thing to take note of is the Python object model >> - how names and objects and assignment work. It's pretty >> straight-forward, but if it's not what you're used

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Ulli Horlacher
Steven D'Aprano wrote: > Every time I make a half-hearted attempt to learn enough Perl syntax to get > started, I keep running into the differences between $foo, %foo and @foo > and dire warnings about what happens if you use the wrong sigil I have started learning Python several times and surre

>>> %matplotlib inline results in SyntaxError: invalid syntax

2016-01-29 Thread Mike S via Python-list
I have installed Python 3.4.4 on XPSP3 and am trying to work my way through this tutorial. A Complete Tutorial on Ridge and Lasso Regression in Python http://www.analyticsvidhya.com/blog/2016/01/complete-tutorial-ridge-lasso-regression-python/ In Step 2 "Why Penalize the Magnitude of Coefficien

Getting VS2015 to work with arcpy

2016-01-29 Thread Paul Schrum
I have posted this question on stackoverflow, but I think I may be more likely to get help in the mailing list: http://stackoverflow.com/questions/35069640/getting-vs2015-to-work-with-arcpy Getting VS2015 to work with arcpy

Error message

2016-01-29 Thread Emeka Ikele
Please I downloaded Python 3.5 (32 bit) for Windows software. I installed it but it keeps giving me an error message that a file was not found and I should please re-install to fix the problem. I've tried that severally but to no avail. Please what can I do or should I just install the 2.7 version

Re: psss...I want to move from Perl to Python

2016-01-29 Thread Jussi Piitulainen
Fillmore writes: > Does Python have Regexps? Start by importing the re module (as said). Find its documentation at the following link (together with a list of many other modules that come standard with Python). Also, once imported to the interactive session, help(re), dir(re). https://docs.pytho

Re: >>> %matplotlib inline results in SyntaxError: invalid syntax

2016-01-29 Thread Mike S via Python-list
On 1/28/2016 11:57 PM, Steven D'Aprano wrote: On Fri, 29 Jan 2016 06:04 pm, Mike S wrote: %matplotlib inline I get an error on the last line. I am running this code in Idle Python 3.4.4 Shell... Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win32 Typ

Re: >>> %matplotlib inline results in SyntaxError: invalid syntax

2016-01-29 Thread Steven D'Aprano
On Fri, 29 Jan 2016 06:04 pm, Mike S wrote: > %matplotlib inline > > I get an error on the last line. I am running this code in Idle Python > 3.4.4 Shell... > > Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 > bit (Intel)] on win32 > Type "copyright", "credits" or "lice