Re: Where is 'palindrome' defined?

2015-05-31 Thread Gary Herron
On 05/31/2015 09:46 PM, fl wrote: Hi, When I search solution of reverse a string/number, I came across a short function online: def palindrome(num): return str(num) == str(num)[::-1] I thought that it is a general function. And with the following variable: No, this function is not

Re: What use for reversed()?

2015-05-31 Thread Jussi Piitulainen
fl writes: > On Sunday, May 31, 2015 at 12:59:47 PM UTC-7, Denis McMahon wrote: >> On Sun, 31 May 2015 12:40:19 -0700, fl wrote: >> reversed returns an iterator, not a list, so it returns the reversed >> list of elements one at a time. You can use list() or create a list >> from reversed and then

Re: What use for reversed()?

2015-05-31 Thread fl
On Sunday, May 31, 2015 at 12:59:47 PM UTC-7, Denis McMahon wrote: > On Sun, 31 May 2015 12:40:19 -0700, fl wrote: > reversed returns an iterator, not a list, so it returns the reversed list > of elements one at a time. You can use list() or create a list from > reversed and then join the result:

Where is 'palindrome' defined?

2015-05-31 Thread fl
Hi, When I search solution of reverse a string/number, I came across a short function online: >>> def palindrome(num): return str(num) == str(num)[::-1] I thought that it is a general function. And with the following variable: >>> a '1234_' >>> parlindrome(a) Traceback (most recen

Re: Everything is an object in python - object class and type class

2015-05-31 Thread Steven D'Aprano
On Mon, 1 Jun 2015 01:09 pm, Eddilbert Macharia wrote: > Thank you for you responses guys. > > So what I'm getting from above responses, everything in python is an > object because the are instance of the metaclass type (from Steven > response) and also because they are subclasses of the class ob

Re: Everything is an object in python - object class and type class

2015-05-31 Thread Steven D'Aprano
On Mon, 1 Jun 2015 10:29 am, Eddilbert Macharia wrote: > > So what im getting from above reponse, everything in python is an object > because the are instance of the metaclass type and also because they are > subclasses of the class object ? No. Everything in Python is an object because Python

Re: Python Paramiko between Linux and Windows Server -- no output obtained from Windows for "dir" or "cd" commands

2015-05-31 Thread Pythonista
On Sunday, May 31, 2015 at 6:20:19 PM UTC-7, Dennis Lee Bieber wrote: > On Sun, 31 May 2015 13:12:24 -0700 (PDT), Pythonista > declaimed the following: > > > > >Thanks Peter but I got no output from your suggestion either.! > > From Windows viewpoint, I suspect EACH of the commands you sen

Re: What use for reversed()?

2015-05-31 Thread fl
On Sunday, May 31, 2015 at 4:23:19 PM UTC-7, Tim Delaney wrote: > On 1 June 2015 at 05:40, fl wrote: > Hi, > > The for statement must have a colon at the end of line e.g. a complete for > statement and block is: > > for br in b: >     print br > > This will output the characters one per line (

Re: Everything is an object in python - object class and type class

2015-05-31 Thread Eddilbert Macharia
So what im getting from above reponse, everything in python is an object because the are instance of the metaclass type and also because they are subclasses of the class object ? On Sunday, May 31, 2015 at 5:34:20 PM UTC+3, Eddilbert Macharia wrote: > Hello All , > > I'm wrecking my head tryi

Re: Basic Info

2015-05-31 Thread garyr
wrote in message news:178f0eac-1760-40b3-9c10-c2d007588...@googlegroups.com... > Hi friends, > M Tanveer, and wanna start to learn python language, i've installed python > on my Windows (OS) and set path to it, Now please Guide me which editor is > best to use and what instructions should be f

Re: Everything is an object in python - object class and type class

2015-05-31 Thread Eddilbert Macharia
Thank you for you responses guys. So what I'm getting from above responses, everything in python is an object because the are instance of the metaclass type (from Steven response) and also because they are subclasses of the class object (from Marco and Terry response)? I'm having headache tryi

Re: Using Python instead of Bash

2015-05-31 Thread Ethan Furman
Just for funsies, I did a slight rewrite using my scription[1] library: --8<-- #!/usr/bin/python3 """ Convert scanned images: contrast is increased, size is enlarged, format is changed from jpeg to png. """ from __future

[RELEASED] Python 3.5.0b2 is now available

2015-05-31 Thread Larry Hastings
On behalf of the Python development community and the Python 3.5 release team, I'm relieved to announce the availability of Python 3.5.0b2. Python 3.5.0b1 had a major regression (see http://bugs.python.org/issue24285 for more information) and as such was not suitable for testing Python 3.5.

Re: What use for reversed()?

2015-05-31 Thread Tim Delaney
On 1 June 2015 at 10:30, Mark Lawrence wrote: > On 01/06/2015 00:23, Tim Delaney wrote: > >> The for statement must have a colon at the end of line e.g. a complete >> for statement and block is: >> >> for br in b: >> print br >> >> This will output the characters one per line (on Python 3.x)

Re: Everything is an object in python - object class and type class

2015-05-31 Thread random832
On Sun, May 31, 2015, at 10:34, Eddilbert Macharia wrote: > Hello All , > > I'm wrecking my head trying to understand. where the class object comes > into play . > > Is it only meant to act as base class and does it mean there is an actual > class called object in python which all the objects cr

Re: Best way to prevent zombie processes

2015-05-31 Thread Ben Finney
Cameron Simpson writes: > The standard trick is to make the process a grandchild instead of a > child. Fork, kick off subprocess, exit (the forked child). For Cecil Westerhof's benefit: If you haven't seen it, the ‘python-daemon’ library is designed to get this, and other fiddly aspects of daem

Re: What is considered an "advanced" topic in Python?

2015-05-31 Thread Chris Angelico
On Mon, Jun 1, 2015 at 1:18 PM, wrote: > On Fri, May 29, 2015, at 13:08, Chris Angelico wrote: >> Also, I like talking about Fraction and >> Decimal for the simple reason that they're unobvious; you can poke >> around with Python and discover int and float, and if ever you need >> imaginary/compl

Re: What is considered an "advanced" topic in Python?

2015-05-31 Thread random832
On Fri, May 29, 2015, at 13:08, Chris Angelico wrote: > Also, I like talking about Fraction and > Decimal for the simple reason that they're unobvious; you can poke > around with Python and discover int and float, and if ever you need > imaginary/complex numbers, you'll quickly come across complex,

Re: Best way to prevent zombie processes

2015-05-31 Thread Cameron Simpson
On 31May2015 23:33, Cecil Westerhof wrote: At the moment I have the following code: os.chdir(directory) for document in documents: subprocess.Popen(['evince', document]) With this I can open several documents at once. But there is no way to know when those documents are going to be

Re: What use for reversed()?

2015-05-31 Thread Ian Kelly
On Sun, May 31, 2015 at 1:58 PM, Denis McMahon wrote: > reversed returns an iterator, not a list, so it returns the reversed list > of elements one at a time. You can use list() or create a list from > reversed and then join the result: > > $ python > Python 2.7.3 (default, Dec 18 2014, 19:10:20)

Re: What use for reversed()?

2015-05-31 Thread Mark Lawrence
On 01/06/2015 00:23, Tim Delaney wrote: On 1 June 2015 at 05:40, fl mailto:rxjw...@gmail.com>> wrote: Hi, I have a string b='1234'. I run: br=reversed(b) I hope that I can print out '4321' by: for br in b but it complains: SyntaxError: invalid syntax Any time you ge

EuroPython 2015: More than 200 sessions waiting for you

2015-05-31 Thread M.-A. Lemburg
We are pleased to announce the list of accepted sessions for EuroPython 2015 in Bilbao: *** EuroPython 2015 Session List *** https://ep2015.europython.eu/en/events/sessions/ The sessions were selected on the basis of your talk voting and the work of the EuroPython prog

Re: Using Python instead of Bash

2015-05-31 Thread Cameron Simpson
On 31May2015 11:05, Dennis Lee Bieber wrote: I'll concede submitting jobs to a print queue probably does work easier this way, but I'd have to ask if the "convert" could be performed using actual Python -- the old Python Imaging Library -- PIL -- for example (superseded, I think, by pill

Re: What use for reversed()?

2015-05-31 Thread Tim Delaney
On 1 June 2015 at 05:40, fl wrote: > Hi, > > I have a string b='1234'. I run: br=reversed(b) > > I hope that I can print out '4321' by: > > for br in b > > but it complains: > SyntaxError: invalid syntax > Any time you get a SyntaxError, it means that you have coded something which does not matc

Re: Best way to prevent zombie processes

2015-05-31 Thread Marko Rauhamaa
Cecil Westerhof : > At the moment I have the following code: > os.chdir(directory) > for document in documents: > subprocess.Popen(['evince', document]) > > With this I can open several documents at once. But there is no way to > know when those documents are going to be closed. Th

Best way to prevent zombie processes

2015-05-31 Thread Cecil Westerhof
At the moment I have the following code: os.chdir(directory) for document in documents: subprocess.Popen(['evince', document]) With this I can open several documents at once. But there is no way to know when those documents are going to be closed. This could/will lead to zombie pro

Re: What use for reversed()?

2015-05-31 Thread cheshire
On Sun, 31 May 2015 12:40:19 -0700 (PDT), fl wrote: > 2. If reversed() is wrong the my purpose, what method can do it? i.e. '4321' > out. Try using slices: >>> b='1234' >>> b[::-1] '4321' https://docs.python.org/2/whatsnew/2.3.html#extended-slices -- https://mail.python.org/mailman/listinfo/py

Re: Basic Info

2015-05-31 Thread Eddilbert Macharia
On Sunday, May 31, 2015 at 8:35:42 AM UTC+3, Tanveer Ahmad wrote: > Hi friends, > M Tanveer, and wanna start to learn python language, i've installed python on > my Windows (OS) and set path to it, Now please Guide me which editor is best > to use and what instructions should be followed . > Bes

Re: Python Paramiko between Linux and Windows Server -- no output obtained from Windows for "dir" or "cd" commands

2015-05-31 Thread Pythonista
On Sunday, May 31, 2015 at 5:18:53 AM UTC-7, Peter Otten wrote: > Pythonista wrote: > > > Hello There: > > > > I am using Python 2.7.6 and Paramiko module (on a Linux server) to connect > > to a Windows server and send some commands and get output. I have a > > connect function which takes IP, us

Re: What use for reversed()?

2015-05-31 Thread Denis McMahon
On Sun, 31 May 2015 12:40:19 -0700, fl wrote: > Hi, > > I have a string b='1234'. I run: br=reversed(b) > > I hope that I can print out '4321' by: > > for br in b > > but it complains: > SyntaxError: invalid syntax > > > My questions: > 1. What use for reversed(). I do not find an example on

Re: Are there any other better ways to access a single bit of string of digits?

2015-05-31 Thread fl
On Sunday, May 31, 2015 at 12:53:19 PM UTC-7, Denis McMahon wrote: > On Sun, 31 May 2015 11:36:35 -0700, fl wrote: > > I am new to Python. I would manipulate a string of hex numbers. If the > > first digit is bigger than 7, the first two digits are required to add > > 4. > What happens if the first

Re: Are there any other better ways to access a single bit of string of digits?

2015-05-31 Thread Denis McMahon
On Sun, 31 May 2015 11:36:35 -0700, fl wrote: > I am new to Python. I would manipulate a string of hex numbers. If the > first digit is bigger than 7, the first two digits are required to add > 4. What happens if the first two digits are ff, does it become 103 or 03. If you have __

Are there any other better ways to access a single bit of string of digits?

2015-05-31 Thread fl
Hi, I am new to Python. I would manipulate a string of hex numbers. If the first digit is bigger than 7, the first two digits are required to add 4. For example, '8022_3345' will be changed to '8422_3345'. The underscore between two 4-digit's was generated previously (i.e. it is already in the .

What use for reversed()?

2015-05-31 Thread fl
Hi, I have a string b='1234'. I run: br=reversed(b) I hope that I can print out '4321' by: for br in b but it complains: SyntaxError: invalid syntax My questions: 1. What use for reversed(). I do not find an example on web. 2. If reversed() is wrong the my purpose, what method can do it? i.e

Re: Everything is an object in python - object class and type class

2015-05-31 Thread Steven D'Aprano
On Mon, 1 Jun 2015 12:34 am, Eddilbert Macharia wrote: > Hello All , > > I'm wrecking my head trying to understand. where the class object comes > into play . This is just the standard object-oriented concept of class and instances. Have you programmed in any other OO language? Lassie is an in

Re: Using Python instead of Bash

2015-05-31 Thread Cecil Westerhof
Op Sunday 31 May 2015 17:05 CEST schreef Dennis Lee Bieber: > On Sun, 31 May 2015 14:42:02 +0200, Cecil Westerhof > declaimed the following: > >> I help someone that has problems reading. For this I take photo's >> of text, use convert from ImageMagick to make a good contrast >> (original paper i

Re: Using Python instead of Bash

2015-05-31 Thread Cecil Westerhof
Op Sunday 31 May 2015 16:02 CEST schreef Alain Ketterlin: > Cecil Westerhof writes: > >> I help someone that has problems reading. For this I take photo's >> of text, use convert from ImageMagick to make a good contrast >> (original paper is grey) and use lpr to print it a little bigger. > >> imp

Re: Using Python instead of Bash

2015-05-31 Thread Cecil Westerhof
Op Sunday 31 May 2015 16:14 CEST schreef Cem Karan: >> I help someone that has problems reading. For this I take photo's >> of text, use convert from ImageMagick to make a good contrast >> (original paper is grey) and use lpr to print it a little bigger. >> >> Normally I would implement this in Ba

Re: Everything is an object in python - object class and type class

2015-05-31 Thread Terry Reedy
On 5/31/2015 10:34 AM, Eddilbert Macharia wrote: I'm wrecking my head trying to understand. where the class object comes into play . Leaving custom metaclasses aside. 1. All python data values are instances of some class. 2. Every class is a instance of the metaclass 'type'. 3. Every class

Re: Everything is an object in python - object class and type class

2015-05-31 Thread Marco Buttu
On 31/05/2015 16:34, Eddilbert Macharia wrote: Also when we say everything is an object in python, are we referring to the fact that everything is an instance of the class type or does it have to with the object class inherited ? From Wikipedia: "In the class-based object-oriented programmin

Re: Basic Info

2015-05-31 Thread Mark Lawrence
On 31/05/2015 06:35, ch.tanvee...@gmail.com wrote: Hi friends, M Tanveer, and wanna start to learn python language, i've installed python on my Windows (OS) and set path to it, Now please Guide me which editor is best to use and what instructions should be followed . Best Regards: Tanveeer Ahma

Re: Hello Group and how to practice?

2015-05-31 Thread Cem Karan
On May 31, 2015, at 10:51 AM, Anders Johansen wrote: > Den søndag den 31. maj 2015 kl. 16.22.10 UTC+2 skrev Cem Karan: >> On May 31, 2015, at 9:35 AM, Anders Johansen wrote: >> >>> Hi my name is Anders I am from Denmark, and I am new to programming and >>> python. >>> >>> Currently, I am doi

Re: Hello Group and how to practice?

2015-05-31 Thread Anders Johansen
Den søndag den 31. maj 2015 kl. 16.22.10 UTC+2 skrev Cem Karan: > On May 31, 2015, at 9:35 AM, Anders Johansen wrote: > > > Hi my name is Anders I am from Denmark, and I am new to programming and > > python. > > > > Currently, I am doing the codecademy.com python course, but sometime I feel >

Everything is an object in python - object class and type class

2015-05-31 Thread Eddilbert Macharia
Hello All , I'm wrecking my head trying to understand. where the class object comes into play . Is it only meant to act as base class and does it mean there is an actual class called object in python which all the objects created using the class type inherit ? i'm assuming the metaclass if s

Re: Hello Group and how to practice?

2015-05-31 Thread Cem Karan
On May 31, 2015, at 9:35 AM, Anders Johansen wrote: > Hi my name is Anders I am from Denmark, and I am new to programming and > python. > > Currently, I am doing the codecademy.com python course, but sometime I feel > that the course advances to fast and I lack repeating (practicing) some of

Re: Using Python instead of Bash

2015-05-31 Thread Cem Karan
> I help someone that has problems reading. For this I take photo's of > text, use convert from ImageMagick to make a good contrast (original > paper is grey) and use lpr to print it a little bigger. > > Normally I would implement this in Bash, but I thought it a good idea > to implement it in Pyt

Python Installation

2015-05-31 Thread Kin Zhao
Hello, I had a similar problem as Jim Conyngham (DieInSente) as shown in the link below. Uninstalling from the uninstall exe doesn't actually, fully uninstall the program. It just removes it from the menu and the folder in All Program. You'll have to uninstall with the initial installation exe. T

Re: Using Python instead of Bash

2015-05-31 Thread Alain Ketterlin
Cecil Westerhof writes: > I help someone that has problems reading. For this I take photo's of > text, use convert from ImageMagick to make a good contrast (original > paper is grey) and use lpr to print it a little bigger. > import glob > import subprocess > > treshold = 66 > co

Hello Group and how to practice?

2015-05-31 Thread Anders Johansen
Hi my name is Anders I am from Denmark, and I am new to programming and python. Currently, I am doing the codecademy.com python course, but sometime I feel that the course advances to fast and I lack repeating (practicing) some of the concepts, however I don't feel confident enough to start prog

Using Python instead of Bash

2015-05-31 Thread Cecil Westerhof
I help someone that has problems reading. For this I take photo's of text, use convert from ImageMagick to make a good contrast (original paper is grey) and use lpr to print it a little bigger. Normally I would implement this in Bash, but I thought it a good idea to implement it in Python. This is

Re: Python Paramiko between Linux and Windows Server -- no output obtained from Windows for "dir" or "cd" commands

2015-05-31 Thread Peter Otten
Pythonista wrote: > Hello There: > > I am using Python 2.7.6 and Paramiko module (on a Linux server) to connect > to a Windows server and send some commands and get output. I have a > connect function which takes IP, username and password of the remote > Windows server and I get an sshobj when th

Python Paramiko between Linux and Windows Server -- no output obtained from Windows for "dir" or "cd" commands

2015-05-31 Thread Pythonista
Hello There: I am using Python 2.7.6 and Paramiko module (on a Linux server) to connect to a Windows server and send some commands and get output. I have a connect function which takes IP, username and password of the remote Windows server and I get an sshobj when that happens. How do I use it