Re: [Tutor] Python help

2017-07-23 Thread Cameron Simpson
On 23Jul2017 13:40, Winonah Ojanen wrote: I also tried the correct command for the mac ox s in terminal shell, running: Jims-MacBook-Pro-2:~ Jim$ PYTHONPATH="/Users/Jim/Documents/illustris_python:$PYTHONPATH export PYTHONPATH [...] I did use the pip command and am

Re: [Tutor] Quick Pythonic Style Tips

2017-07-23 Thread Cameron Simpson
On 23Jul2017 19:02, Abdur-Rahmaan Janhangeer wrote: ah pylint yes, great checker ! *some guys thought of inventing it* Yes, very handy. Greate for checking for simple logic errors too (variable used but never bound, missing imports, etc). Just for folks' interest, I

Re: [Tutor] Quick Pythonic Style Tips

2017-07-23 Thread Steven D'Aprano
On Sun, Jul 23, 2017 at 07:02:09PM +0400, Abdur-Rahmaan Janhangeer wrote: > assert(... is liked by some strongly typed programmers Not just strongly-typed programmers: http://import-that.dreamwidth.org/676.html > data encapsulation might be depressing to some migrating coders "Data

Re: [Tutor] Python3 Help

2017-07-23 Thread Alan Gauld via Tutor
On 24/07/17 00:19, Brandon Anderson wrote: > 2. I’m trying to locate the directory path to where Python3 is located on my > system, but when I enter > the following command: > $ type -a python3 You could also try $ which python3 > -bash: $: command not found The $ is

Re: [Tutor] class newbie

2017-07-23 Thread Michael C
thanks! On Sun, Jul 23, 2017 at 5:35 PM, Danny Yoo wrote: > On Sun, Jul 23, 2017 at 1:24 PM, Michael C > wrote: > > class mahschool: > > def print(): > > print('Say something') > > > By the way, you've chosen a name for your

Re: [Tutor] Import Error.

2017-07-23 Thread Steven D'Aprano
On Sun, Jul 23, 2017 at 09:54:09PM +0530, Deepen Patel wrote: > ImportError: No module named cryptography.exceptions > > Currently, I am using virtual environments and in virtual environment this > code not run properly. > previously, I am running code without virtual environments. it works

Re: [Tutor] Python3 Help

2017-07-23 Thread Danny Yoo
> 2. I’m trying to locate the directory path to where Python3 is located on my > system, but when I enter > the following command: > $ type -a python3 > > I get: > -bash: $: command not found Ah. Do not include the leading "$" in the command that you're typing.

Re: [Tutor] class newbie

2017-07-23 Thread Mats Wichmann
On 07/23/2017 02:42 PM, Michael C wrote: > never mind, I forgot to put 'self' in the method definition! class mahschool: def print(self): print('Say something') a = mahschool() a.print() Indeed. The error message was clear on this - but not in a way that's always instructive

Re: [Tutor] class newbie

2017-07-23 Thread Danny Yoo
On Sun, Jul 23, 2017 at 1:24 PM, Michael C wrote: > class mahschool: > def print(): > print('Say something') By the way, you've chosen a name for your method that's spelled the same as the name of the built-in "print" function. I'd recommend you

Re: [Tutor] class newbie

2017-07-23 Thread Michael C
never mind, I forgot to put 'self' in the method definition! class mahschool: def print(self): print('Say something') a = mahschool() a.print() On Sun, Jul 23, 2017 at 1:24 PM, Michael C wrote: > class mahschool: > def print(): >

[Tutor] class newbie

2017-07-23 Thread Michael C
class mahschool: def print(): print('Say something') a = mahschool() a.print() With this, I get this error: Traceback (most recent call last): File "test.py", line 8, in a.print() TypeError: print() takes 0 positional arguments but 1 was given What did I do wrong?

[Tutor] Python3 Help

2017-07-23 Thread Brandon Anderson
Hello! 1. I have Python3 installed on my 2017 MacBook Pro. I know that it is successfully installed because, when I enter “Python3’ into my terminal, I get the following message: Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) [GCC 4.2.1 (Apple Inc.

[Tutor] Fwd: Re: Python Help

2017-07-23 Thread Alan Gauld via Tutor
Forwarding to list Forwarded Message I did use the pip command and am attempting to add the files to my python path. I used import sys sys.path.append("/Users/Jim/Documents/illustris_python") and that worked. I even checked to make sure the files were there import sys

[Tutor] Fwd: Re: Python Help

2017-07-23 Thread Alan Gauld via Tutor
Forwarding to list, please use ReplyAll or ReplyList when responding to the list. Forwarded Message I also tried the correct command for the mac ox s in terminal shell, running: Jims-MacBook-Pro-2:~ Jim$ PYTHONPATH="/Users/Jim/Documents/illustris_python:$PYTHONPATH > export

Re: [Tutor] [Cryptography-dev] Import Error.

2017-07-23 Thread Alex Gaynor
Hi Deepen, Without any more information, it looks like you didn't install cryptography into your virtualenv. How did you install twisted? Alex On Sun, Jul 23, 2017 at 12:24 PM, Deepen Patel wrote: > Hi, > > I got error like Import error. > > Traceback (most

Re: [Tutor] Quick Pythonic Style Tips

2017-07-23 Thread Abdur-Rahmaan Janhangeer
Thanks everybody, i wanted to get some pythonic ideas. yes forgot that assert(... is liked by some strongly typed programmers anInt -> did not not some people liked tha data encapsulation might be depressing to some migrating coders ah pylint yes, great checker ! *some guys thought of

[Tutor] Best OpenCV tutorials

2017-07-23 Thread Abdur-Rahmaan Janhangeer
The last python issue i'd like to resolve is the OpenCV issue I just want some nice opencv tutorials apart from the official docs also, some nice algos if any apart from Haar Cascades with examples. P.s. This is a 3rd party lib, so, some links is fine ! Abdur-Rahmaan Janhangeer, Mauritius

[Tutor] Import Error.

2017-07-23 Thread Deepen Patel
Hi, I got error like Import error. Traceback (most recent call last): File "startnode.py", line 8, in from twisted.conch import manhole, manhole_ssh File "/usr/local/lib/python2.7/dist-packages/twisted/conch/manhole_ssh.py", line 14, in from twisted.conch.ssh import factory,

Re: [Tutor] Import Error.

2017-07-23 Thread Peter Otten
Deepen Patel wrote: > Hi, > > I got error like Import error. > > Traceback (most recent call last): > File "startnode.py", line 8, in > from twisted.conch import manhole, manhole_ssh > File > "/usr/local/lib/python2.7/dist-packages/twisted/conch/manhole_ssh.py", > line 14, in >

Re: [Tutor] new to python

2017-07-23 Thread Mats Wichmann
On 07/23/2017 09:16 AM, Alex Kleider wrote: > On 2017-07-23 01:06, Anish Tambe wrote: >>> for line in file: >> >> This line is not required as the you have opened your file to 'f'. >> 'file' is a built-in class. Type - >> help(file) >> on the interpreter to know more about it. > > This appears to

Re: [Tutor] new to python

2017-07-23 Thread Alex Kleider
On 2017-07-23 01:06, Anish Tambe wrote: for line in file: This line is not required as the you have opened your file to 'f'. 'file' is a built-in class. Type - help(file) on the interpreter to know more about it. This appears to be true in python2x but not in python3: alex@X301n3:~$ python3

Re: [Tutor] new to python

2017-07-23 Thread Peter Otten
N6Ghost wrote: > C:\coderoot\python3\level1>python > Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit > (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > > /windows 10 x64 > > new to python, but not really new to programming. >

Re: [Tutor] new to python

2017-07-23 Thread Anish Tambe
> for line in file: This line is not required as the you have opened your file to 'f'. 'file' is a built-in class. Type - help(file) on the interpreter to know more about it. > for line in f: > print(line.rstripe()) > f.close() Are you sure that you need to close the file

Re: [Tutor] new to python

2017-07-23 Thread Alan Gauld via Tutor
On 23/07/17 07:26, N6Ghost wrote: > > f = open("C:\coderoot\python3\level1\inputfile.txt", 'r') > for line in file: Note that you have no variable called 'file'. So this line doesn't make sense. > for line in f: > print(line.rstripe()) This bit will work if you omit the line

[Tutor] new to python

2017-07-23 Thread N6Ghost
C:\coderoot\python3\level1>python Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. /windows 10 x64 new to python, but not really new to programming. going through the beginners