Re: Idiom for partial failures

2020-02-21 Thread Rob Gaddi
Rob Gaddi wrote: On 2/20/20 9:30 AM, David Wihl wrote:  (first post) I'm working on the Python client library [0]for the Google Ads API [1]. In some cases, we can start a request with a partial failure [2] flag = True. This means that the request may contain say 1000 operations. If any

Re: Idiom for partial failures

2020-02-20 Thread Rob Gaddi
On 2/20/20 9:30 AM, David Wihl wrote:  (first post) I'm working on the Python client library [0]for the Google Ads API [1]. In some cases, we can start a request with a partial failure [2] flag = True. This means that the request may contain say 1000 operations. If any of the operations

Re: Damping cofficient from envelope

2020-01-13 Thread Rob Gaddi
On 1/13/20 9:45 AM, Shiba Subedi wrote: Dear all, I'm new for python. I'm trying to compute damping coefficient ( for the waveform trace data) but I didn't get how can I do. I can plot the envelope but my interest is to find out the damping coefficient of the trace. How is it possible?

Re: Coding technique: distinguish using type or abc?

2020-01-08 Thread Rob Gaddi
On 1/8/20 1:40 PM, DL Neil wrote: Do you prefer to use isinstance() with type() or to refer to collections.abc? This team producing bases statistical analyses for (lesser capable) user-coders to utilise with their own experimental 'control code'; faces situations where a list-parameter is

Re: Floating point overflow and underflow

2020-01-07 Thread Rob Gaddi
On 1/7/20 3:47 PM, Shashank Tiwari wrote: In Python3 an operation as follows: 10135.1941 * (10**8) gives the result: 101351941.0001 Similarly, using the pow function also gives the same overflow/underflow error. 10135.1941 * pow(10,8) 101351941.0001 Like multiplication, division of

Re: (no subject)

2020-01-06 Thread Rob Gaddi
On 1/4/20 2:29 PM, William Johnsson wrote: Hello! My name is William and im 14 years old and live in sweden. Im pretty new to programing in python and i need some help with code, (That’s why i’m here). But i couldn’t really find what i was searching for on the internet. I’m trying to write

Re: Hi!! im searching for a ready app of python for pdf combiner

2020-01-06 Thread Rob Gaddi
On 1/6/20 8:13 AM, alon.naj...@gmail.com wrote: Hi!! im searching for a ready app of python for pdf combiner what I need exactly is a pdf combiner for 20 + pdfs to combine them as one, do a merge Why does this need to be in Python? Just download a copy of pdftk (which I think is written in

Re: python 2 to 3 converter

2019-12-09 Thread Rob Gaddi
On 12/9/19 9:55 AM, songbird wrote: jf...@ms4.hinet.net wrote: ... Even string is hard to be handled by the AI:-) Quoted from https://portingguide.readthedocs.io/en/latest/strings.html " ... This means that you need to go through the entire codebase, and decide which value is what type.

Re: Make warning an exception?

2019-12-06 Thread Rob Gaddi
On 12/6/19 12:58 PM, Israel Brewster wrote: I was running some code and I saw this pop up in the console: 2019-12-06 11:53:54.087 Python[85524:39651849] WARNING: nextEventMatchingMask should only be called from the Main Thread! This will throw an exception in the future. The only problem is,

Re: array and struct 64-bit Linux change in behavior Python 3.7 and 2.7

2019-12-03 Thread Rob Gaddi
On 12/2/19 5:50 PM, Richard Damon wrote: Perhaps array could be extended so that it took '4' for a 4 byte integer and '8' for an 8 byte integer (maybe 'U4' and 'U8' for unsigned). Might as well also allow 1 and 2 for completeness for char and short (but those are currently consistent). I

Re: array and struct 64-bit Linux change in behavior Python 3.7 and 2.7

2019-12-02 Thread Rob Gaddi
On 12/2/19 9:26 AM, Chris Clark wrote: Test case: import array array.array('L', [0]) # x.itemsize == 8 rather than 4 This works fine (returns 4) under Windows Python 3.7.3 64-bit build. Under Ubuntu; Python 2.7.15rc1, 3.6.5, 3.70b3 64-bit this returns 8.

Re: Python Resources related with web security

2019-11-26 Thread Rob Gaddi
On 11/26/19 12:41 PM, Grant Edwards wrote: On 2019-11-26, Joel Goldstick wrote: I'm thinking this is a troll or a turing machine experiment? Yea, many of the posts remind me of ELIZA. How do you feel about many of the posts remind you of ELIZA? -- Rob Gaddi, Highland Technology

