Cameron Simpson wrote:
> I always structure this aspect as:
>
> ... at or near top of script ...
>
> def main(argv):
>... do main logic here ...
>
> ... at bottom ...
> if __name__ == '__main__':
>sys.exit(main(sys.argv))
I, as a Python beginner, came to the same solution!
It seem
On 10Jan2016 22:45, Arshpreet Singh wrote:
On Sunday, 10 January 2016 20:33:20 UTC+5:30, Michael Torrie wrote:
This way I can import functions defined in this script into another
script later if I want.
If I find I need to share state between functions, and if I find that I
might need to have
On Sunday, 10 January 2016 20:33:20 UTC+5:30, Michael Torrie wrote:
> This way I can import functions defined in this script into another
> script later if I want.
>
> If I find I need to share state between functions, and if I find that I
> might need to have multiple situations of shared state
On Sunday, 10 January 2016 21:09:52 UTC+5:30, Steven D'Aprano wrote:
> There are *no* problems that are impossible to solve without classes, but
> sometimes classes will make problems easier to solve. And sometimes classes
> make problems harder to solve. It depends on the problem.
Is there any
On Sunday, 10 January 2016 23:20:02 UTC+5:30, Bernardo Sulzbach wrote:
> Essentially, classes (as modules) are used mainly for organizational purposes.
>
> Although you can solve any problem you would solve using classes
> without classes, solutions to some big problems may be cheaper and
> more
On 1/10/2016 2:38 PM, Robert wrote:
Hi,
Below is a code snippet from pytest package. It passes pytest, i.e. there is
no failure report.
# content of test_sysexit.py
import pytest
def f():
raise SystemExit(1)
def test_mytest():
with pytest.raises(SystemExit):
f()
I se
On Monday, January 11, 2016 at 7:30:10 AM UTC+5:30, jf...@ms4.hinet.net wrote:
> It lets you jump between the current cursor position and the line the upper
> level indentation start, something like the bracket matching in C editor.
> Because of Python use indentation as its code block mark, It m
On Mon, 11 Jan 2016 12:57 pm, Robert wrote:
> Hi,
>
> When I use an on line code snippet, see below please, I find that
> 'converged' in class ConvergenceMonitor is seen as a data.
That is because converged is a property. That makes it be seen as data.
> @property
> def converged(self):
On Mon, Jan 11, 2016 at 1:57 PM, Cameron Simpson wrote:
> I always structure this aspect as:
>
> ... at or near top of script ...
>
> def main(argv):
>... do main logic here ...
>
> ... at bottom ...
> if __name__ == '__main__':
>sys.exit(main(sys.argv))
>
> This has the benefits of (a
On 2016-01-10 17:59, jf...@ms4.hinet.net wrote:
> It lets you jump between the current cursor position and the line
> the upper level indentation start, something like the bracket
> matching in C editor. Because of Python use indentation as its code
> block mark, It might be helpful if we can jump
On 10Jan2016 08:02, Michael Torrie wrote:
I can't speak to Flask or any other web development. But for simple
scripts, I'll start out with no classes. Just functions as needed, and
some main logic. I always use the idiom:
if __name__ == '__main__':
# do main logic here
This way I can imp
On Mon, Jan 11, 2016 at 12:59 PM, wrote:
> It lets you jump between the current cursor position and the line the upper
> level indentation start, something like the bracket matching in C editor.
> Because of Python use indentation as its code block mark, It might be helpful
> if we can jump be
It lets you jump between the current cursor position and the line the upper
level indentation start, something like the bracket matching in C editor.
Because of Python use indentation as its code block mark, It might be helpful
if we can jump between different level of it:-)
--Jach Fong
--
ht
Hi,
When I use an on line code snippet, see below please, I find that
'converged' in class ConvergenceMonitor is seen as a data.
-
class ConvergenceMonitor(object):
"""Monitors and reports convergence to :data:`sys.stderr`.
Parameters
--
tol : double
Hello everyone:
A member on the Stack Overflow community advised me to post my question on this
forum:
http://codereview.stackexchange.com/questions/116395/opening-the-same-csv-file-in-two-different-ways-in-order-to-transform-data-in-on
I appreciate your feedback immensely.
Sincerely,
Saran
-
On 1/10/2016 6:38 AM, Tim Golden wrote:
On 10/01/2016 05:18, Edward Diener wrote:
On 1/9/2016 11:03 AM, Tim Golden wrote:
On 06/01/2016 00:48, Edward Diener wrote:
The Python launcher in Windows is a neat tool for running multiple
versions of Python 2 and Python 3 at different times. It allo
On 1/10/2016 6:38 AM, Tim Golden wrote:
On 10/01/2016 05:18, Edward Diener wrote:
On 1/9/2016 11:03 AM, Tim Golden wrote:
On 06/01/2016 00:48, Edward Diener wrote:
The Python launcher in Windows is a neat tool for running multiple
versions of Python 2 and Python 3 at different times. It allo
Cody wrote a good and correct answer.
Everyone is going with "lawyers, lawyers, lawyers...". It is not any
lawyer. Most big companies and consulting firms will have lawyers that
are experienced with open source licenses, some that have even fought
against GPL and whatnot. So look for the correct t
On Fri, Jan 8, 2016 at 1:41 PM, Martinez, Jorge Alberto (GE Aviation) <
jorgealberto.marti...@ge.com> wrote:
>
> Hello
> We develop applications here with Python and I want to know if there's
issues by using.
> We use NumPy, PyDaqMx, Py Visa
>
> How can we cover this licensing?
I am not a lawyer,
Hi,
Below is a code snippet from pytest package. It passes pytest, i.e. there is
no failure report.
# content of test_sysexit.py
import pytest
def f():
raise SystemExit(1)
def test_mytest():
with pytest.raises(SystemExit):
f()
I see that f() will generate 'SystemExit(1)'.
On 09.01.2016 19:32, Paul Rubin wrote:
"Sven R. Kunze" writes:
Basically a task scheduler where tasks can be thrown away once they
are too long in the queue.
I don't think there's a real nice way to do this with heapq. The
computer-sciencey way would involve separate balanced tree structures
Wow. That's an impressive reply.
On 08.01.2016 20:26, srinivas devaki wrote:
So you need a task scheduler with expiration and priority on each task.
Interesting Problem..
as peter said about marking the task in heapB to be deleted. but this
needs searching everytime you pop off an old item [com
Robert wrote:
> When I read a sample file from hmm learn package, which is on top of
> scikit-learn package, I see there are many member functions (prefix with
> '_') have no caller. That is, I don't see anything uses those functions.
> Below is a sample part from class GMMHMM(_BaseHMM):
I bet t
On Mon, 11 Jan 2016 04:55 am, Robert wrote:
> Some online tutorials tell me '_' prefix is a kind of convention of
> private members.
Correct. Not just private members, but private *anything*.
Any time you see anything starting with a single underscore, whether it is a
module, class, method, att
Hi,
When I read a sample file from hmm learn package, which is on top of
scikit-learn package, I see there are many member functions (prefix with
'_') have no caller. That is, I don't see anything uses those functions.
Below is a sample part from class GMMHMM(_BaseHMM):
//
def _
Hi Steven:
The previous code was a stand along under the " if __name__ == '__main__':
". The full function suite that I have made (and indeed includes a try and
except block):
import os.path
import sys
import csv
from io import StringIO
import xml.etree.cElementTree as ElementTree
from xml.etree.
Essentially, classes (as modules) are used mainly for organizational purposes.
Although you can solve any problem you would solve using classes
without classes, solutions to some big problems may be cheaper and
more feasible using classes.
If Python is your everyday scripting tool, you will usual
On Mon, 11 Jan 2016 02:04 am, kbtyo wrote:
> Hello Everyone:
>
> I am curious to know why I receive the aforementioned message. I am using
> Python 3.4.3 and Windows 7. I am running the following script from Windows
> Powershell:
I created a file "data" containing the input data you said:
> The
Hi Steven:
That is the only message (*xml.etree.ElementTree.Element' does not support
the buffer interface"*). There is no traceback. My apologies for not
clarifying previously.
On Sun, Jan 10, 2016 at 10:19 AM, Steven D'Aprano
wrote:
> On Mon, 11 Jan 2016 02:04 am, kbtyo wrote:
>
> > Hello Eve
On Sun, 10 Jan 2016 06:29 pm, Arshpreet Singh wrote:
> Hello Friends, I am quite new to OOP(object oriented Programming), I did
> some projects with python which includes Data-Analysis, Flask Web
> Development and some simple scripts.
>
> I have only one question which is bothering me most of the
On Mon, 11 Jan 2016 02:04 am, kbtyo wrote:
> Hello Everyone:
>
> I am curious to know why I receive the aforementioned message.
It is impossible to be sure from the information you have given us, since we
do not know which line of code caused the error.
Please copy and paste the ENTIRE traceb
Hello Everyone:
I am curious to know why I receive the aforementioned message. I am using
Python 3.4.3 and Windows 7. I am running the following script from Windows
Powershell:
Response = 's.csv'
with open(Response, 'rU', encoding='utf-8') as data:
separated = data.
On 01/10/2016 12:29 AM, Arshpreet Singh wrote:
> Hello Friends, I am quite new to OOP(object oriented Programming), I
> did some projects with python which includes Data-Analysis, Flask Web
> Development and some simple scripts.
>
> I have only one question which is bothering me most of the time,
Apologies, looks like I did a reply instead of reply-all. So
forwarding this email , please provide guidance on the same
-- Forwarded message --
From: Ganesh Pal
Date: Thu, Jan 7, 2016 at 12:26 PM
Subject: Re: python unit test framework sample code
To: Terry Reedy
> Unless you
On 10/01/2016 05:18, Edward Diener wrote:
On 1/9/2016 11:03 AM, Tim Golden wrote:
On 06/01/2016 00:48, Edward Diener wrote:
The Python launcher in Windows is a neat tool for running multiple
versions of Python 2 and Python 3 at different times. It allows as
options the ability to specify the
Ben Finney wrote:
> "Martinez, Jorge Alberto (GE Aviation)" […] writes:
>> We develop applications here with Python and I want to know if there's
>> issues by using. We use NumPy, PyDaqMx, Py Visa
>
> Those are all free software: meaning, every recipient has freedom to
> execute, modify, and/or r
36 matches
Mail list logo