Re: How to import a function from another module...

2015-08-03 Thread Steven D'Aprano
On Tue, 4 Aug 2015 09:57 am, Dwight GoldWinde wrote: > I am trying to import a function defined in another module. You can't use spaces in the name of importable Python modules: change the name from "Simulate typing.py" to "simulate_python.py". You can use spaces in file names if they are only us

How to import a function from another module...

2015-08-03 Thread Dwight GoldWinde
I am trying to import a function defined in another module. The code is this: name = 'Jim' sex = 'm' coach = 'Dwight' import importlib sentence = 'Hi, there, ' + name + '. My name is ' + coach + '. I will be your coach today.' importlib.import_module ('humprint', 'Macintosh HD/Users/dwightgoldwin

Re: I'm a newbie and I'm stumped...

2015-08-03 Thread josephbigler
On Saturday, August 1, 2015 at 11:59:14 AM UTC-4, Dwight GoldWinde wrote: > Please help. > > > I am running Python 3.4 on my Mac mini, OS X 10.10.2, using Coderunner 2 as > my editor. > > > Here's the code: > > #!/usr/bin/env python3 > word = (input('Enter a word ')) > > > When running this

Re: Usage of P(C)ython Logo for Coffee Mug

2015-08-03 Thread deus ex
Ok great thanks for help, so for non-commercial use it looks ok! Dex 2015-07-29 21:36 GMT+02:00 Zachary Ware : > On Wed, Jul 29, 2015 at 2:01 PM, Terry Reedy wrote: > > On 7/29/2015 11:55 AM, Laura Creighton wrote: > >> We have SVG versions here: > >> https://www.python.org/community/logos/ > >

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-03 Thread Larry Hudson via Python-list
On 08/02/2015 01:58 PM, Joonas Liik wrote: I have this feeling that you would get a lot more useful anwsers if you were to describe your actual problem in stead of what you think the solution is. There might be other, better solutions but since we know so little about what you are doing we will l

Re: how to determine for using c extension or not ?

2015-08-03 Thread Terry Reedy
On 8/3/2015 9:08 AM, umedoblock wrote: Posting three times under two different names is not polite. Please to not repeat. I use bisect module. bisect module developer give us c extension as _bisect. We call that a C accelerator. If Python3.3 use _bisect, _bisect override his functions i

Re: Parsing multipart HTTP response

2015-08-03 Thread Gilles Lenfant
Le lundi 3 août 2015 17:39:57 UTC+2, Mark Lawrence a écrit : > On 03/08/2015 16:01, Gilles Lenfant wrote: > > Hi, > > > > I searched without succeeding a Python resource that is capable of parsing > > an HTTP multipart/mixed response stream, preferably as a generator that > > yields headers + con

Re: Python 3 May Become Relevant Now

2015-08-03 Thread Chris Angelico
On Tue, Aug 4, 2015 at 1:42 AM, Rick Johnson wrote: > On Sunday, August 2, 2015 at 9:45:51 PM UTC-5, Chris Angelico wrote: >> How do you know it was written today, if you didn't click it? > > Because i possess skills you can hardly fathom. There are always > loopholes; back doors; knot holes; key

Re: how to determine for using c extension or not ?

2015-08-03 Thread Marco Buttu
On 03/08/2015 15:30, Skip Montanaro wrote: id() tells you nothing about the nature of the function. Use the inspect.isbuiltin(): ... It's perhaps a bit poorly named, but "builtin" functions are those not written in Python. That is, those written in C or C++. I think in the documentation there i

Re: Python 3 May Become Relevant Now

2015-08-03 Thread Rick Johnson
On Sunday, August 2, 2015 at 9:45:51 PM UTC-5, Chris Angelico wrote: > How do you know it was written today, if you didn't click it? Because i possess skills you can hardly fathom. There are always loopholes; back doors; knot holes; key holes; cracks; crevices; tells; Freudian slips; little white

Re: Parsing multipart HTTP response

2015-08-03 Thread Mark Lawrence
On 03/08/2015 16:01, Gilles Lenfant wrote: Hi, I searched without succeeding a Python resource that is capable of parsing an HTTP multipart/mixed response stream, preferably as a generator that yields headers + content for each part. Google and friends didn't find or I didn't use the appropri

Re: Parsing multipart HTTP response

2015-08-03 Thread Gilles Lenfant
Le lundi 3 août 2015 17:01:40 UTC+2, Gilles Lenfant a écrit : > Hi, > > I searched without succeeding a Python resource that is capable of parsing an > HTTP multipart/mixed response stream, preferably as a generator that yields > headers + content for each part. > > Google and friends didn't fi

Parsing multipart HTTP response

2015-08-03 Thread Gilles Lenfant
Hi, I searched without succeeding a Python resource that is capable of parsing an HTTP multipart/mixed response stream, preferably as a generator that yields headers + content for each part. Google and friends didn't find or I didn't use the appropriate term. Any hint will be appreciated. -- G

Re: how to determine for using c extension or not ?

2015-08-03 Thread Oscar Benjamin
On Mon, 3 Aug 2015 at 15:58 umedoblock wrote: > > I use "bisect.bisect.__module__" sentence to determine for using c > extension or not. > > Why do you want to know if it uses the C extension? It shouldn't really matter. -- Oscar -- https://mail.python.org/mailman/listinfo/python-list

Re: how to determine for using c extension or not ?

2015-08-03 Thread umedoblock
normal, no change >>> import bisect >>> bisect.bisect.__module__ '_bisect' I change from "from _bisect import *" to "pass" in bisect.py >>> import bisect >>> bisect.bisect.__module__ 'bisect' bisect.bisect.__module__ return different results. they are '_bisect' and 'bisect'. I know that c exte

Re: Most Pythonic way to store (small) configuration

2015-08-03 Thread Mark Lawrence
On 03/08/2015 14:38, Steven D'Aprano wrote: On Mon, 3 Aug 2015 02:02 pm, Dan Sommers wrote: Well, I have at least some non-zero chance of reading and writing JSON or XML by hand. Can the same be said for a sqlite database? Real programmers edit their SQL databases directly on the hard drive

Re: Optimal solution for coloring logging output

2015-08-03 Thread Mark Lawrence
On 03/08/2015 10:13, c.bu...@posteo.jp wrote: I don't want to ask how to do this because there are so many "solutions" about it. There are so much different and part of unpythontic solutions I can not decide myself

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-03 Thread Mark Lawrence
On 02/08/2015 21:58, Joonas Liik wrote: I have this feeling that you would get a lot more useful anwsers if you were to describe your actual problem in stead of what you think the solution is. There might be other, better solutions but since we know so little about what you are doing we will like

Re: how to determine for using c extension or not ?

2015-08-03 Thread Joel Goldstick
On Mon, Aug 3, 2015 at 10:01 AM, umedoblock wrote: > sorry, Joel, Skip, Steven, and python-list members. > > I think that I don't sent my mail to python-list@python.org or I don't have > correct mail setting. > > so I send many mails. > > sorry... I should wait a day to get answer, sorry. > > > On

Re: how to determine for using c extension or not ?

2015-08-03 Thread umedoblock
sorry, Joel, Skip, Steven, and python-list members. I think that I don't sent my mail to python-list@python.org or I don't have correct mail setting. so I send many mails. sorry... I should wait a day to get answer, sorry. On 2015年08月03日 22:36, Steven D'Aprano wrote: On Mon, 3 Aug 2015 03:4

Re: Most Pythonic way to store (small) configuration

2015-08-03 Thread Chris Angelico
On Mon, Aug 3, 2015 at 11:38 PM, Steven D'Aprano wrote: > On Mon, 3 Aug 2015 02:02 pm, Dan Sommers wrote: > >> Well, I have at least some non-zero chance of reading and writing JSON >> or XML by hand. Can the same be said for a sqlite database? > > > Real programmers edit their SQL databases dire

Re: Most Pythonic way to store (small) configuration

2015-08-03 Thread Steven D'Aprano
On Mon, 3 Aug 2015 02:02 pm, Dan Sommers wrote: > Well, I have at least some non-zero chance of reading and writing JSON > or XML by hand.  Can the same be said for a sqlite database? Real programmers edit their SQL databases directly on the hard drive platter using a magnetised needle and a ste

Re: how to determine for using c extension or not ?

2015-08-03 Thread Steven D'Aprano
On Mon, 3 Aug 2015 03:47 pm, umedoblock wrote: > Hello everyone. > > I use bisect module. You asked the same question FOUR times. Have patience. Your question goes all over the world, people may be asleep, or working, or just not know the answer. If you ask a question, and get no answers, you sh

Re: how to determine for using c extension or not ?

2015-08-03 Thread Skip Montanaro
id() tells you nothing about the nature of the function. Use the inspect.isbuiltin(): >>> import bisect >>> bisect.bisect >>> import inspect >>> def foo(): pass ... >>> inspect.isbuiltin(foo) False >>> inspect.isbuiltin(bisect.bisect) True It's perhaps a b

Re: how to determine for using c extension or not ?

2015-08-03 Thread Joel Goldstick
On Mon, Aug 3, 2015 at 9:08 AM, umedoblock wrote: > Hello everyone. > > I use bisect module. > bisect module developer give us c extension as _bisect. > > If Python3.3 use _bisect, _bisect override his functions in bisect.py. > > now, I use id() function to determine for using c extension or not.

how to determine for using c extension or not ?

2015-08-03 Thread umedoblock
Hello everyone. I use bisect module. bisect module developer give us c extension as _bisect. If Python3.3 use _bisect, _bisect override his functions in bisect.py. now, I use id() function to determine for using c extension or not. >>> import bisect >>> id(bisect.bisect) 139679893708880 >>> imp

Re: Optimal solution for coloring logging output

2015-08-03 Thread Karim
On 03/08/2015 14:47, Jean-Michel Pichavant wrote: te a logging Formatter that will re Thank you Jean-Michel useful example K -- https://mail.python.org/mailman/listinfo/python-list

Re: Optimal solution for coloring logging output

2015-08-03 Thread Jean-Michel Pichavant
Original Message - > From: "c buhtz" > To: python-list@python.org > Sent: Monday, 3 August, 2015 11:13:37 AM > Subject: Optimal solution for coloring logging output > > I don't want to ask how to do this because there are so many > "solutions" about it. >

how to determine for using c extension or not ?

2015-08-03 Thread Hideyuki YASUDA
Hello everyone. I use bisect module. bisect module developer give us c extension as _bisect. If Python3.3 use _bisect, _bisect override his functions in bisect.py. now, I use id() function to determine for using c extension or not. >>> import bisect >>> id(bisect.bisect) 139679893708880 >>> imp

how to determine for using c extension or not ?

2015-08-03 Thread umedoblock
Hello everyone. I use bisect module. bisect module developer give us c extension as _bisect. If Python3.3 use _bisect, _bisect override his functions in bisect.py. now, I use id() function to determine for using c extension or not. >>> >>> import bisect >>> >>> id(bisect.bisect) 139679893708880

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-03 Thread Joonas Liik
I have this feeling that you would get a lot more useful anwsers if you were to describe your actual problem in stead of what you think the solution is. There might be other, better solutions but since we know so little about what you are doing we will likely never find them by just guessing.. --

FW: I'm a newbie and I'm still stumped...

2015-08-03 Thread Dwight Hotmail
On 8/3/15, 4:07 PM, "Dwight GoldWinde" wrote: >Thank you, Paul. > >But does this mean I am not using Python 3.4? > >BIG SMILE... > >Always, Dwight > > >www.3forliving.key.to (video playlist on YouTube) >www.couragebooks.key.to (all my books on Amazon) > > > > > > >On 8/3/15, 3:14 PM, "Paul Rubin"

Re: I'm a newbie and you helped me find the answer...

2015-08-03 Thread Dwight Hotmail
Thank you, Jussi. Problem finally solved. I am using Coderunner 2 as my editor. It has a language setting. I had set it as Python instead of Python 3. Duh! Thank you again, everyone! With appreciation, Dwight dwi...@goldwinde.com www.goldwinde.com Author of the book, "Courage: the Choice t

Optimal solution for coloring logging output

2015-08-03 Thread c.buhtz
I don't want to ask how to do this because there are so many "solutions" about it. There are so much different and part of unpythontic solutions I can not decide myself. What do you (as real pythontics) think about t

Re: Python 3 May Become Relevant Now

2015-08-03 Thread Chris Angelico
On Mon, Aug 3, 2015 at 7:58 PM, Jean-Michel Pichavant wrote: > But if I get things right, with python 3.5 type hint checker, I'd be screwed, > as it is spefificaly designed to track this kind of "problem". > What's the use of None then ? Any method returning None can only return None > or suffer

Re: Python 3 May Become Relevant Now

2015-08-03 Thread Ian Kelly
On Mon, Aug 3, 2015 at 1:58 AM, Jean-Michel Pichavant wrote: > But if I get things right, with python 3.5 type hint checker, I'd be screwed, > as it is spefificaly designed to track this kind of "problem". > What's the use of None then ? Any method returning None can only return None > or suffer

Re: Python 3 May Become Relevant Now

2015-08-03 Thread Jean-Michel Pichavant
- Original Message - > From: "Mark Lawrence" > To: python-list@python.org > Sent: Monday, 3 August, 2015 2:25:08 AM > Subject: Python 3 May Become Relevant Now > > rr should have a field day with this one > http://nafiulis.me/python-3-may-become-relevant-now.html > > -- > My fellow Pytho

Re: I'm a newbie and I'm still stumped...

2015-08-03 Thread Jussi Piitulainen
Dwight GoldWinde quotes himself: > >> Okay, thank you, Dave, so I got the following info: type $(which >> python3) >> /Library/Frameworks/Python.framework/Versions/3.4/bin/python3 is >> /Library/Frameworks/Python.framework/Versions/3.4/bin/python3 >> >> But I can¹t figure out what short of ³usr² st

Re: I'm a newbie and I'm still stumped...

2015-08-03 Thread Dwight GoldWinde
On 8/3/15, 4:55 PM, "Dwight GoldWinde" wrote: >Okay, thank you, Dave, so I got the following info: >type $(which python3) >/Library/Frameworks/Python.framework/Versions/3.4/bin/python3 is >/Library/Frameworks/Python.framework/Versions/3.4/bin/python3 > > >But I can¹t figure out what short of ³u

Re: I'm a newbie and I'm still stumped...

2015-08-03 Thread Dave Farrance
Dwight GoldWinde wrote: >Here are the results I got below, showing the same error. The first line >says, >"2.7.6 (default, Sep 9 2014, 15:04:36)”. Does that mean I am running the >old Python? How could that be since I am SURE I downloaded 3.4.3 (it even >gives the folder name as “Python 3.4” in

Re: I'm a newbie and I'm still stumped...

2015-08-03 Thread Paul Rubin
Dwight GoldWinde writes: > word = input('Enter a word ') Use raw_input instead of input. In python 2.x, input treats the stuff you enter as a Python expression instead of a string. -- https://mail.python.org/mailman/listinfo/python-list

Re: I'm a newbie and I'm still stumped...

2015-08-03 Thread Dwight GoldWinde
Thank you, Emile, Paul, Terry, and Joel for your suggestions! And the error persists. Maybe my error is coming from running the old version (2.7.6) of Python, but I can’t figure out why that would be happening??? I downloaded 3.4.3 again from the Python.org website for my Mac. I inserted the "imp