Re: How to delay until a next increment of time occurs ?

2019-11-14 Thread Rob Gaddi
to be getting into from a very high-level language. Might work? -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to delay until a next increment of time occurs ?

2019-11-14 Thread Rob Gaddi
n your lack of rigid control over what happens on your processor is a real problem and you're better off bare metal on a dedicated $2 Cortex-M than with random timeslices of the 1.4GHz beast on the rPi. Is what I was shorthanding with "realtime". -- Rob Gaddi, Highland Technology -- ww

Re: How to delay until a next increment of time occurs ?

2019-11-13 Thread Rob Gaddi
vice versa. There's also async in the mix, which I still have no idea how to use. But this way if you strike out on one approach you've got some others to consider. Also, does the rPi have any PWM or counter pins that you can just set and forget, rather than trying to keep it going yourself

Re: Launching a Script on the Linux Platform

2019-11-12 Thread Rob Gaddi
nu, not the command prompt. I personally start even GUI programs far more often from a prompt. To follow Linux conventions you'd put the shebang, make the file executable, and put the executable somewhere on the PATH. I'd stick to those conventions barring a particular reason not to. --

Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-05 Thread Rob Gaddi
ocks. Code that should only execute if the try block was error-free, but that you expect to not be able to raise errors itself, should go into the else block. Like most of programming, hard-and-fast rules turn out to be impossible. Reality has squishy edges. -- Rob Gaddi, Highland Technology -- ww

Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-04 Thread Rob Gaddi
a) your try block is too long and encompasses too many unrelated lines of code, or b) your except condition is too broad. Don't "except Exception". Only catch specific exceptions where you can provide benefit by doing do. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email

Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-04 Thread Rob Gaddi
File "", line 1, in TypeError: __init__() should return None, not 'int' Cheers, Luciano On Mon, Nov 4, 2019 at 2:31 PM Rob Gaddi wrote: >> [snip] Raise an exception. Returning None will specifically NOT accomplish the thing you want; nothing ever checks the return value of __i

Re: OOP - how to abort an __init__ when the initialisation code fails ?

2019-11-04 Thread Rob Gaddi
ng None will specifically NOT accomplish the thing you want; nothing ever checks the return value of __init__. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Renaming an import

2019-09-05 Thread Rob Gaddi
to graphing_module_a, that decision is made at a single central point in my package rather than scattered through 30 different import statements in a dozen files. Any ideas? -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix

Re: Proper way to pass Queue to process when using multiprocessing.imap()?

2019-09-03 Thread Rob Gaddi
a fantastic job of handling this sort of parallelization in a straightforward way. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: itertools cycle() docs question

2019-08-21 Thread Rob Gaddi
ble:     yield thing You assume that the initial iterable is reusable. If its not, the only way you can go back to the beginning is to have kept track of it yourself. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to

Re: My pseudocode to Python?

2019-08-19 Thread Rob Gaddi
the entry directly behind "if x: ". mylist = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] if not x: del mylist[3] -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Boolean comparison & PEP8

2019-07-29 Thread Rob Gaddi
thing that modifies bar, and find that bar always points not to a new empty list each time but to the same empty list on each call. >>> def foo(bar=[]): ... bar.append(5) ... return bar ... >>> foo() [5] >>> foo() [5, 5] >>> foo() [5, 5, 5] As far as w

Re: Nesting Custom Errors in Classes

2019-07-23 Thread Rob Gaddi
imes for basic encapsulation principles without really gaining anything. I use inheritance of nested classes in my https://pypi.org/project/indexedproperty/ project, where subclasses of IndexedProperty have a _Trampoline inner class subclassed from Trampoline that can be redefined as needed, but

Re: Pythonic custom multi-line parsers

2019-07-10 Thread Rob Gaddi
processes the line in the current context and updates self.statefn to a different method if necessary. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Use global, or not

2019-06-28 Thread Rob Gaddi
is an inherently global thing. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: How control a GUI for an unrelated application from a Python script?

2019-06-14 Thread Rob Gaddi
t use the provided software" that hasn't been updated since 2001 and doesn't actually let you test the thing you need to. The underlying FPGA board that it's built on has its own page at https://opalkelly.com/products/xem3010/ with an SDK. That may turn out to be your best way in. -- Rob Gaddi

Re: How control a GUI for an unrelated application from a Python script?

2019-06-14 Thread Rob Gaddi
On 6/14/19 8:49 AM, Christian Seberino wrote: Thanks for all the help. I'll definitely try to bypass the GUI first if possible. This is on Windows 7 so maybe AutoIt will do the trick if can't avoid the GUI. Thanks again everyone. Out of curiosity, what hardware? -- Rob Gaddi, Highland

Re: Why I am getting IndexError: tuple index out of range when converting a float value to a string?

2019-06-11 Thread Rob Gaddi
f to the autoindexed element. You could also explicitly index the 1st element (#0) as {0:6.5f}. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: More CPUs doen't equal more speed

2019-05-24 Thread Rob Gaddi
this stuff, and I feel like it often doesn't get enough love. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Instance vs Class variable oddity

2019-05-15 Thread Rob Gaddi
on instance variables. I don't love it, but I also can't explain what I find wrong with it. Irv -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo

Re: Using a Variable Inside the String

2019-05-07 Thread Rob Gaddi
e or double quote) are strings; a sequence of characters as used to write words. Numbers are numbers. You can't add them together. This over here is my friend Bob. What's 31 + 18 + Bob? The question makes no sense, because the operation of addition isn't defined in such a way that allows you

Re: Function to determine list max without itertools

2019-04-19 Thread Rob Gaddi
, of course, do some benchmarks to see if it makes a difference, but, personally, I'd just leave it. Personally yes, but because it allows it to execute on non-sequence iterables rather than because it saves a single near-instantaneous comparison. -- Rob Gaddi, Highland Technology

Re: Function to determine list max without itertools

2019-04-19 Thread Rob Gaddi
): myMax = listarg[0] for item in listarg: if item > myMax: myMax = item return myMax Sayth When you understand what it is you intend to write (barring DL Neil's comments), and THEN write it, you write the correct thing. Thus endith the lesson. --

Re: Function to determine list max without itertools

2019-04-18 Thread Rob Gaddi
(listarg)]: if myMax < i: myMax = i return myMax How would you simplify it? In English rather than Python, how do you find the maximum element in a list? -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently

Re: What does "TypeError: unsupported operand type(s) for +: 'function' and 'int'" mean?

2019-03-25 Thread Rob Gaddi
em because somewhere in your code, you're asking it to do that. In all likelihood, if you follow the line number provided in the traceback, you'll see that somewhere that you planned to use the result of calling a function you left out the parentheses and are instead using the function itself. --

Re: Why float('Nan') == float('Nan') is False

2019-02-13 Thread Rob Gaddi
operators, since ordering is inherently undefined. In part, these decisions were made to make it possible to detect a NaN in C in the absence of an isnan() function. If (x != x), then x must be a NaN. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently ou

Re: How can I find the indices of an array with float values in python?

2019-01-10 Thread Rob Gaddi
[9, 5, 1], [4, 3, 8]] >>> a = np.array([[2, 7, 6], [9, 5, 1], [4, 3, 8]]) >>> b = np.array([1, 5, 2, 6, 3, 7, 4, 8, 5, 9]) >>> (a > 5).nonzero() (array([0, 0, 1, 2]), array([1, 2, 0, 2])) >>> np.nonzero(b % 2) (array([0, 1, 4, 5, 8, 9]),) -- Rob Gaddi, Highland Tec

Re: polar coordinates?

2018-12-17 Thread Rob Gaddi
e thread I will take under advisement, I suppose. If I recall correctly you can make the color argument a list with the same number of elements as you have points. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix

Python, the stack, and the heap

2018-12-17 Thread Rob Gaddi
are out on the heap? And that the references themselves may or may not wind up on the stack depending on what flavor you're running? Answers to these questions have very little bearing on how I actually write Python, mind, but now I'm curious. -- Rob Gaddi, Highland Technology

Re: pandas read_csv

2018-11-09 Thread Rob Gaddi
okenizing data. C error: Expected 1 fields in line 8, saw 3 Offhand, and as a guess based on nothing, I would speculate that something about line 8 of your CSV file differs from lines 1-7. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is c

Re: Overwhelmed by the Simplicity of Python. Any Recommendation?

2018-11-05 Thread Rob Gaddi
popular, takes too long to start, and you have to setup folders and directories EVERY SINGLE TIME at startup. I've never been a fan of IDEs, but a code editor window on the left and the IPython QtConsole on the right is a pretty efficient way to blaze through code. -- Rob Gaddi, Highland

Re: @staticmethod or def function()?

