Re: [Tutor] sort() method and non-ASCII

2017-02-06 Thread boB Stepp
On Sun, Feb 5, 2017 at 10:49 PM, Cameron Simpson  wrote:
> On 05Feb2017 22:27, boB Stepp  wrote:
>>
>> On Sun, Feb 5, 2017 at 7:23 PM, Steven D'Aprano 
>> wrote:
>>>
>>> Alternatively, you can embed it right in the string. For code points
>>> between U+ and U+, use the \u escape, and for the rest, use \U
>>> escapes:
>>>
>>> py> 'pi = \u03C0'  # requires exactly four hex digits
>>> 'pi = π'
>>>
>>> py> 'pi = \U03C0'  # requires exactly eight hex digits
>>> 'pi = π'
>>>
>>>
>>> Lastly, you can use the code point's name:
>>>
>>> py> 'pi = \N{GREEK SMALL LETTER PI}'
>>> 'pi = π'
>>
>>
>> You have surprised me here by using single quotes to enclose the
>> entire assignment statements.  I thought this would throw a syntax
>> error, but it works just like you show.  What is going on here?
>
>
> It's not an assignment statement. It's just a string. He's typing a string
> containing a \N{...} sequence and Python's printing that string back at you;
> pi's a printable character and gets displayed directly.

I just came out of the shower this morning thinking, "Stupid boB,
stupid.  That's just an escape sequence inside an overall string, not
an assignment statement."  Duh!  My brain works better asleep than
awake...

boB
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Function annotations

2017-02-06 Thread George Fischhof
2017-02-05 9:36 GMT+01:00 Steven D'Aprano :

> On Sat, Feb 04, 2017 at 10:11:39PM -0600, boB Stepp wrote:
>
> > Are the people making linters implementing checking function
> > annotations?  Or is this something only gradually being adopted?
>
> Depends which linter :-)
>
> MyPy is still the reference implementation for type hinting in Python:
>
> http://mypy-lang.org/
>
> As for pychecker, pylint, jedi, pyflakes, etc you'll have to check with
> the individual application itself.
>
> > Steve, are you making use of function annotations?  If yes, are you
> > finding them worth the extra effort?
>
> Not yet.
>
>
> --
> Steve
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>



Hi,

Pycharm ide has a built-in linter, and it is very good!  It shows the
result in code writing time.

George
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] sort() method and non-ASCII

2017-02-06 Thread Alan Gauld via Tutor
On 06/02/17 12:13, boB Stepp wrote:
 py> 'pi = \N{GREEK SMALL LETTER PI}'
 'pi = π'
>>>
>>>
>>> You have surprised me here by using single quotes to enclose the
>>> entire assignment statements.  I thought this would throw a syntax
>>> error, but it works just like you show.  What is going on here?

> I just came out of the shower this morning thinking, "Stupid boB,
> stupid.  That's just an escape sequence inside an overall string, not
> an assignment statement."  Duh!  My brain works better asleep than
> awake...

To be fair it did look like an assignment so when I first
saw it I too went "huh?!". But then I looked again and
figured it out. :-)

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Multiple tabs using tkinter

2017-02-06 Thread Pooja Bhalode
Hi,

I was wondering if someone could help me regarding multiple tabs in
tkinter.
I am working on a GUI which would have tabs similar to the ones we see in
excel, wherein we can navigate from one tab to the other and back. Could
you please direct me towards some information regarding how I should
proceed with this issue.
It would be a great help.

Also, I was wondering if there is a way in tkinter to create an explorer
bar that we see in finder in OS Mac or windows. I found a way to do that
using wxpython, but was wondering if there is a way using tkinter.
Please let me know. It would help me a lot. Would appreciate any help.
thank you

Pooja
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Basic Tutorial for Python

2017-02-06 Thread Hüseyin Ertuğrul
Hello all,
I am a system engineer and I want to learn python language. I don't know any 
program language and I need tutorial for beginner or for dummies.
By the way I want to see basic example codes for practice.

What is your suggestion for that case.

Thank you for your interest.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Basic Tutorial for Python

2017-02-06 Thread Larocca, John B
I like this one...
https://learnpythonthehardway.org/book/
It can be done all online

-John

-Original Message-
From: Tutor [mailto:tutor-bounces+john.b.larocca=intel@python.org] On 
Behalf Of Hüseyin Ertugrul
Sent: Monday, February 06, 2017 8:14 AM
To: tutor@python.org
Subject: [Tutor] Basic Tutorial for Python

