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 a

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 fail

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? If

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 oft

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 co

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. Unfort

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 wil

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. Docum

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 Techn

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

2019-11-14 Thread Rob Gaddi
ls, but that's some low-level stuff 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
terval then 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 T

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

2019-11-13 Thread Rob Gaddi
ormance than threads or 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 th

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

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 Techno

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

2019-11-04 Thread Rob Gaddi
things, then either 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

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 va

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

2019-11-04 Thread Rob Gaddi
ing 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
b 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 t

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

2019-09-03 Thread Rob Gaddi
oes 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
g in iterable:     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

Re: My pseudocode to Python?

2019-08-19 Thread Rob Gaddi
, but otherwise the list should only have six entries - without 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
you do anything 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] A

Re: Nesting Custom Errors in Classes

2019-07-23 Thread Rob Gaddi
aven't I seen it before? Can you see anything 'wrong' with this picture? I've used them sometimes for basic encapsulation principles without really gaining anything. I use inheritance of nested classes in my https://pypi.org/project/indexedproperty/ project, where subclasses o

Re: Pythonic custom multi-line parsers

2019-07-10 Thread Rob Gaddi
rser takes out of the file it passes to self.statefn, which 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
ation', 'version') as well as to pass device handles around, since an open connection to a given piece of physical hardware 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
e 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.

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

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
t wrapper around all 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
Sometimes when I'm feeling lazy it's a convenient way to set defaults 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 d

Re: Using a Variable Inside the String

2019-05-07 Thread Rob Gaddi
comment can't be ignored because it's sitting there flagging your problem. Strings (in single 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 +

Re: Function to determine list max without itertools

2019-04-19 Thread Rob Gaddi
ive? You could, 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 G

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
1:len(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 currentl

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

2019-03-25 Thread Rob Gaddi
n int. Which is only a problem 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

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

2019-02-13 Thread Rob Gaddi
ordering 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 cu

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

2019-01-10 Thread Rob Gaddi
], [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 Techno

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 t

Python, the stack, and the heap

2018-12-17 Thread Rob Gaddi
Python objects 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 G

Re: pandas read_csv

2018-11-09 Thread Rob Gaddi
_libs\parsers.c:28765)() ParserError: Error tokenizing 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.hig

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

2018-11-05 Thread Rob Gaddi
, the most 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

Re: @staticmethod or def function()?

2018-10-31 Thread Rob Gaddi
the context of that class. 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 current

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 of

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

2018-10-12 Thread Rob Gaddi
eatures, or if the performance isn't 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
an really talk about 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
suited in the general case (though can be beaten into sufficiency in specific ones). Use https://docs.python.org/3.6/library/xml.etree.elementtree.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
pe test than in 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,

Re: Something new which all programmers world wide will appreciate

2018-06-27 Thread Rob Gaddi
cious 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

Re: configparser v/s file variables

2018-06-27 Thread Rob Gaddi
x27;t you run your arbitrary 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
mply defining a function in the module that does the things you want done to 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

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
[[{'swallow': 'unladen'}, {}], [{}, {}], [{}, {}]] >>> d = list.replicate(2, 3, fill=0) >>> d [[0, 0], [0, 0], [0, 0]] >>> d[0][0] = 5 >>> d [[5, 0], [0, 0], [0, 0]] """ if n: this

Re: List replication operator

2018-05-24 Thread Rob Gaddi
didn't know 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
faster than enumerating 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

Re: Numpy array

2018-05-21 Thread Rob Gaddi
rting 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
python.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
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.highlandtechnology.com Email ad

Re: Looking for advice

2018-04-20 Thread Rob Gaddi
solutions 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
t bogged down in regexes. They tend to be excellent 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
all-through 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
installing something --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 orde

Re: Writing a C extension - borrowed references

2018-03-20 Thread Rob Gaddi
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 above t

Re: Thank you Python community!

2018-03-19 Thread Rob Gaddi
ed 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
tmanager. 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

Re: I found strange thing while studying through idle

2018-03-09 Thread Rob Gaddi
yone have a use 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.

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

2018-03-08 Thread Rob Gaddi
nsive 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
tion 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
uto-default behavior" 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 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 directory framework. Then you i

Re: How to work on a package

2018-02-07 Thread Rob Gaddi
I write a single line of code, 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 loca

Re: pip --user by default

2018-01-15 Thread Rob Gaddi
#x27;s 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 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 numpy array, etc. The “etc.” seems p

Native object exposing buffer protocol

2018-01-05 Thread Rob Gaddi
something 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
ance stored in variable name foobar. That method assigns the 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 wrote: However, one great way to stand out is a portfolio of GitHub projects. Several people have

Re: Python Learning

2017-12-18 Thread Rob Gaddi
e 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.highlandtec

Re: Easiest way to access C module in Python

2017-11-07 Thread Rob Gaddi
ightforward and I've made it do some very heavy lifting over the years. Cython is definitely more work. SWIG makes sense if you've got a huge number of interfaces you're trying to map and need to automate the process, but if you've got south of 20 I'd just do it n

Re: h5py.File() gives error message

2017-10-24 Thread Rob Gaddi
older with file is there. Why error message? 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 director

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

2017-10-23 Thread Rob Gaddi
The second time, however, 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

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
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
he only time I've ever 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 --

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 mo

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.hi

Re: Boolean Expressions

2017-09-26 Thread Rob Gaddi
would actually be an xnor (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.highla

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

2017-09-15 Thread Rob Gaddi
ser with Python 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

Re: Exponential Smoothing program

2017-08-31 Thread Rob Gaddi
mpy, Scipy, 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 s

Re: Nesting concurrent.futures.ThreadPoolExecutor

2017-07-20 Thread Rob Gaddi
awns B, A blocks on something 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 doma

Re: pyserial and end-of-line specification

2017-07-19 Thread Rob Gaddi
sable code and makes it easy 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
would you ever know 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.highlandtec

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

2017-07-18 Thread Rob Gaddi
trying to drive nails with 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
27;s a straightforward namedtuple implementation 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 addr

Re: Development testing without reinstalling egg constantly?

2017-06-29 Thread Rob Gaddi
nderlying rhyme 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 glorio

Project Structure

2017-06-19 Thread Rob Gaddi
standard way of pretty-printing 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 --

  1   2   3   >