2018-10-31 Thread Rob Gaddi
. It should be a stand-alone function if it provides stand-alone functionality. The decision is also almost certainly not worth the amount of thought you're giving it. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above

Important Language Choice Considerations

2018-10-18 Thread Rob Gaddi
https://boingboing.net/2018/10/15/python-falls-from-ceiling-in-b.html Say what you want about performance and linguistic elegance, but Julia almost never falls in through the ceiling. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out

Re: Overwhelmed by the Simplicity of Python. Any Recommendation?

2018-10-12 Thread Rob Gaddi
optimized to within an inch of its life, well so be it. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Object-oriented philosophy

2018-09-06 Thread Rob Gaddi
merely ask... -- Thomas Suddenly I'm filled with visions of pipe, fittings, and a herpetology degree. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about floating point

2018-08-28 Thread Rob Gaddi
t is order of magnitude. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: regex pattern to extract repeating groups

2018-08-27 Thread Rob Gaddi
ementtree.html instead. Everything will just work. You'll be happier and more productive, with a brighter smile and glossier coat. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking whether type is None

2018-07-24 Thread Rob Gaddi
simply saying "is None". There are no other instances of NoneType. Don't try type-checking None; just check if the object is None. ChrisA I suppose one valid usage would be this sort of thing: fn = { int: dispatchInt, str: dispatchStr, list: dispatchLis

Re: Something new which all programmers world wide will appreciate

2018-06-27 Thread Rob Gaddi
pizzas in the future ! ;) =D Bye, Skybuck. Or, you know, someone didn't bother putting limit checks in and a time out of 20 the thing gets lost and starts putting the sauce directly on the customer. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain

Re: configparser v/s file variables

2018-06-27 Thread Rob Gaddi
rary code in my environment?" -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python list vs google group

2018-06-15 Thread Rob Gaddi
is TWAIN Really? I always thought it didn't scan. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Override built in types... possible? or proposal.

2018-05-31 Thread Rob Gaddi
o strings? Not everything has to be an object method. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pink Floyd: is there anybody in here?

2018-05-30 Thread Rob Gaddi
On 05/30/2018 09:34 AM, Paul Rubin wrote: I think Usenet posts are no longer getting forwarded to the mailing list, but now I wonder if this is getting out at all, even to usenet. Does anyone see it? Can't speak for the mailing list, but this came out to Usenet just fine. -- Rob Gaddi

Re: List replication operator

2018-05-25 Thread Rob Gaddi
On 05/25/2018 10:13 AM, bartc wrote: On 25/05/2018 17:58, Rob Gaddi wrote: So, in the spirit of explicit being better than implicit, please assume that for actual implementation replicate would be a static method of actual list, rather than the conveniently executable hackjob below. _list

Re: List replication operator