Hello all,
I am a system engineer and I want to learn python language. I don't know any 
program language and I need tutorial for beginner or for dummies.
By the way I want to see basic example codes for practice.

What is your suggestion for that case.

Thank you for your interest.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Basic Tutorial for Python

2017-02-06 Thread Steven D'Aprano
On Mon, Feb 06, 2017 at 04:13:35PM +, Hüseyin Ertuğrul wrote:

> Hello all,

> I am a system engineer and I want to learn python language. I don't 
> know any program language and I need tutorial for beginner or for 
> dummies.

Alan's tutorial is worth working through:

http://www.alan-g.me.uk/

You can also look at the official tutorials. For version 2.7:

https://docs.python.org/2/tutorial/

For version 3:

https://docs.python.org/3/tutorial/


More resources here:

https://wiki.python.org/moin/BeginnersGuide/NonProgrammers


-- 
Steve
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Basic Tutorial for Python

2017-02-06 Thread Alex Kleider

On 2017-02-06 08:13, Hüseyin Ertuğrul wrote:

Hello all,
I am a system engineer and I want to learn python language. I don't
know any program language and I need tutorial for beginner or for
dummies.
By the way I want to see basic example codes for practice.

What is your suggestion for that case.


Allen B. Downey's book served me very well when I first got interested 
in Python; he's now got a Python 3 version as well.
It's available free on the web, or you can buy the book on Amazon and 
elsewhere.

http://greenteapress.com/wp/think-python/
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Multiple tabs using tkinter

2017-02-06 Thread Alan Gauld via Tutor
On 06/02/17 16:40, Pooja Bhalode wrote:

> I was wondering if someone could help me regarding multiple tabs in
> tkinter.

Look at the tabbed notebook in the Tix module.
It should do what you want.

I give a tutorial on its use in my recent book but you can
also find online tutorials, especially in Tcl (Python ones
are much harder to find)

> Also, I was wondering if there is a way in tkinter to create an explorer
> bar that we see in finder in OS Mac or windows. I found a way to do that
> using wxpython, but was wondering if there is a way using tkinter.

Tkinter is a relatively low level GUI toolkit. You can
build most things but you have to start with the basic
widgets. So an explorer bar is just an Entry widget to
which you can attach any functionality you care to create.

The same applies to Status bars. In Tkinter its just a
label in a frame that you have to update in your code.
In other tookits there are status bar widgets that other
widgets know how to use with just a reference.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Basic Tutorial for Python

2017-02-06 Thread Alan Gauld via Tutor
On 06/02/17 16:13, Hüseyin Ertuğrul wrote:
> Hello all,
> I am a system engineer and I want to learn python language. 
> I don't know any program language

That's a common request and the python.org site has a whole page
dedicated to folks like you.

https://wiki.python.org/moin/BeginnersGuide/NonProgrammers

It lists many tutorials (including mine below)and they all
do the job. It just depends on what kind of style you prefer.
(Some aim at leisure users with emphasis on games etc, others
are targeted at more serious users and focus on, say,
sysadmin type tasks, some are more academically correct,
others easier to read but less rigorous). Try a couple and
go with whatever looks most to your taste.

If (when!) you get stuck or puzzled ask questions here.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Multiple tabs using tkinter

2017-02-06 Thread Zachary Ware
On Mon, Feb 6, 2017 at 7:31 PM, Alan Gauld via Tutor  wrote:
> On 06/02/17 16:40, Pooja Bhalode wrote:
>
>> I was wondering if someone could help me regarding multiple tabs in
>> tkinter.
>
> Look at the tabbed notebook in the Tix module.
> It should do what you want.

ttk rather than Tix; Tix is unmaintained and soft-deprecated in 3.6+.
ttk provides most of the useful parts of Tix, is maintained as part of
Tk, and also looks significantly more native than classic Tk or Tix.
Tix is also less available on platforms other than Windows, whereas
ttk is present in any Tk 8.5 or greater.

> I give a tutorial on its use in my recent book but you can
> also find online tutorials, especially in Tcl (Python ones
> are much harder to find)
>
>> Also, I was wondering if there is a way in tkinter to create an explorer
>> bar that we see in finder in OS Mac or windows. I found a way to do that
>> using wxpython, but was wondering if there is a way using tkinter.
>
> Tkinter is a relatively low level GUI toolkit. You can
> build most things but you have to start with the basic
> widgets. So an explorer bar is just an Entry widget to
> which you can attach any functionality you care to create.

Also have a look at ttk.Combobox, which combines an Entry and Listbox
(and, I think, if the list is long enough, a Scrollbar) into a
drop-down menu widget.

-- 
Zach
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor