Based on the input from members, and my subsequent reading the
textbook/tutorials, let
me summarize my understanding of "why subsequent imports of same module are
designed to be effect-less".
1. Imports are costly affair, as it involves
- finding the module's file
- compile it to byte code (if
>From the discussions in this thread, I get the impression that there are
>genuine
requirements to reload() a module during a program's execution.
It is fairly easy to see reload() in context of interactive execution, but how
does it
come into picture in case of non-interactive Python program ex
Am 06.03.16 um 06:53 schrieb Wildman:
On Sat, 05 Mar 2016 19:36:19 +0100, Christian Gollwitzer wrote:
import Tkinter
from Tkinter import Tk
root = Tk()
img = Tkinter.Image("photo", file="appicon.gif")
root.call('wm','iconphoto',root._w,img)
The above worked perfectly. Thank you very much.
T
Am 05.03.16 um 22:16 schrieb Terry Reedy:
Not now. A console is a REPL + text display to read from and print to.
The actual IDLE REPL is PyShell.ModifiedInterpreter, which subclasses
stdlib code.InteractiveInterpreter. Most of the additions are for
interacting with the subprocess that runs user
How come all graphs using 42 links and more then 84 nodes have compact regular
connected solutions?
Did turn off animation for more than a couple of thousands of links so the
animation is off when searching but script give message and numerical results
on search.
http://jt.node365.se/nodes15
On 06/03/2016 10:39, jonas.thornv...@gmail.com wrote:
How come all graphs using 42 links and more then 84 nodes have compact regular
connected solutions?
Did turn off animation for more than a couple of thousands of links so the
animation is off when searching but script give message and num
Den söndag 6 mars 2016 kl. 12:01:02 UTC+1 skrev Mark Lawrence:
> On 06/03/2016 10:39, jonas.thornv...@gmail.com wrote:
> > How come all graphs using 42 links and more then 84 nodes have compact
> > regular connected solutions?
> >
> > Did turn off animation for more than a couple of thousands of
On 06/03/2016 11:04, jonas.thornv...@gmail.com wrote:
Den söndag 6 mars 2016 kl. 12:01:02 UTC+1 skrev Mark Lawrence:
On 06/03/2016 10:39, jonas.thornv...@gmail.com wrote:
How come all graphs using 42 links and more then 84 nodes have compact regular
connected solutions?
Did turn off animatio
Hi, I've been experimenting with a short test program under python 2.7
and python 3.4.2. It's a simple read from file, and locate a word therein.
I get the (subjective) impression that python2 is slightly faster than
python3. Is that correct? Is there any documentation to support this?
Thank
On 3/6/2016 4:23 AM, Christian Gollwitzer wrote:
Am 05.03.16 um 22:16 schrieb Terry Reedy:
Not now. A console is a REPL + text display to read from and print to.
The actual IDLE REPL is PyShell.ModifiedInterpreter, which subclasses
stdlib code.InteractiveInterpreter. Most of the additions are f
On 3/6/2016 6:34 AM, Tony van der Hoff wrote:
Hi, I've been experimenting with a short test program under python 2.7
and python 3.4.2. It's a simple read from file, and locate a word therein.
I get the (subjective) impression that python2 is slightly faster than
python3. Is that correct? Is the
Hello list,
I am following "Learning Python: Mark Lutz" and came across following in
chapter 3
few days back.
[quote]
* You may still have to reload nested modules. Technically speaking, IDLE's
Run->Run Module menu option always runs the current version of the top-level
file
only; imported
Tony van der Hoff wrote:
> Hi, I've been experimenting with a short test program under python 2.7
> and python 3.4.2.
Ideally you would provide the source.
> It's a simple read from file, and locate a word therein.
Do both runs operate on the same kind of string (either bytestring or
unicode)
Hi python-list, hi Srinivas,
I managed to implement the mark&sweep approach for fast removal from
heaps. This way, I got three pleasant results:
1) a substantial speed up!
2) an improved testsuite
3) discovery and fixing of several bugs
@Srinivas I would be honored if you could have a look at
On Saturday 05 March 2016 10:46:04 Thomas 'PointedEars' Lahn wrote:
> Gene Heskett wrote:
> > I've never heard of a massless photon,
>
> That is unfortunate as it should be common knowledge by now.
>
> > and they do exert a push on the surface they are reflected from, […]
>
> Photons exert a force
Hello! I have a question in an exercise that says : Write an expression to
determine whether a person should or should not pay tax . Consider paying tax
people whose salary is greater than R $ 1,200.00
I do not know how to mount the logical expression !!!
It's like:
salary = 1250
tax = Not Tru
I cant figure out how to get to the program so I can write code. started and
introductory programming class for college and im unable to figure out how to
open this program on my computer. please help if you can, your time would be
much appreciate.
Sent from Windows Mail
--
https://mail.p
when I am installing Python 3.5.1 (32-bit)??some problems occurred.I hope you
could offer me some help.This file may contain some information about the error.
--
https://mail.python.org/mailman/listinfo/python-list
Gud afternoon sir my self Roshan sontakke I have down loaded a setup of
python-3.5.1 but nt able to install it gives an error message
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, 6 Mar 2016 10:34 pm, Tony van der Hoff wrote:
> Hi, I've been experimenting with a short test program under python 2.7
> and python 3.4.2. It's a simple read from file, and locate a word therein.
>
> I get the (subjective) impression that python2 is slightly faster than
> python3. Is tha
In <1ed89545-f102-4538-bfe2-9d0e3dac8...@googlegroups.com>
=?UTF-8?B?w5ZtZXIgc2FyxLE=?= writes:
> l want program if username is not registered, register first,
> then store it, and l want program ask for some specific characters,
> like 1,2,3../,%.
What is your process for finding out if a nam
On Sun, 6 Mar 2016 04:32 pm, 程仿 wrote:
> when I am installing Python 3.5.1 (32-bit),some problems occurred.I hope
> you could offer me some help.This file may contain some information about
> the error.
What file?
Please COPY AND PASTE the text of the error message into your email.
--
Steven
On Sun, 6 Mar 2016 07:20 pm, alien2u...@gmail.com wrote:
> Based on the input from members, and my subsequent reading the
> textbook/tutorials, let me summarize my understanding of "why subsequent
> imports of same module are designed to be effect-less".
That is not correct. Imports are not a no-
On Sun, 6 Mar 2016 05:35 pm, Roshan S Sontakke wrote:
> Gud afternoon sir my self Roshan sontakke I have down loaded a setup of
> python-3.5.1 but nt able to install it gives an error message
Shall we guess what the error message says, or would you like to tell us?
--
Steven
--
https://mail
5 Mart 2016 Cumartesi 23:52:58 UTC+2 tarihinde Ömer sarı yazdı:
> hi , all , l m fresh user and l m trying to learn python by doing practice
> but l got stuck in that , l need help , l m a beginner and l learn some
> basic things so far so, plz take in consideration that before command .
>
> he
On Sunday, March 6, 2016 at 3:16:19 PM UTC+1, Diego ... wrote:
> Hello! I have a question in an exercise that says : Write an expression to
> determine whether a person should or should not pay tax . Consider paying tax
> people whose salary is greater than R $ 1,200.00
>
> I do not know how to
On 06/03/2016 15:28, marco.naw...@colosso.nl wrote:
On Sunday, March 6, 2016 at 3:16:19 PM UTC+1, Diego ... wrote:
Hello! I have a question in an exercise that says : Write an expression to
determine whether a person should or should not pay tax . Consider paying tax
people whose salary is gre
On 02/22/2016 09:32 AM, Klaus Jantzen wrote:
On 02/21/2016 10:37 PM, Albert-Jan Roskam wrote:
(Sorry for top posting)
IIRC, you have to do
sudo apt-get install build-essential python-dev
... then re-compile python
> To: [[1]1]python-list@python.org
> F
On Sun, 06 Mar 2016 10:16:55 +0100, Christian Gollwitzer wrote:
> Am 06.03.16 um 06:53 schrieb Wildman:
>> On Sat, 05 Mar 2016 19:36:19 +0100, Christian Gollwitzer wrote:
>>> import Tkinter
>>> from Tkinter import Tk
>>> root = Tk()
>>> img = Tkinter.Image("photo", file="appicon.gif")
>>> root.cal
On 2016-03-06, Steven D'Aprano wrote:
> On Sun, 6 Mar 2016 05:35 pm, Roshan S Sontakke wrote:
>
>> Gud afternoon sir my self Roshan sontakke I have down loaded a setup of
>> python-3.5.1 but nt able to install it gives an error message
>
> Shall we guess what the error message says, or would you l
On 04/03/2016 23:26, kyleolson1...@gmail.com wrote:
I cant figure out how to get to the program so I can write code. started and
introductory programming class for college and im unable to figure out how to
open this program on my computer. please help if you can, your time would be
much appre
On 06/03/2016 05:32, wrote:
when I am installing Python 3.5.1 (32-bit)??some problems occurred.I hope you
could offer me some help.This file may contain some information about the error.
This type of question has been asked and answered repeatedly over the
last few months, so please sea
On 06/03/2016 06:35, Roshan S Sontakke wrote:
Gud afternoon sir my self Roshan sontakke I have down loaded a setup of
python-3.5.1 but nt able to install it gives an error message
Please read this http://www.catb.org/esr/faqs/smart-questions.html and
then have a go at providing us with the d
On 05/03/2016 15:41, Diego ... wrote:
Hello! I have a question in an exercise that says : Write an expression to
determine whether a person should or should not pay tax . Consider paying tax
people whose salary is greater than R $ 1,200.00
I do not know how to mount the logical expression !!!
On 06/03/2016 15:28, marco.naw...@colosso.nl wrote:
On Sunday, March 6, 2016 at 3:16:19 PM UTC+1, Diego ... wrote:
Hello! I have a question in an exercise that says : Write an expression to
determine whether a person should or should not pay tax . Consider paying tax
people whose salary is gre
On Sun, Mar 6, 2016 at 10:05 AM, Mark Lawrence wrote:
> Why in the year 2016 are people still giving links to the Luddite Python 2
> docs?
Maybe because it's the version that comes up when googling for "python
if statement".
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
what's the reason that reversed(zip(...)) raises as a TypeError?
Would allowing reversed to handle zip and related functions lead to
strange errors?
Best,
Sven
--
https://mail.python.org/mailman/listinfo/python-list
On 2016-03-06 19:29, Sven R. Kunze wrote:
> what's the reason that reversed(zip(...)) raises as a TypeError?
>
> Would allowing reversed to handle zip and related functions lead to
> strange errors?
Peculiar, as this works in 2.x but falls over in 3.x:
$ python
Python 2.7.9 (default, Mar 1 201
(Sorry for top-posting)
No TypeError here:
Python 2.7.2 (default, Nov 2 2015, 01:07:37) [GCC 4.9 20140827 (prerelease)]
on linux4
Type "help", "copyright", "credits" or "license" for more information.
>>> ten = range(10)
>>> reversed(zip(ten, ten))
>>> list(reversed(zip(ten, ten)))
[(9, 9), (
Sven R. Kunze wrote:
> what's the reason that reversed(zip(...)) raises as a TypeError?
>
> Would allowing reversed to handle zip and related functions lead to
> strange errors?
In Python 3 zip() can deal with infinite iterables -- what would you expect
from
reversed(zip(count()))
?
If all
On 2016-03-06 12:38, Tim Chase wrote:
> On 2016-03-06 19:29, Sven R. Kunze wrote:
> > what's the reason that reversed(zip(...)) raises as a TypeError?
>
> I'm not sure why reversed() doesn't think that the thing returned by
> zip() isn't a sequence.
Ah, a little more digging suggests that in 2.x,
Tim Chase wrote:
> On 2016-03-06 19:29, Sven R. Kunze wrote:
>> what's the reason that reversed(zip(...)) raises as a TypeError?
>>
>> Would allowing reversed to handle zip and related functions lead to
>> strange errors?
>
> Peculiar, as this works in 2.x but falls over in 3.x:
>
> $ python
>
On 2016-03-06 18:29, Sven R. Kunze wrote:
Hi,
what's the reason that reversed(zip(...)) raises as a TypeError?
Would allowing reversed to handle zip and related functions lead to
strange errors?
'reversed' yields the items in reverse order; it needs the last item first.
Iterators yield items
On 06/03/2016 17:20, Ian Kelly wrote:
On Sun, Mar 6, 2016 at 10:05 AM, Mark Lawrence wrote:
Why in the year 2016 are people still giving links to the Luddite Python 2
docs?
Maybe because it's the version that comes up when googling for "python
if statement".
The obvious solution is to take
On 06.03.2016 19:53, Peter Otten wrote:
Sven R. Kunze wrote:
what's the reason that reversed(zip(...)) raises as a TypeError?
Would allowing reversed to handle zip and related functions lead to
strange errors?
In Python 3 zip() can deal with infinite iterables -- what would you expect
from
r
On 06.03.2016 19:51, Tim Chase wrote:
So it looks like one needs to either
results = reversed(list(zip(...)))
or, more efficiently (doing it with one less duplication of the list)
results = list(zip(...))
results.reverse()
Nice idea. :) Unfortunately, I used it while drafting som
On 3/6/2016 7:24 AM, alien2u...@gmail.com wrote:
Hello list,
I am following "Learning Python: Mark Lutz" and came across following
in chapter 3 few days back.
What is the copyright date on the copy you have?
[quote] * You may still have to reload nested modules. Technically
speaking, IDLE's
On Sat, Mar 5, 2016 at 12:36 PM, Gene Heskett wrote:
> On Saturday 05 March 2016 10:46:04 Thomas 'PointedEars' Lahn wrote:
>
>> Gene Heskett wrote:
>> > I've never heard of a massless photon,
>>
>> That is unfortunate as it should be common knowledge by now.
>>
>> > and they do exert a push on the
On Sunday 06 March 2016 09:21:49 Larry Martell wrote:
> On Sat, Mar 5, 2016 at 12:36 PM, Gene Heskett
wrote:
[...]
> > So in that scenario, I have first hand knowledge about relativity
> > despite my offical 8th grade education.
>
> Gene, your massive and varied experiences trump my formal edu
On Sun, Mar 6, 2016 at 4:46 PM, Gene Heskett wrote:
>
> Has Carol written anything new lately?
I replied to Gene privately, but if anyone is wondering, Carol is my
wife and these are her blogs:
Non-fiction:
http://minervaontheroad.com/
Fiction:
https://minervamartell.wordpress.com/
--
https:
On Mon, 7 Mar 2016 04:05 am, Mark Lawrence wrote:
> Why in the year 2016 are people still giving links to the Luddite Python
> 2 docs?
Because Python 2.7 is still supported, and will be officially supported
until 2020, after which it will still have third-party support from
companies like Red Hat
On Sun, Mar 6, 2016 at 6:14 PM, Steven D'Aprano wrote:
> On Mon, 7 Mar 2016 04:05 am, Mark Lawrence wrote:
>
>> Why in the year 2016 are people still giving links to the Luddite Python
>> 2 docs?
>
> Because Python 2.7 is still supported, and will be officially supported
> until 2020, after which
On Mon, Mar 7, 2016 at 10:14 AM, Steven D'Aprano wrote:
> And I take exception to your use of the word "Luddite" to describe Python 2.
> Python 2 is a perfectly fine programming language, and it will continue to
> be used by some well past 2020. There's no need to bully people into
> upgrading to
Mark Lawrence at 2016/3/5 UTC+8 8:01:06PM wrote:
>
> HTH http://python3porting.com/problems.html
OK, now I understand what "from .cparset import *" means, but it didn't help on
solving this import error:-(
Thanks for the link, although it seems not help on this problem either:-)
--Jach
--
h
1. What are the rules for using __del__ besides: 'don't use it'.
2. What happens when I SystemExit? __del__ and gc are not invoked when I
SystemExit and there's a circular reference - but why? The OS is going
to reclaim the memory anyways so why be finicky about circular
references - why can't
On Mon, Mar 7, 2016 at 2:27 PM, Veek. M wrote:
> 1. What are the rules for using __del__ besides: 'don't use it'.
Use it as a last-shot cleanup of resources you own. Don't depend on
it, but use it.
> 2. What happens when I SystemExit? __del__ and gc are not invoked when I
> SystemExit and there'
"Veek. M" writes:
> 1. What are the rules for using __del__ besides: 'don't use it'.
What do you mean by “rules”?
If you want advice on using that method, I don't think a canonical
exhaustive “rules” set exists.
For example: Use ‘__del__’ to mark an object as no longer used; don't
expect that
Hi, I'm trying to move away from Perl and go to Python.
Regex seems to bethe hardest challenge so far.
Perl:
while () {
if (/(\d+)\t(.+)$/) {
print $1." - ". $2."\n";
}
}
into python
pattern = re.compile(r"(\d+)\t(.+)$")
with open(fields_Indexfile,mode="rt",encoding='utf-8') a
On Mon, Mar 7, 2016 at 3:38 PM, Fillmore wrote:
> pattern = re.compile(r"(\d+)\t(.+)$")
> with open(fields_Indexfile,mode="rt",encoding='utf-8') as headerfile:
> for line in headerfile:
> #sys.stdout.write(line)
> m = pattern.match(line)
> print(m.group(0))
> header
On 3/6/2016 11:38 PM, Fillmore wrote:
Hi, I'm trying to move away from Perl and go to Python.
Regex seems to bethe hardest challenge so far.
Perl:
while () {
if (/(\d+)\t(.+)$/) {
print $1." - ". $2."\n";
}
}
into python
pattern = re.compile(r"(\d+)\t(.+)$")
with open(fields_I
Also for regex hacking:
Try with findall before using match/search
--
https://mail.python.org/mailman/listinfo/python-list
Also for regex hacking:
Try with findall before using match/search
--
https://mail.python.org/mailman/listinfo/python-list
On Monday 07 March 2016 14:27, Veek. M wrote:
> 1. What are the rules for using __del__ besides: 'don't use it'.
__del__ needs to be defined in a class to be called.
It will be called *at some point* when the instance is about to be garbage
collected. There is no guarantee when that will be: it
Veek. M wrote:
> 1. What are the rules for using __del__ besides: 'don't use it'.
>
> 2. What happens when I SystemExit? __del__ and gc are not invoked when
> I SystemExit and there's a circular reference - but why? The OS is
> going to reclaim the memory anyways so why be finicky about circular
On Sunday, March 6, 2016 at 6:10:22 PM UTC+1, Mark Lawrence wrote:
> On 06/03/2016 15:28, marco.naw...@colosso.nl wrote:
> > On Sunday, March 6, 2016 at 3:16:19 PM UTC+1, Diego ... wrote:
> >> Hello! I have a question in an exercise that says : Write an expression to
> >> determine whether a perso
Fillmore wrote:
>
> Hi, I'm trying to move away from Perl and go to Python.
> Regex seems to bethe hardest challenge so far.
>
> Perl:
>
> while () {
> if (/(\d+)\t(.+)$/) {
> print $1." - ". $2."\n";
> }
> }
>
> into python
>
> pattern = re.compile(r"(\d+)\t(.+)$")
> with open(fiel
On Mon, Mar 7, 2016 at 5:45 PM, wrote:
> As a side note, you are probably aware that if you look at the Linux
> ecosystems there are still a lot of distributions that have Python 2
> as a default. There are still also large mainstream libraries that
> do not (or just very recently) have support f
67 matches
Mail list logo