Multiple thread program problem

2015-06-04 Thread Sam Raker
proc(f) isn't a callable, it's whatever it returns. IIRC, you need to do something like 'start_new_thread(proc, (f,))' -- https://mail.python.org/mailman/listinfo/python-list

Online offline Python apps

2015-04-23 Thread Sam Raker
Have you tried a conditional/try-catch block in your __init__? Something like class MyDBConn(object): def __init__(self, **db_kwargs): try: db = some_db.connect(**db_kwargs) except some_db.ConnectionError: db = my_fake_db()

Re: Newbie question about text encoding

2015-02-26 Thread Sam Raker
I'm 100% in favor of expanding Unicode until the sun goes dark. Doing so helps solve the problems affecting speakers of "underserved" languages--access and language preservation. Speakers of Mongolian, Cherokee, Georgian, etc. all deserve to be able to interact with technology in their native la

Re: Array of Functions

2014-11-14 Thread Sam Raker
I second the call for a more concrete implementation, but if you want the results of the functions in c3 to be responsive to the values of c1 and c2 (i.e., if you change r1c1, r1c3 returns a different value), it might be worth encapsulating the whole thing in an object and making the c3 function

Pex import problems

2014-10-21 Thread Sam Raker
Hi all, I'm trying to use Pex (http://pex.readthedocs.org/en/latest/index.html) to include requests in a little script to ping a server from a machine that doesn't come with pip (or much of anything, really) installed. I'm running into problems outputting a pex file that depends on a local script.

Re: Pex import problems

2014-10-21 Thread Sam Raker
On Tuesday, October 21, 2014 12:05:00 PM UTC-4, Chris Angelico wrote: > On Wed, Oct 22, 2014 at 2:34 AM, Sam Raker wrote: > > > (Also: anyone who's planning on chewing me out about formatting: I TRIED > > posting by email to comp.lang.pyt...@googlegroups.com, but it woul

Pex import problems

2014-10-21 Thread Sam Raker
Hi all, I'm trying to use Pex (http://pex.readthedocs.org/en/latest/index.html) to include requests in a little script to ping a server from a machine that doesn't come with pip (or much of anything, really) installed. I'm running into problems outputting a pex file that depends on a local scrip

Re: Storing instances using jsonpickle

2014-09-03 Thread Sam Raker
1) There are, if you want to mess around with them, ways to make pickle "smarter" about class stuff: https://docs.python.org/2/library/pickle.html#pickling-and-unpickling-normal-class-instances . I've never worked with any of this stuff (and people don't seem to like pickle all that much), and