2018-05-25 Thread Rob Gaddi
[[0, 0], [0, 0], [0, 0]] >>> d[0][0] = 5 >>> d [[5, 0], [0, 0], [0, 0]] """ if n: this = n[-1] future = n[:-1] return [ list.replicate(*future, fill=fill, call=call) for _ in range(this) ] elif fi

Re: List replication operator

2018-05-24 Thread Rob Gaddi
w they needed the special operator. [[] for _ in range(5)] works just as well without adding more syntax. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: how to get INDEX count, or last number of Index

2018-05-23 Thread Rob Gaddi
numerating over the string just to get the last index. If what you want is the current index, though, you can look at the enumerate function s='kitti' for i, c in enumerate(s): print(i, ':', c) -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is cur

Re: Numpy array

2018-05-21 Thread Rob Gaddi
ing with 0 and ending before 10, and columns to everything. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Print Failure or success based on the value of the standalone tool

2018-05-10 Thread Rob Gaddi
n.org/3/library/subprocess.html is your friend. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-10 Thread Rob Gaddi
it meant, so I typed in:    print (...) and it displayed:    Ellipsis which wasn't very enlightening. No, but if you ever have difficulty remembering how to spell "ellipsis", it's good to know Python comes with a built-in reference. -- Rob Gaddi, Highland Technology -- www.highlandtechno

Re: Looking for advice

2018-04-20 Thread Rob Gaddi
will give you all manner of initial bootstrap issues. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: RE newbie question

2018-04-18 Thread Rob Gaddi
ent solutions to only a very specific complexity of problem. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: try-except syntax

2018-04-05 Thread Rob Gaddi
hrough kicks in (the slightly non-identical case) is often the source of disastrous code errors. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pip Version Confusion

2018-03-26 Thread Rob Gaddi
--user for yourself, or are you using sudo to install it systemwide. Because 'sudo which pip' is probably still pointed to the APT installed one. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https

Re: Writing a C extension - borrowed references

2018-03-20 Thread Rob Gaddi
n. I'm not writing an API to these libraries, just a few functions. Cheers Tom If all you're doing is a thin-wrapper around a C library, have you thought about just using ctypes? -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See

Re: Thank you Python community!

2018-03-19 Thread Rob Gaddi
in greenbar paper ... "Look, you can make a filter out of the pinfeed!" -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Context manager on method call from class

2018-03-15 Thread Rob Gaddi
ger. Then you just use the @contextmanager decorator on a function, have it set up, yield the context you want, and clean up after. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mail

Re: I found strange thing while studying through idle

2018-03-09 Thread Rob Gaddi
case in the modern (Py3) age for '\r'? I use b'\r' fairly regularly when talking to serial port devices. But the string version? -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman

Re: Unnoticed traceback in a thread (Posting On Python-List Prohibited)

2018-03-08 Thread Rob Gaddi
code is exactly the circumstance where Python threading lets you down. It really shines when you're I/O-bound. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: RFC: Proposal: Deterministic Object Destruction (Posting On Python-List Prohibited)

2018-03-01 Thread Rob Gaddi
with intelligent cyclical reference breaking. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is there are good DRY fix for this painful design pattern?

2018-02-26 Thread Rob Gaddi
quot; from the rest of them. Yeah, **kwargs is clumsy, but it gets the job done. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to work on a package

2018-02-07 Thread Rob Gaddi
On 02/07/2018 03:17 PM, Grant Edwards wrote: On 2018-02-07, Rob Gaddi <rgaddi@highlandtechnology.invalid> wrote: When I'm working on a module, the trick is to write a setup.py (using setuptools) from the very get-go. Before I write a single line of code, I've got a setup.py and the dir

Re: How to work on a package

2018-02-07 Thread Rob Gaddi
, I've got a setup.py and the directory framework. Then you install the package using pip -e (or in practice --user -e). That's the missing piece. That way you can import your module from the interpreter, because it's now on the path, but its physical location is right there where you left it, compl

Re: pip --user by default

2018-01-15 Thread Rob Gaddi
the difference between a --user install and a system one? -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Native object exposing buffer protocol

2018-01-08 Thread Rob Gaddi
On 01/05/2018 04:27 PM, Ben Finney wrote: Rob Gaddi <rgaddi@highlandtechnology.invalid> writes: I'd like to create a native Python object that exposes the buffer protocol. Basically, something with a ._data member which is a bytearray that I can still readinto, make directly into a

Native object exposing buffer protocol

2018-01-05 Thread Rob Gaddi
that should be doable easily without having to throw around a lot of extraneous copies. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python goto

2018-01-02 Thread Rob Gaddi
etc. Though it appears some wag has used function decorators to implement goto statements: https://pypi.python.org/pypi/goto-statement/1.1 Rather clever, it seems. Skip If only all that power had been used for good instead of evil... -- Rob Gaddi, Highland Technology -- www.highlandtechnolo

Re: property decorator?

2017-12-20 Thread Rob Gaddi
he new method to the "_setter" of that property instance and returns the updated property, which is assigned redundantly to the variable name foobar. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Learning

2017-12-18 Thread Rob Gaddi
On 12/18/2017 01:52 PM, Gene Heskett wrote: On Monday 18 December 2017 16:05:10 Rob Gaddi wrote: On 12/18/2017 08:45 AM, Larry Martell wrote: On Mon, Dec 18, 2017 at 11:33 AM, Marko Rauhamaa <ma...@pacujo.net> wrote: However, one great way to stand out is a portfolio of GitHub pr

Re: Python Learning

2017-12-18 Thread Rob Gaddi
to see some kind of portfolio, just as a bar of "This is what I consider my good work to be." The idea that someone is going to have years of experience, but not a single page of code that they can let me look over always strikes me as odd. -- Rob Gaddi, Highland Technology -- www.hi

Re: Easiest way to access C module in Python

2017-11-07 Thread Rob Gaddi
ctypes. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: h5py.File() gives error message

2017-10-24 Thread Rob Gaddi
sage? Is it h5py.File() or is it my file? Everything seems pretty simple, what's going on? Thank you! Be 100% sure your directory is correct. Try it again with an absolute path to the file. Windows makes it far too easy for the working directory of a program to be other than what you thin

Re: I used list, def. why li += [100,200] , and li = li + [100,200] is different

2017-10-23 Thread Rob Gaddi
you take the existing value that "li" refers to [1,2,3,4,5], create a new object that is ([1,2,3,4,5] + [100,200]), and reassign the local reference "li" to point to that new object. Then your function ends, "li" goes out of scope, nothing points to that newly created

Re: Is there a function of ipaddress to get the subnet only from input like 192.168.1.129/25

2017-10-17 Thread Rob Gaddi
is a built in module so there are less dependencies. Any ideas? You mean, other than .split('/')? -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Line terminators in Python?

2017-09-29 Thread Rob Gaddi
ver needed to explicitly worry about '\r' is communicating over sockets or serial ports to devices. And in those cases you need to stuff them with bytes rather than str anyhow, so you're already down in the gory bits. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email addr

Re: Real Programmers Write Docs

2017-09-28 Thread Rob Gaddi
On 09/27/2017 04:15 PM, Ned Batchelder wrote: On 9/27/17 6:55 PM, Rob Gaddi wrote: Anyone have any good references on using Sphinx to generate a mix of autogenerated API docs and hand-written "Yeah, but this is what you DO with it" docs?  Free is good but I'm happy to drop mone

Real Programmers Write Docs

2017-09-27 Thread Rob Gaddi
Anyone have any good references on using Sphinx to generate a mix of autogenerated API docs and hand-written "Yeah, but this is what you DO with it" docs? Free is good but I'm happy to drop money on books if they're worthwhile. -- Rob Gaddi, Highland Technology -- www.highlandtech

Re: Boolean Expressions

2017-09-26 Thread Rob Gaddi
(not xor) operation, a fairly rare usage case. Python doesn't even provide an operator for that, the closest thing would be (bool(x) == bool(y)). "And" means "and". This is true AND that is true. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address

Re: How do I check all variables returned buy the functions exists

2017-09-15 Thread Rob Gaddi
2.7 Regards, Ganesh Don't unpack them yet, you still want them to be aggregated. vals = return_x_values() if all(vals): v1, v2, v3 = vals print "all values true" else: print "at least one false value" -- Rob Gaddi, Highland Technology -- www.highlandtechnology.

Re: Exponential Smoothing program

2017-08-31 Thread Rob Gaddi
, Matplotlib and, if you're going to be doing stocks, Pandas. There's a LOT there between them, it's a bit of a drink from the firehose problem. I like Wes McKinney's "Python for Data Analysis" book and consider it a good investment if you need to get up to speed on this stuff. -- Rob

Re: Nesting concurrent.futures.ThreadPoolExecutor

2017-07-20 Thread Rob Gaddi
ing that B is supposed to do (such as completing a Future), but due to the thread limit of the pool, the mere existence of A is preventing B from being executed, and you have a deadlock. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order.

Re: pyserial and end-of-line specification

2017-07-19 Thread Rob Gaddi
asy to integrate logging, retries, integrating "*OPC?" handshakes, whatever sort of things turn out to be necessary on a given device. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to assert unit test cases with many conditions

2017-07-19 Thread Rob Gaddi
that test2 is even doing its job? Why is this superior to writing five tests, all of which always run? Note that "runtime" is not a valid answer unless you're talking about multiple minutes of it. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email addr

Re: Best way to assert unit test cases with many conditions

2017-07-18 Thread Rob Gaddi
h the butt of a screwdriver. -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See above to fix. -- https://mail.python.org/mailman/listinfo/python-list

Re: Users of namedtuple: do you use the _source attribute?

2017-07-17 Thread Rob Gaddi
mentation that calls type() directly rather than having to exec. I know that exec-gunshyness is overblown, but is there a simple answer as to why it's necessary here? -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address domain is currently out of order. See ab

Re: Development testing without reinstalling egg constantly?

2017-06-29 Thread Rob Gaddi
or reason; just a collection of stuff and if you do all the stuff then magic. Eggs and wheels and twine make me feel like I'm playing the world's worst Settlers of Catan knockoff every time I try to make a project all pretty, and the XKCD 927 factor is in full and glorious effect. -- Rob Gaddi

Project Structure

2017-06-19 Thread Rob Gaddi
and paging the reST to the terminal. And, more the point, this all feels VERY tangled. Like there's something that other people just know to do and I missed the memo. Anyone have any ideas on a cleaner implementation? -- Rob Gaddi, Highland Technology -- www.highlandtechnology.com Email address

  1   2   3   >