What kind of "thread safe" are deque's actually?

2023-03-27 Thread Travis Griggs
A while ago I chose to use a deque that is shared between two threads. I did so because the docs say: "Deques support thread-safe, memory efficient appends and pops from either side of the deque with approximately the same O(1) performance in either direction.” (https://docs.python.org/3.11/lib

mapLast, mapFirst, and just general iterator questions

2022-06-14 Thread Travis Griggs
I want to be able to apply different transformations to the first and last elements of an arbitrary sized finite iterator in python3. It's a custom iterator so does not have _reversed_. If the first and last elements are the same (e.g. size 1), it should apply both transforms to the same element

Polymorphic imports

2021-09-21 Thread Travis Griggs
I guess this is kind of like mocking for testing. I have a simple module that's imported in a number of other spots in my program. There's a condition in the OS/filesystem where I'd like to import a polymorphically compatible variant of the same module. Can this be accomplished in a sort of once

Re: Fun Generators

2021-04-23 Thread Travis Griggs
> On Apr 23, 2021, at 05:55, Frank Millman wrote: > > On 2021-04-23 7:34 AM, Travis Griggs wrote: >> Doing an "industry experience" talk to an incoming class at nearby >> university tomorrow. Have a couple points where I might do some "fun things"

Fun Generators

2021-04-22 Thread Travis Griggs
Doing an "industry experience" talk to an incoming class at nearby university tomorrow. Have a couple points where I might do some "fun things" with python. Said students have been learning some python3. I'm soliciting any *fun* generators people may have seen or written? Not so much the cool o

Re: Canonical conversion of dict of dicts to list of dicts

2021-03-30 Thread Travis Griggs
> On Mar 30, 2021, at 12:11, Stestagg wrote: > > For completeness, from 3.5 onwards, you can also do the following: > > [{'name': n, **d} for n, d in dod.items()] > Reading through these, personally I like this one best. I'm curious what about it was enabled in 3.5? Was **kwarg expansion in

Code Formatter Questions

2021-03-28 Thread Travis Griggs
I've been looking into using a code formatter as a code base size has grown as well as contributing developers. I've found and played with autopep, black, and yapf. As well as whatever pycharm has (which may just be gui preferences around one of those 3). I have 2 questions: 1) Are there any ma

How do/can I generate a PKCS#12 file the cryptography module?

2019-02-13 Thread Travis Griggs
I’m using the cryptography module (https://cryptography.io/en/latest/) to try and generate some cert/key/identities. It's pretty easy using said module to generate the contents of .pem file for a private key: keyPEMBytes = privateKey.private_bytes( encoding=serialization.Encoding.P

More elegant way to avoid this hacky implementation of single line reduce for grouping a collection?

2019-01-25 Thread Travis Griggs
Yesterday, I was pondering how to implement groupby, more in the vein of how Kotlin, Swift, Objc, Smalltalk do it, where order doesn’t matter. For example: def groupby(iterable, groupfunc): result = defaultdict(list) for each in iterable: result[groupfunc(each)].ap

Google weirdness

2018-07-12 Thread Travis McGee
I somehow managed to trigger the dialog below by typing in a certain Python phrase to Google. Anyone know what it's about? It shows up in what appears to be terminal screen. Viz: Google has a code challenge ready for you. Been here before? This invitation will expire if you close this page.

Simplest way to clobber/replace one populated directory with another?

2018-05-15 Thread Travis Griggs
I have a directory structure that might look something like: Data Current A B C Previous A X In as simple/quick a step as possible, I want to rename Current as Previous including the contents and wiping out the or

Re: Most pythonic way to implement byte stuffing algorithm

2018-04-17 Thread Travis Griggs
> On Apr 17, 2018, at 11:15 AM, MRAB wrote: > > On 2018-04-17 17:02, Travis Griggs wrote: >> I posted this on SO, but… yeah… >> I'm doing some serial protocol stuff and want to implement a basic byte >> stuffing algorithm in python. Though really what this re

Most pythonic way to implement byte stuffing algorithm

2018-04-17 Thread Travis Griggs
I posted this on SO, but… yeah… I'm doing some serial protocol stuff and want to implement a basic byte stuffing algorithm in python. Though really what this really generalizes to is “what is the most pythonic way to transform one sequence of bytes where some bytes are passed through 1:1, but

Re: Why doesn't Python include non-blocking keyboard input function?

2016-10-25 Thread Travis Griggs
> On Oct 25, 2016, at 5:55 AM, Chris Angelico wrote: > > On Tue, Oct 25, 2016 at 11:45 PM, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> On Tue, Oct 25, 2016 at 11:09 PM, Marko Rauhamaa wrote: Blocking calls are evil. >>> >>> Oh, that's why. Got it. So because blocking calls are fund

Re: Why don't we call the for loop what it really is, a foreach loop?

2016-09-14 Thread Travis Griggs
> On Sep 13, 2016, at 13:57, rgrigo...@gmail.com wrote: > > It would help newbies and prevent confusion. for each in ['cake'] + ['eat', 'it'] * 2: print(each) -- https://mail.python.org/mailman/listinfo/python-list

Re: Learning Python (or Haskell) makes you a worse programmer

2016-03-31 Thread Travis Griggs
> On Mar 30, 2016, at 2:36 PM, Gregory Ewing > wrote: > > Tim Golden wrote: > >> (I don't know how other English-speaking groups say the word, but in >> England the first syllable is stressed and the second is the >> conventional short "uh" sound). > > I can attest that New Zealand follows th

How to fix my imports/file structure

2016-01-20 Thread Travis Griggs
I wrote a simple set of python3 files for emulating a small set of mongodb features on a 32 bit platform. I fired up PyCharm and put together a directory that looked like: minu/ client.py database.py collection.py test_client.py test_database.py test_client.py My imports

Re: When I need classes?

2016-01-11 Thread Travis Griggs
> On Jan 10, 2016, at 9:48 AM, 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 feasible

Confused by python-dbus weird behavior

2016-01-11 Thread Travis Griggs
This may not be a great list for this question (which would be?); it’s a big group, and I’m hoping there’s some people here that cross into these same areas. I’m new to dbus, it seems it’s a sort of CORBA for the Linux world. :) Python seems to be a popular way to interact with it. I’m trying to

Re: Simplest/Idiomatic way to count files in a directory (using pathlib)

2015-06-22 Thread Travis Griggs
Subject nearly says it all. If i’m using pathlib, what’s the simplest/idiomatic way to simply count how many files are in a given directory? I was surprised (at first) when len(self.path.iterdir()) didn’t work. I don’t see anything in the .stat() object that helps me. I could of course

Simplest/Idiomatic way to count files in a directory (using pathlib)

2015-06-22 Thread Travis Griggs
Subject nearly says it all. If i’m using pathlib, what’s the simplest/idiomatic way to simply count how many files are in a given directory? I was surprised (at first) when len(self.path.iterdir()) I don’t say anything on the in the .stat() object that helps me. I could of course do the 4

Concatenating Strings

2015-04-09 Thread Travis Griggs
I was doing some maintenance now on a script of mine… I noticed that I compose strings in this little 54 line file multipole times using the + operator. I was prototyping at the time I wrote it and it was quick and easy. I don’t really care for the way they read. Here’s 3 examples: if k + ‘

Re: MicroPython 1.4.1 released

2015-04-09 Thread Travis Griggs
> On Apr 4, 2015, at 4:43 PM, Damien George wrote: > > Hello everyone, > > We are pleased to announce the release of MicroPython version 1.4.1! > > MicroPython is an implementation of Python 3.4 which is optimised for > systems with minimal resources, including microcontrollers. > > Since our

Re: [SerialConnection] Help

2015-04-09 Thread Travis Griggs
> On Apr 7, 2015, at 8:42 AM, Hugo Caldas wrote: > > read and write the port values with multi threading Care to elaborate what you mean by this part? In general, serial ports and multi threading don’t mix well. IOW, you’ll need to use multithreading pieces to make sure you serialize your a

Re: Newbie looking for elegant solution

2015-03-25 Thread Travis Griggs
> On Mar 24, 2015, at 8:28 PM, Chris Angelico wrote: > > On Wed, Mar 25, 2015 at 2:13 PM, wrote: >> I have a list containing 9600 integer elements - each integer is either 0 or >> 1. >> >> Starting at the front of the list, I need to combine 8 list elements into 1 >> by treating them as if

Re: Python Worst Practices

2015-03-02 Thread Travis Griggs
> On Mar 1, 2015, at 5:53 PM, Dennis Lee Bieber wrote: > > On Sun, 1 Mar 2015 20:16:26 + (UTC), alister > declaimed the following: > >> >> The language is called English, the clue is in the name. interestingly >> most 'Brits' can switch between American English & English without too >>

Re: Python Worst Practices

2015-02-27 Thread Travis Griggs
> On Feb 25, 2015, at 12:45 PM, Mark Lawrence wrote: > > http://www.slideshare.net/pydanny/python-worst-practices > > Any that should be added to this list? Any that be removed as not that bad? I read ‘em. I thought they were pretty good, some more than others. And I learned some things. I e

Re: Pyston 0.3 self-hosting

2015-02-27 Thread Travis Griggs
> On Feb 24, 2015, at 9:47 PM, Steven D'Aprano > wrote: > > Pyston 0.3, the latest version of a new high-performance Python > implementation, has reached self-hosting sufficiency: > > > http://blog.pyston.org/2015/02/24/pyston-0-3-self-hosting-sufficiency/ > Does it do python3.4 yet? -- h

Re: Python & Peewee Query Example Needed

2015-02-16 Thread Travis VanDame
On Monday, February 16, 2015 at 12:35:00 PM UTC-6, Travis VanDame wrote: > I'm new to python and peewee and was looking for an example on how to query a > mysql table with a datetime column only returning rows that are 30 days old. Well this is what I've come up with @cla

Python & Peewee Query Example Needed

2015-02-16 Thread Travis VanDame
I'm new to python and peewee and was looking for an example on how to query a mysql table with a datetime column only returning rows that are 30 days old. -- https://mail.python.org/mailman/listinfo/python-list

Re: pymongo and attribute dictionaries

2015-02-04 Thread Travis Griggs
> On Feb 4, 2015, at 9:22 AM, Ian Kelly wrote: > > On Wed, Feb 4, 2015 at 9:50 AM, Travis Griggs wrote: >> I really like pymongo. And I really like Python. But one thing my fingers >> really get tired of typing is >> >> someDoc[‘_’id’] >> >> Thi

pymongo and attribute dictionaries

2015-02-04 Thread Travis Griggs
I really like pymongo. And I really like Python. But one thing my fingers really get tired of typing is someDoc[‘_’id’] This just does not roll of the fingers well. Too many “reach for modifier keys” in a row. I would rather use someDoc._id Googling shows that I’m not the first to want to do

Re: Cairo module

2015-02-03 Thread Travis Griggs
> On Feb 3, 2015, at 1:00 PM, Poul Riis wrote: > > I just tried the Cairo Python module. > I ran the test file below. > It works perfectly but instead of saving the resulting image as a file I want > to see it displayed directly on the screen. > How can I do that? > I have quiet a bit of expe

Re: Is there a cairo like surface for the screen without the window hassle

2015-02-03 Thread Travis Griggs
> On Feb 2, 2015, at 5:20 AM, Antoon Pardon > wrote: > > I need to have a program construct a number of designs. Of course I can > directly > use a pfd surface and later use a pdf viewer to check. But that becomes rather > cumbersome fast. But if I use a cairo-surface for on the screen I sudde

Re: FYI: Micro Python running on kickstarter pyBoard project, now shipping

2014-10-23 Thread Travis Griggs
> On Oct 23, 2014, at 2:11 PM, sohcahto...@gmail.com wrote: > > On Thursday, October 23, 2014 10:07:26 AM UTC-7, jkn wrote: >> Hi all >>I haven't heard in mentioned here, but since I saw one of the boards >> today thought I'd pass on the news: >> >> The Kickstarter 'MicroPython' project, wh

Re: Toggle

2014-10-08 Thread Travis Griggs
gle(self): return Red() Blue().toggle().toggle().toggle().toggle().toggle() :) -- Travis Griggs Objologist "Some of them wanted to sell me snake oil and I'm not necessarily going to dismiss all of these, as I have never found a rusty snake." --Terry Pratchett -- https://mail.python.org/mailman/listinfo/python-list

Re: How to show a dictionary sorted on a value within its data?

2014-10-01 Thread Travis Griggs
Sent from my iPhone > On Oct 1, 2014, at 04:12, Peter Otten <__pete...@web.de> wrote: > > `lambda` is just a fancy way to define a function inline Not sure "fancy" is the correct adjective; more like syntactic tartness (a less sweet version of syntactic sugar). :) -- https://mail.python.org

Re: Python stdout goes where under systemd? (Was: Example of python service running under systemd?)

2014-09-12 Thread Travis Griggs
On Sep 12, 2014, at 12:05 PM, Travis Griggs wrote: > Thanks all for the help/advice. I’m getting there. > > To experiment/learn, I made a simple python program (/Foo/cyclic.py): > >#!/usr/bin/env python3 > >import time > >while True: >time

Python stdout goes where under systemd? (Was: Example of python service running under systemd?)

2014-09-12 Thread Travis Griggs
Thanks all for the help/advice. I’m getting there. To experiment/learn, I made a simple python program (/Foo/cyclic.py): #!/usr/bin/env python3 import time while True: time.sleep(5) with open('sound', 'r') as file: currentValue = file.read() o

Re: Example of python service running under systemd?

2014-09-11 Thread Travis Griggs
On Sep 11, 2014, at 2:29 PM, Ervin Hegedüs wrote: > Hi Travis, > > On Thu, Sep 11, 2014 at 02:06:48PM -0700, Travis Griggs wrote: >> >> On Sep 11, 2014, at 11:18 AM, Chris “Kwpolska” Warrick >> wrote: >> >>> Depends what you want. >> >

