> If what you really need is a voting application, you can look at
> https://github.com/mdipierro/evote which the PSF uses for its elections.
It is not a voting application (I will have more than yes/no answers).
I just want to keep an example simple.
Anyway, I will look into voting application
Cecil Westerhof writes:
> I have written some code I like to use with several databases. At the
> moment sqlite and postgres. It looks like with progres I can use:
> cursor.execute('COMMIT;')
> but that with sqlite I need to use:
> conn.commit()
>
> Is this true, or am I doing something wro
Your questions are somewhat difficult to answer because you misunderstand binary. The key is
that EVERYTHING in a computer is binary. There are NO EXCEPTIONS, it's all binary ALL the time.
The difference comes about in how this binary data is displayed and manipulated. I want to
emphasize, A
Steven D'Aprano writes:
> Ben, I fear that you are not paying attention to me :-)
Possibly, though I also think there's miscommunication in this thread.
You speak of “compile time” and “run time”. You also speak of what the
compiler can do, at run time.
I am a Bear of Little Brain, but: Isn't
In a message of Mon, 09 Nov 2015 13:45:32 -0800, zljubi...@gmail.com writes:
>> I'm assuming this is a website. If so, why not use a form with a checkbox?
>
>One of ideas is to put two url's in the email, one for yes and the other one
>for no.
>
>I am also thinking about reading/parsing the reply
On Monday, 9 November 2015 22:27:40 UTC-5, Denis McMahon wrote:
> On Mon, 09 Nov 2015 15:52:45 -0800, Bernie Lazlo wrote:
>
> > This should be a simple problem but I have wasted hours on it. Any help
> > would be appreciated. [I have taken my code back to almost the very
> > beginning.]
> > =
On Mon, 09 Nov 2015 15:52:45 -0800, Bernie Lazlo wrote:
> This should be a simple problem but I have wasted hours on it. Any help
> would be appreciated. [I have taken my code back to almost the very
> beginning.]
>
> The student scores need to be summed.
> ===
On Monday, 9 November 2015 18:53:06 UTC-5, Bernie Lazlo wrote:
> This should be a simple problem but I have wasted hours on it. Any help would
> be appreciated. [I have taken my code back to almost the very beginning.]
>
> The student scores need to be summed.
> =
Today's scientists often turn to Python to run analysis, simulation, and other
sciency tasks.
That makes us wonder: which Python libraries are most influential in scientific
research?
We just released a tool (built in Python, of course) to answer that question.
It's called Depsy [1], it's fun
On Tue, 10 Nov 2015 06:45 am, Ben Finney wrote:
> Steven D'Aprano writes:
>
>> The compiler doesn't need to decide in advance whether or not the
>> module attributes have been changed. It can decide that at runtime,
>> just before actually looking up the attribute. In pseudo-code:
>>
>> if a
On 2015-11-10 01:53, Bernie Lazlo wrote:
On Monday, 9 November 2015 20:31:52 UTC-5, MRAB wrote:
On 2015-11-10 01:12, Bernie Lazlo wrote:
> On Monday, 9 November 2015 19:30:23 UTC-5, MRAB wrote:
>> On 2015-11-09 23:52, Bernie Lazlo wrote:
>> > This should be a simple problem but I have wasted h
On Monday, 9 November 2015 20:31:52 UTC-5, MRAB wrote:
> On 2015-11-10 01:12, Bernie Lazlo wrote:
> > On Monday, 9 November 2015 19:30:23 UTC-5, MRAB wrote:
> >> On 2015-11-09 23:52, Bernie Lazlo wrote:
> >> > This should be a simple problem but I have wasted hours on it. Any help
> >> > would b
On 2015-11-10 01:12, Bernie Lazlo wrote:
On Monday, 9 November 2015 19:30:23 UTC-5, MRAB wrote:
On 2015-11-09 23:52, Bernie Lazlo wrote:
> This should be a simple problem but I have wasted hours on it. Any help would
be appreciated. [I have taken my code back to almost the very beginning.]
> =
On Monday, 9 November 2015 19:30:23 UTC-5, MRAB wrote:
> On 2015-11-09 23:52, Bernie Lazlo wrote:
> > This should be a simple problem but I have wasted hours on it. Any help
> > would be appreciated. [I have taken my code back to almost the very
> > beginning.]
> >
> > T
On 2015-11-09 23:52, Bernie Lazlo wrote:
This should be a simple problem but I have wasted hours on it. Any help would
be appreciated. [I have taken my code back to almost the very beginning.]
The student scores need to be summed.
import json
imp
This should be a simple problem but I have wasted hours on it. Any help would
be appreciated. [I have taken my code back to almost the very beginning.]
The student scores need to be summed.
import json
import urllib
url = "http://www.wickson.net/ge
Antoon Pardon writes:
> Op 07-11-15 om 04:43 schreef Ben Finney:
> > Python assumes the programmers using it are consenting adults. Doing
> > harmful things is difficult but not forbidden.
>
> I find that to be contradictory. Why should you make something difficult
> if you are consenting adults?
Laura Creighton writes:
> In a message of Tue, 10 Nov 2015 06:45:40 +1100, Ben Finney writes:
> >So the remaining space of code that is safe for the proposed
> >optimisation is trivially small. Why bother with such optimisations, if
> >the only code that can benefit is *already* small and simple?
On 2015-11-09 13:53, zljubi...@gmail.com wrote:
> > You have a couple options that occur to me:
> >
> > 1) set up an SMTP server somewhere (or use the existing one you're
> > receiving this email at in the event you're getting it as mail
> > rather than reading it via NNTP or a web interface) to r
Ian Kelly :
> I wouldn't suggest trying to set up an SMTP server without a strong
> reason, however. These things are surprisingly tricky to configure so
> that your server doesn't get used for spam forwarding, and if you
> don't play nicely with the SMTP community then you'll find your domain
> a
On Tue, Nov 10, 2015 at 9:30 AM, Ian Kelly wrote:
> I wouldn't suggest trying to set up an SMTP server without a strong
> reason, however. These things are surprisingly tricky to configure so
> that your server doesn't get used for spam forwarding, and if you
> don't play nicely with the SMTP comm
On Mon, Nov 9, 2015 at 11:15 AM, Tim Chase
wrote:
> On 2015-11-09 08:12, zljubi...@gmail.com wrote:
>> I know how to send an email, but I would like to be able to receive
>> a reply and act accordingly. Mail reply should contain yes/no
>> answer.
>
> You have a couple options that occur to me:
>
>
On Mon, 09 Nov 2015 13:53:24 -0800, zljubisic wrote:
>> You have a couple options that occur to me:
>>
>> 1) set up an SMTP server somewhere (or use the existing one you're
>> receiving this email at in the event you're getting it as mail rather
>> than reading it via NNTP or a web interface) to
> You have a couple options that occur to me:
>
> 1) set up an SMTP server somewhere (or use the existing one you're
> receiving this email at in the event you're getting it as mail
> rather than reading it via NNTP or a web interface) to receive the
> mail, then create a Python script to poll tha
> I'm assuming this is a website. If so, why not use a form with a checkbox?
One of ideas is to put two url's in the email, one for yes and the other one
for no.
I am also thinking about reading/parsing the reply mail.
Regards.
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
> def get_html(...):
> try:
> ... actually go get the info
> return info
> except (ConnectionError, OSError, SocketError) as e:
> raise ContentNotFoundError from e
Personally, I never liked "early returns". I would rather used a variable and
the last line in t
Hi,
You are right. I am trying to address a few questions at the same time.
As English is not my first language, I can only say that you have addressed
them very well. Thanks.
1. Where to put the try/except block, inside or outside the function
2. How to deal with un-anticipated exceptions
3.
In a message of Tue, 10 Nov 2015 06:45:40 +1100, Ben Finney writes:
>So the remaining space of code that is safe for the proposed
>optimisation is trivially small. Why bother with such optimisations, if
>the only code that can benefit is *already* small and simple?
You have things backwards.
The r
BartC writes:
> On 09/11/2015 01:04, Ben Finney wrote:
> > There isn't a way for the compiler to *know*, in all cases, whether
> > module attributes will be updated during the lifetime of the program
>
> In what way can an attribute be updated, other than deleting it
> altogether?
* Bind a new n
Steven D'Aprano writes:
> The compiler doesn't need to decide in advance whether or not the
> module attributes have been changed. It can decide that at runtime,
> just before actually looking up the attribute. In pseudo-code:
>
> if attribute might have changed:
> use the slow path j
On 2015-11-09 08:12, zljubi...@gmail.com wrote:
> I know how to send an email, but I would like to be able to receive
> a reply and act accordingly. Mail reply should contain yes/no
> answer.
You have a couple options that occur to me:
1) set up an SMTP server somewhere (or use the existing one y
On Monday 9 Nov 2015 16:24 CET, Chris Angelico wrote:
> On Tue, Nov 10, 2015 at 2:01 AM, Cecil Westerhof wrote:
>> for no_of_threads, no_of_records in values:
>
> Beautiful! Though I'd shorten the names to just "threads" and
> "records"; saying "number of X" isn't usually necessary, plus, the
>
On Mon, 9 Nov 2015 04:21:14 -0800 (PST), Salvatore DI DIO wrote:
>
> I was trying to show that this limit was 'e'
> But when I try large numbers I get errors
>
> def lim(p):
> return math.pow(1 + 1.0 / p , p)
>
lim(5)
> 2.718281748862504
lim(9)
> 2.7182820518605446 !!
On Mon, Nov 9, 2015 at 8:44 AM, Cecil Westerhof wrote:
> I have written some code I like to use with several databases. At the
> moment sqlite and postgres. It looks like with progres I can use:
> cursor.execute('COMMIT;')
> but that with sqlite I need to use:
> conn.commit()
>
> Is this tru
On 09/11/2015 01:04, Ben Finney wrote:
Chris Angelico writes:
Hmm, then I was misunderstanding what BartC was advocating. I didn't
think it would *fail* in the presence of dynamic attributes, but
merely *perform suboptimally* (and presumably worse than current
CPython).
There isn't a way for
On Mon, Nov 9, 2015 at 11:12 AM, wrote:
> Hi,
>
> I know how to send an email, but I would like to be able to receive a
> reply and act accordingly.
> Mail reply should contain yes/no answer.
>
> I don't know whether email is appropriate for such function.
> Maybe better idea would be to have lin
Chris Angelico :
> On Tue, Nov 10, 2015 at 2:46 AM, Marko Rauhamaa wrote:
>> I program for Linux. I use different programming languages, but the
>> target is Linux. The systems I build and deal with consist of
>> different components written in different programming languages but
>> they all foll
Hi,
I know how to send an email, but I would like to be able to receive a reply and
act accordingly.
Mail reply should contain yes/no answer.
I don't know whether email is appropriate for such function.
Maybe better idea would be to have links in email body, one for yes, another
for no that wil
I have written some code I like to use with several databases. At the
moment sqlite and postgres. It looks like with progres I can use:
cursor.execute('COMMIT;')
but that with sqlite I need to use:
conn.commit()
Is this true, or am I doing something wrong?
When I use
cursor.execute('COMMI
On Tue, Nov 10, 2015 at 2:46 AM, Marko Rauhamaa wrote:
> I program for Linux. I use different programming languages, but the
> target is Linux. The systems I build and deal with consist of different
> components written in different programming languages but they all
> follow Linux-y conventions t
Chris Angelico :
> On Tue, Nov 10, 2015 at 1:32 AM, Marko Rauhamaa wrote:
>> Yes, and lists and dicts and ints and objects and all. No problem
>> there.
>>
>> However, when filenames and sys.stdin deal with text, things are
>> getting iffy.
>
> So where do you mark the boundary between the human
Steven D'Aprano writes:
> The compiler doesn't need to decide in advance whether or not the module
> attributes have been changed. It can decide that at runtime, just before
> actually looking up the attribute. In pseudo-code:
>
> if attribute might have changed:
> use the slow path ju
On Tue, Nov 10, 2015 at 2:01 AM, Cecil Westerhof wrote:
> for no_of_threads, no_of_records in values:
Beautiful! Though I'd shorten the names to just "threads" and
"records"; saying "number of X" isn't usually necessary, plus, the
general principle of Huffman coding your names recommends usin
Thank you very much Oscar, I was considering using Mapple :-)
--
https://mail.python.org/mailman/listinfo/python-list
On Monday 9 Nov 2015 14:58 CET, Chris Angelico wrote:
> On Tue, Nov 10, 2015 at 12:40 AM, Cecil Westerhof wrote:
>> I was thinking about something like:
>> values = (( 1, 100), ( 2, 100), ( 5, 100),
>> 10, 100), (20, 100), (40, 100))
>> for value in values:
>> do_stress_test('sqlite', ???)
>>
On Tue, Nov 10, 2015 at 1:32 AM, Marko Rauhamaa wrote:
> Yes, and lists and dicts and ints and objects and all. No problem there.
>
> However, when filenames and sys.stdin deal with text, things are getting
> iffy.
So where do you mark the boundary between the human and the OS? If I
create a GUI,
Thank you very much Oscar,I was considerind using Mapple :-)
--
https://mail.python.org/mailman/listinfo/python-list
Thank you very much Chris
--
https://mail.python.org/mailman/listinfo/python-list
On Monday, November 9, 2015 at 2:58:21 PM UTC+1, Chris Angelico wrote:
> On Tue, Nov 10, 2015 at 12:40 AM, Cecil Westerhof wrote:
> > I was thinking about something like:
> > values = (( 1, 100), ( 2, 100), ( 5, 100),
> >10, 100), (20, 100), (40, 100))
> > for value in valu
Op 07-11-15 om 04:43 schreef Ben Finney:
> Bartc writes:
>
>> Is there no way then in Python to declare:
>>
>>pi = 3.141519 # etc
>>
>> and make it impossible to override?
> No, and it would be a bad thing if that were something a library author
> could forbid.
>
> Python assumes the progr
On 2015-11-08, Marko Rauhamaa wrote:
> Grant Edwards :
>
>> On 2015-11-07, Marko Rauhamaa wrote:
>>> "const" is a very ineffective tool that clutters the code and forces
>>> you to sprinkle type casts around your code.
>>
>> But it allows the compiler to warn you if you pass a pointer to a
>> rea
Chris Angelico :
> On Tue, Nov 10, 2015 at 12:25 AM, Marko Rauhamaa wrote:
>> but personally I would prefer the programming language
>> just give me the OS, warts and all.
>
> Then you don't want Python. The point of Python is to give you data
> types like "list", "dict", "int" (not a machine wor
In a message of Sun, 08 Nov 2015 14:07:24 +, Ainoa Gutiérrez Suárez writes:
>it doesn´twork the entry to Python.
>
>
>
>
>
>
>Enviado desde Correo de Windows
I know it is very difficult trying to communicate in a language that is
not your mother tongue, but we need a lot more information abou
In a message of Mon, 09 Nov 2015 17:17:08 +0800, lim_ee_...@ite.edu.sg writes:
>Dear Python organisation staff,
>
> The Python 3.5.0 was successfully installed. But encountered missing dll
>upon running the program.
>
>
>
>My computer is running on Win 7.
>
>Any advise to resolve this issue?
>
>Rg
On Tue, Nov 10, 2015 at 12:40 AM, Cecil Westerhof wrote:
> I was thinking about something like:
> values = (( 1, 100), ( 2, 100), ( 5, 100),
>10, 100), (20, 100), (40, 100))
> for value in values:
> do_stress_test('sqlite', ???)
> do_stress_test('postgres'
On Tue, Nov 10, 2015 at 12:25 AM, Marko Rauhamaa wrote:
> So we have this stack:
>
> +-+
> | Application |
> +-+
> | Python|
> +-+
> |UNIX |
> +-+
>
> The question is, does Python want to be "just a programming language"
>
At the moment I have the following calls:
do_stress_test( 1, 100)
do_stress_test( 2, 100)
do_stress_test( 5, 100)
do_stress_test( 10, 100)
do_stress_test( 20, 100)
do_stress_test( 40, 100)
In principal I want to change it to something like:
do_stress_test('sqlite',
Chris Angelico :
> On Mon, Nov 9, 2015 at 9:56 PM, Marko Rauhamaa wrote:
>> One of the principal UNIX innovations was to see files as simple byte
>> sequences. The operating system would place no semantics on the
>> meaning or structure of the bytes.
>
> And you also want to see those files as co
On Sunday 8 Nov 2015 09:36 CET, Chris Warrick wrote:
> On 8 November 2015 at 00:40, Cecil Westerhof wrote:
>> I followed http://zetcode.com/db/postgresqlpythontutorial/.
>>
>> I used:
>> sudo -u postgres createuser stressTest
>> this create the role, but also gave:
>> could not change directory
On 9 November 2015 at 12:21, Salvatore DI DIO wrote:
> I was trying to show that this limit was 'e'
> But when I try large numbers I get errors
>
> def lim(p):
> return math.pow(1 + 1.0 / p , p)
>
lim(5)
> 2.718281748862504
lim(9)
> 2.7182820518605446
>
>
> What
On Mon, Nov 9, 2015 at 11:21 PM, Salvatore DI DIO wrote:
> I was trying to show that this limit was 'e'
> But when I try large numbers I get errors
>
> def lim(p):
> return math.pow(1 + 1.0 / p , p)
>
lim(5)
> 2.718281748862504
lim(9)
> 2.7182820518605446
>
>
>
Hi,
I am using multiprocessing with pexpect, issue is whenever i call a function
which is having expect(), its throwing error which is genuine as multiple
threads are processing it same time (i/o prompt same time by multiple
processes..so issues in picture...), so i want to use lock for that se
On Mon, Nov 9, 2015 at 11:22 PM, BartC wrote:
> I tried this code:
>
> a=10
> print (a)
>
> del a
> #print (a)
>
> a=20
> print (a)
>
> That sort of confirms what you are saying: that names don't even come into
> existence until the first time they are encountered. They don't just contain
> None,
On 09/11/2015 02:23, Steven D'Aprano wrote:
On Mon, 9 Nov 2015 09:35 am, BartC wrote:
import m
a=10
b=20
c=30
m.f()
The set of global names the compiler knows will be ("m","a","b","c").
Wrong. Up to the line "c=30", the set of names the compiler can infer are m,
a, b and c. Once the line "m
Hello,
I was trying to show that this limit was 'e'
But when I try large numbers I get errors
def lim(p):
return math.pow(1 + 1.0 / p , p)
>>> lim(5)
2.718281748862504
>>> lim(9)
2.7182820518605446
What am i doing wrong ?
Regards
--
https://mail.python.org/mailman/l
On Mon, 9 Nov 2015 12:04 pm, Ben Finney wrote:
> There isn't a way for the compiler to *know*, in all cases, whether
> module attributes will be updated during the lifetime of the program
> (short of, as pointed out elsewhere, running the entire program under
> all possible conditions).
>
> So th
On Mon, Nov 9, 2015 at 9:56 PM, Marko Rauhamaa wrote:
> One of the principal UNIX innovations was to see files as simple byte
> sequences. The operating system would place no semantics on the meaning
> or structure of the bytes.
And you also want to see those files as containing "plain text",
rig
Michiel Overtoom :
> If you're on Windows, don't forget to include a 'b' in the mode string
> of the open() call, otherwise Python will assume that you're opening a
> text file.
Python has brought that blessing to other operating systems, as well.
One of the principal UNIX innovations was to see
> On 08 Nov 2015, at 22:27, kent nyberg wrote:
>
> Well, lets assume I want to write and read binary. How is it done?
With the functions 'open()' and 'read()' and 'write()'. If you're on Windows,
don't forget to include a 'b' in the mode string of the open() call, otherwise
Python will assum
On 11/8/2015 9:41 PM, Laura Creighton wrote:
In a message of Sun, 08 Nov 2015 18:05:32 -0500, Terry Reedy writes:
I just read somewhere that the issue could be because I was trying to
run these examples from within Idle.
First let me note that a) IDLE is meant for learning Python and
develo
kent nyberg writes:
[- -]
> Well, lets assume I want to write and read binary. How is it done?
[- -]
You open the file with mode "wb" (to write binary) or "rb" (to read
binary), and then you write or read bytes (eight-bit units).
>>> data = '"binääridataa"\n'.encode('utf-8')
>>> f = open(
Hi, Chris Angelico ,
Thank you for your help ! :-)
From: Chris Angelico
Date: 2015-11-06 18:30
To: wa...@travelsky.com
CC: python-list
Subject: Re: Question about math.pi is mutable
On Fri, Nov 6, 2015 at 1:33 PM, wa...@travelsky.com wrote:
> Hello, python-list guys:
>
> I am a newbie
Hi there,
Lets say I want to play around with binary files in python.
Opening and using files in python is something that I think I've sort of got
the hang of.
The thing im wondering about is binary files.
While searching for binary and python I started reading about bin().
I can use bin() to conv
it doesn´twork the entry to Python.
Enviado desde Correo de Windows
--
https://mail.python.org/mailman/listinfo/python-list
Dear Python organisation staff,
The Python 3.5.0 was successfully installed. But encountered missing dll
upon running the program.
My computer is running on Win 7.
Any advise to resolve this issue?
Rgds
LIM Ee Hai
Senior Lecturer / Electronics Engineering, School of Electronics &
Info-C
Ben Finney wrote:
We
should certainly not have a compiler that makes needless difference to
code behaviour under test conditions versus non-test conditions.
Indeed. Volkswagen tried a version of that recently,
and it didn't end well...
--
Greg
--
https://mail.python.org/mailman/listinfo/pytho
76 matches
Mail list logo