Re: Example of python service running under systemd?

2014-09-11 Thread Travis Griggs
On Sep 11, 2014, at 11:18 AM, Chris “Kwpolska” Warrick wrote: > Depends what you want. Mine is not a web service. My main.py looks like this: #!/usr/bin/env python3 import cycle import pushTelemetry from threading import Thread def main(): Thread(target=pushTelemetry.udpLoop).start()

Example of python service running under systemd?

2014-09-11 Thread Travis Griggs
I’ve been reading lots of systemd docs. And blogs. Etc. At this point, I think I would benefit from learning by example… Does anyone have an example .service file that they use to launch a long running service written as a python program? If there is any example of what you changed to your pyth

Re: Newer Debian versions of python on older Debian distros?

2014-09-11 Thread Travis Griggs
On Sep 8, 2014, at 5:06 PM, Chris Angelico wrote: > Alternatively, you could just run Debian Jessie. I have a few Jessie > systems on the network, with a Python 3.4 IIRC, and there've been no > stability problems lately. Both options are pretty easy. In the end, we were able to get jessie runnin

Newer Debian versions of python on older Debian distros?

2014-09-08 Thread Travis Griggs
(I realize that this may be seen as off topic for as a general python question, but given my historical experience with the Debian community’s predilection to answer all questions with a grumpy “go read the very very very very large and ever shifting fine manual”, I’m hoping for better luck here

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-22 Thread Travis Griggs
On Aug 21, 2014, at 12:55 AM, icefap...@gmail.com wrote: > Hi, just wanting to do a shot in the dark,but maybe this syntax is Pythonic > (in a "we-are-all-grown-ups" fashion, ahem)enough to get its way into the > language > this is what yours truly thinks: don't we all know that ":" means the n

Halfway point between interactive and daemon?

2014-08-22 Thread Travis Griggs
I have a python3 program that performs a long running service on a semi embedded linux device. I've been in the prototyping stage. I just run it from the command line and use print() statements to let me know the thing is making acceptable process. At some point, I need to properly daemonize i

Re: TypeError: 'bytes' object is not callable error while trying to converting to bytes.

2014-08-05 Thread Travis Griggs
> On Aug 4, 2014, at 22:57, Chris Angelico wrote: > > On Tue, Aug 5, 2014 at 3:47 PM, Satish ML wrote: > bytes = file.read() > > You've just shadowed the built-in type 'bytes' with your own 'bytes'. > Pick a different name for this, and you'll be fine. 'data' would work. Until python4 in

Re: PEP8 and 4 spaces

2014-07-05 Thread Travis Griggs
bar, >baz, >) Ok, here's irony. I'm looking at that thinking "what the heck is he talking about?!?". And then my brain catches up. My mail reader is of course "modern" and does not use a mono space font. So the value of the along ed indent is los

Re: Micro Python -- a lean and efficient implementation of Python 3

2014-06-06 Thread Travis Griggs
On Jun 4, 2014, at 4:01 AM, Tim Chase wrote: > If you use UTF-8 for everything It seems to me, that increasingly other libraries (C, etc), use utf8 as the preferred string interchange format. It’s universal, not prone to endian issues, etc. So one *advantage* you gain for using utf8 internall

Re: OT: This Swift thing

2014-06-05 Thread Travis Griggs
> On Jun 5, 2014, at 1:14, Alain Ketterlin wrote: > > Swift's memory management is similar to python's (ref. counting). Which > makes me think that a subset of python with the same type safety would > be an instant success. Except that while you don't need to regularly worry about cycles in py

Re: IDE for python

2014-05-29 Thread Travis Griggs
> On May 28, 2014, at 3:43, Sameer Rathoud wrote: > > Hello everyone, > > I am new to python. > > I am currently using python 3.3 > > With python I got IDLE, but I am not very comfortable with this. > > Please suggest, if we have any free ide for python development. > -- > https://mail.pyt

Re: How keep Python 3 moving forward

2014-05-24 Thread Travis Griggs
Sent from my iPhone > On May 24, 2014, at 7:35, blindanagram wrote: > >> On 24/05/2014 08:13, wxjmfa...@gmail.com wrote: >> Le vendredi 23 mai 2014 22:16:10 UTC+2, Mark Lawrence a écrit : >>> An article by Brett Cannon that I thought might be of interest >>> >>> http://nothingbutsnark.svbtle

Why does isoformat() optionally not print the fractional seconds?

2014-04-22 Thread Travis Griggs
Python(3) let me down today. Better to be explicit, and all that, didn’t pan out for me. I have time series data being recorded in a mongo database (I love pymongo). I have an iOS app that consumes the data. Since JSON doesn’t have a time format, I have to stringify the times when transmitting

Re: test

2014-03-15 Thread Travis Griggs
> On Mar 15, 2014, at 14:24, Mark H Harris wrote: > > test Pass -- https://mail.python.org/mailman/listinfo/python-list

Re: Functions help

2014-02-23 Thread Travis Griggs
> On Feb 23, 2014, at 17:09, Mark Lawrence wrote: > > For the benefit of newbies, besides the obvious indentation error above, the > underscore basically acts as a dummy variable. I'll let the language lawyers > give a very detailed, precise description :) You mean a dummy name binding, rig

Re: Can global variable be passed into Python function?

2014-02-21 Thread Travis Griggs
On Feb 21, 2014, at 4:13 AM, Ned Batchelder wrote: > Man, do I hate this idea that Python has no variables. It has variables > (names associated with values, and the values can change over the course of > the program), they just don't work the same as C or Fortran variables. In > fact, they w

Re: Remove comma from tuples in python.

2014-02-21 Thread Travis Griggs
On Feb 21, 2014, at 6:32 AM, Roy Smith wrote: > In article , > Peter Otten <__pete...@web.de> wrote: > > >> [x*x for (x,) in lst] >> >> [paraphrasing...] can be better written as: >> >> [x*x for [x] in items] > > I'm torn between, "Yes, the second form is distinctly easier to read" > and,

Re: The sum of numbers in a line from a file

2014-02-20 Thread Travis Griggs
ility. Sorry Dave, couldn’t resist. Clearly a balance between extremes is desirable. (Mark, I intentionally put the blank lines in this time ) Travis Griggs "“Every institution tends to perish by an excess of its own basic principle.” — Lord Acton -- https://mail.python.org/mailman/listinfo/python-list

Fun with function argument counts

2014-02-11 Thread Travis Griggs
After the recent discussion about the classic error: if self.isFooBar: return 42 Among many thing, the OPs contention was that the ability to have this kind of error was a Bad Thing (tm). Which led to me asking about code smells and parameterless functions/methods. So I got curious. Semantic

Metaprogramming question

2014-02-11 Thread Travis Griggs
The discussion about niladic functions, made me want to follow a segue and do some reflection/introspective programming in Python. I’ve not done a lot of that yet, and it seemed like an educational (well, at least entertaining) goose chase. If I run the following code: import datetime datetime

Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!)

2014-02-11 Thread Travis Griggs
On Feb 11, 2014, at 7:52 AM, Chris Angelico wrote: > On Wed, Feb 12, 2014 at 2:36 AM, Travis Griggs wrote: >> OTOH, I’m not sure I’ve heard the parameters-less functions are a code one? >> Is it just loose functions that you’re referring to? As opposed to methods >>

Re: PyWart: More surpises via "implict conversion to boolean" (and other steaming piles!)

2014-02-11 Thread Travis Griggs
On Feb 10, 2014, at 10:30 PM, Steven D'Aprano wrote: >> >>1. Parenthesis should not be required for parameter- less functions. > > Of course they should. Firstly, parameter-less functions are a code- > smell, and ought to be discouraged. Secondly, even if you have a good > reason for usin

Re: Python 3.x adoption

2014-01-21 Thread Travis Griggs
Looks like the 2/3 topic has lain fallow for a couple of days, gotta keep it burning… I’m a relatively recent python convert, but been coding and talking to others about coding for many moons on this big blue orb. I think the industrial side of this debate has been talked up quite a bit. We ha

Re: 'Straße' ('Strasse') and Python 2

2014-01-16 Thread Travis Griggs
On Jan 16, 2014, at 2:51 AM, Robin Becker wrote: > I assure you that I fully understand my ignorance of ... Robin, don’t take this personally, I totally got what you meant. At the same time, I got a real chuckle out of this line. That beats “army intelligence” any day. -- https://mail.

Re: 'Straße' ('Strasse') and Python 2

2014-01-15 Thread Travis Griggs
On Jan 15, 2014, at 4:50 AM, Robin Becker wrote: > On 15/01/2014 12:13, Ned Batchelder wrote: > >>> On my utf8 based system >>> >>> robin@everest ~: $ cat ooo.py if __name__=='__main__': import sys s='A̅B' print('version_info=%s\nlen(%s)=%d' % (s

Re: Python 3.x adoption

2014-01-15 Thread Travis Griggs
Here we go again… On Jan 14, 2014, at 11:33 AM, Staszek wrote: > Hi > > What's the problem with Python 3.x? It was first released in 2008, but > web hosting companies still seem to offer Python 2.x rather. > > For example, Google App Engine only offers Python 2.7. > > What's wrong?... Maybe

PySerial for Python 2 vs. Python 3

2013-12-31 Thread Travis McGee
a non-issue. However, I'd be interested to hear from anyone who can comment on what the problem is. Thanks, Travis -- https://mail.python.org/mailman/listinfo/python-list

Python in the news

2013-12-27 Thread Travis McGee
From Twitter: RT @cjbrummitt Python kills security guard at Sanur Hyatt, Bali (Ind). bit.ly/1fLCWvn < bad coding has CONSEQUENCES, ppl! -- https://mail.python.org/mailman/listinfo/python-list

So, what's the real story on Python 2 vs Python 3?

2013-12-26 Thread Travis McGee
The Python.org site says that the future is Python 3, yet whenever I try something new in Python, such as Tkinter which I am learning now, everything seems to default to Python 2. By this I mean that, whenever I find that I need to install another package, it shows up as Python 2 unless I expli

Re: cascading python executions only if return code is 0

2013-12-26 Thread Travis Griggs
ute said list”, then… this approach might be appealing. Travis Griggs -- https://mail.python.org/mailman/listinfo/python-list

Re: Newbie question. Are those different objects ?

2013-12-20 Thread Travis Griggs
On Dec 20, 2013, at 8:00 AM, Mark Lawrence wrote: > A good point. Shall I write a PEP asking for a language change which > requires that that stupid = sign is replaced by a keyword reading something > like thenameonthelefthandsideisassignedtheobjectontherighthandside ? Or a symbol like :=. As

Re: grab dict keys/values without iterating ?!

2013-12-11 Thread Travis Griggs
On Dec 11, 2013, at 5:31 AM, rusi wrote: > > The classic data structure for this is the trie: > General idea: http://en.wikipedia.org/wiki/Trie > In python: > http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/ My thoughts exactly! If you wade through the comments ther

Meta Fight About Posting (was: python programming help)

2013-12-09 Thread Travis Griggs
On Dec 9, 2013, at 1:34 AM, Mark Lawrence wrote: > On 09/12/2013 05:07, ru...@yahoo.com wrote: >> On 12/08/2013 05:27 PM, Mark Lawrence wrote: >>> On 09/12/2013 00:08, ru...@yahoo.com wrote: On 12/08/2013 12:17 PM, Chris Angelico wrote: > On Mon, Dec 9, 2013 at 6:06 AM, wrote:>[...] >

Re: Packaging a proprietary Python library for multiple OSs

2013-12-05 Thread Travis Griggs
On Dec 5, 2013, at 2:56 AM, rusi wrote: > 3. https://groups.google.com/forum/#!forum/python-virtualenv may be a better > place to ask Am I the only one that sees the irony in this suggestion? Given the long running tirades^H^H^H^H^H^H thread about “Managing Google Groups headaches”? “Pleasss

Re: Managing Google Groups headaches

2013-12-04 Thread Travis Griggs
On Dec 4, 2013, at 6:52 AM, Rich Kulawiec wrote: > Yes, I'm > aware of web forums: I've used hundreds of them. They suck. They ALL > suck, they just all suck differently. I could spend the next several > thousand lines explaining why, but instead I'll just abbreviate: they > don't handle thre

Re: Python for microcontrollers

2013-12-03 Thread Travis Griggs
On Dec 3, 2013, at 6:18 AM, Colin J. Williams wrote: > On 03/12/2013 7:58 AM, Mark Lawrence wrote: >> I thought this might be of interest >> Http://www.kickstarter.com/projects/214379695/micro-python-python-for-microcontrollers >> >> > Is this intended to be better than the Raspberry PI? RPi

Re: Managing Google Groups headaches

2013-11-28 Thread Travis Griggs
Sent from my iPhone > On Nov 28, 2013, at 7:40, Michael Torrie wrote: > >> On 11/28/2013 08:08 AM, Chris Angelico wrote: >> Which is easier, fiddling around with your setup so you can post >> reasonably on Google Groups, or just getting a better client? With >> your setup, you have to drop out

Re: tkinter bug on mac maverick python 3.3.3

2013-11-27 Thread Travis Griggs
On Nov 27, 2013, at 3:32 AM, Dan Wissme wrote: > Hi ! > Am I the only one to get a bug in GUIs using tkinter on my Mac under maverick > and Python 3.3.3 ? > When will they get rid of Tcl/Tk which causes recurrent problems at almost > each new Python version ! > Please, for the rest of us... I

Re: How to install pip for python3 on OS X?

2013-11-22 Thread Travis Griggs
On Nov 19, 2013, at 11:27 PM, Ned Deily wrote: > In article <6856a21c-57e8-4cdd-a9e8-5dd738c36...@gmail.com>, > Travis Griggs wrote: > >> OSX (Mavericks) has python2.7 stock installed. But I do all my own personal >> python stuff with 3.3. I just flushed my 3.3.

Re: How to install pip for python3 on OS X?

2013-11-22 Thread Travis Griggs
On Nov 20, 2013, at 6:01 AM, Mark Lawrence wrote: > On 20/11/2013 06:55, Travis Griggs wrote: >> OSX (Mavericks) has python2.7 stock installed. But I do all my own >> personal python stuff with 3.3. I just flushed my 3.3.2 install and >> installed the new 3.3.3. So I nee

How to install pip for python3 on OS X?

2013-11-19 Thread Travis Griggs
OSX (Mavericks) has python2.7 stock installed. But I do all my own personal python stuff with 3.3. I just flushed my 3.3.2 install and installed the new 3.3.3. So I need to install pyserial again. I can do it the way I've done it before, which is: Download pyserial from pypi untar pyserial.tgz

What to make of 'make test' for python3 install from source (beaglebone angstrom install).

2013-11-07 Thread Travis Griggs
python developer though. It's too bad there's not a forum "in between" to share/ask for help with these kinds of things. --Travis Griggs "I multiply all estimates by pi to account for running around in circles" -- https://mail.python.org/mailman/listinfo/python-list

Re: Compiling Python3 for BeagleBone Black (Angstrom distro)

2013-11-04 Thread Travis Griggs
On Nov 4, 2013, at 9:22 AM, Travis Griggs wrote: > I'm playing with a BeagleBone Black running the angstrom distro. Of course, > stock python is 2.7, I'd rather use python3. There isn't a python3 package > available for angstrom. So I downloaded the source and compil

Compiling Python3 for BeagleBone Black (Angstrom distro)

2013-11-04 Thread Travis Griggs
;t see is how to generate a list of what FEATURES/PACKAGES I could put there for consideration of omission. Is there some magic juju that generates that? Travis Griggs --I multiply all estimates by tau to account for running around in circles -- https://mail.python.org/mailman/listinfo/python-list

Re: python IDE and function definition

2013-09-24 Thread Travis Griggs
On Sep 23, 2013, at 8:06 AM, Chris Friesen wrote: > > Hi all, > > I'm looking for a python IDE (for Linux) that can look at code like this: > > class ConductorManager(manager.Manager): >def compute_recover(self, context, instance): >self.compute_api.stop(context, instance, do_cast

Re: iterating over a file with two pointers

2013-09-18 Thread Travis Griggs
ied Chris's example input to look like: alpha *beta gamma+ delta epsilon zeta *eta kappa tau pi+ omicron And then shot it with the following: #!/usr/bin/env python3 with open("samplein.txt") as file: reversing = False for line in (raw.strip() for raw in file): if revers

Simple security between prototype iPhone app and SimpleHTTPServer REST service?

2013-09-17 Thread Travis Griggs
er, here's how to take it to the semi secure public level using a real web framework." Travis Griggs -- I multiple all estimates by pi to account from running around in circles. -- https://mail.python.org/mailman/listinfo/python-list

Re: How do I calculate a mean with python?

2013-09-17 Thread Travis Griggs
On Sep 16, 2013, at 4:33 PM, William Bryant wrote: > Hey I am new to python so go easy, but I wanted to know how to make a program > that calculates the maen. > > List = [15, 6, 6, 7, 8, 9, 40] > def mean(): >global themean, thesum >for i in List: >thecount = List.count(i) >

Re: Style help for a Smalltalk-hack

2012-10-23 Thread Travis Griggs
nt that "internal consistency is preferred", we felt justified in marching on. -- Travis Griggs "A vital ingredient of success is not knowing that what you're attempting can't be done." -Terry Pratchett -- http://mail.python.org/mailman/listinfo/python-list

Re: Style help for a Smalltalk-hack

2012-10-23 Thread Travis Griggs
t.unpack('>{}I'.format(valveCount), byteStream.read(4 > * valueCount))) Thanks, both great ideas. Still does the read/decode slightly different between the different sites, but at least it's localized better. Much appreciated. -- Travis Griggs "History has a habit of changing th

Style help for a Smalltalk-hack

2012-10-22 Thread Travis Griggs
ignatures). ] The part that doesn't seem to be there in the standard python library is the idea of an atEnd message for streams, it's inferred as a byproduct of a read(). Please be gentle/kind. I'm still learning. :) TIA -- Travis Griggs "A vital ingredient of success is not k

Reusable (local) Modules

2012-09-07 Thread Travis Griggs
his seems like "the quickest thing that could possibly work", but I'm assuming there's a more pythonic way to approach this general problem. TIA! Travis Griggs "Simplicity is the ultimate sophistication." -- Leonardo Da Vinci -- http://mail.python.org/mailman/listinfo/python-list

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 5:57 pm, Steven D'Aprano wrote: > On Mon, 28 Nov 2011 13:29:06 -0800, Travis Parks wrote: > > Exception handling is one of those subjects few understand and fewer can > > implement properly in modern code. Languages that don't support > > exceptions as

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 8:49 pm, Chris Angelico wrote: > On Tue, Nov 29, 2011 at 11:54 AM, DevPlayer wrote: > > To me, I would think the interpreter finding the coder's intended > > indent wouldn't be that hard. And just make the need for consistant > > spaces or tabs irrevelent simply by reformatting the ind

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 5:24 pm, Steven D'Aprano wrote: > On Mon, 28 Nov 2011 12:32:59 -0700, Ian Kelly wrote: > > On Sun, Nov 27, 2011 at 4:55 PM, Steven D'Aprano > > wrote: > [...] > >>> Lambdas and functions are the same thing in my language, so no need > >>> for a special keyword. > > >> That does not fol

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 3:40 pm, Gregory Ewing wrote: > Travis Parks wrote: > > I thinking tabs are > > out-of-date. Even the MAKE community wishes that the need for tabs > > would go away > > The situation with make is a bit different, because it > *requires* tabs in cer

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 28, 2:32 pm, Ian Kelly wrote: > On Sun, Nov 27, 2011 at 4:55 PM, Steven D'Aprano > > wrote: > >> My language combines generators and collection initializers, instead of > >> creating a whole new syntax for comprehensions. > > >> [| for i in 0..10: for j in 0.10: yield return i * j |] > > >

Re: Using the Python Interpreter as a Reference

2011-11-28 Thread Travis Parks
On Nov 27, 6:55 pm, Steven D'Aprano wrote: > On Sun, 27 Nov 2011 14:21:01 -0800, Travis Parks wrote: > > Personally, I find a lot of good things in Python. I thinking tabs are > > out-of-date. Even the MAKE community wishes that the need for tabs would > > go away and

Re: Using the Python Interpreter as a Reference

2011-11-27 Thread Travis Parks
On Nov 26, 1:53 pm, Rick Johnson wrote: > On Nov 20, 6:46 pm, Travis Parks wrote: > > > Hello: > > > I am currently working on designing a new programming language. It is > > a compiled language, but I still want to use Python as a reference. > > Python has a l

Re: Using the Python Interpreter as a Reference

2011-11-25 Thread Travis Parks
On Nov 22, 1:37 pm, Alan Meyer wrote: > On 11/20/2011 7:46 PM, Travis Parks wrote: > > > Hello: > > > I am currently working on designing a new programming language. ... > > I have great respect for people who take on projects like this. > > Your chances of po

  1   2   3   >