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

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

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: 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

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: 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 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: 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: 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

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: [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: 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

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

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

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: 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: 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: 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

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: 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

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: 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

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: 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()

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

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: 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

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: 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

Python ORMs Supporting POPOs and Substituting Layers in Django

2011-11-05 Thread Travis Parks
bout it. My guess is that there would be a severe penalty for crossing process boundaries... but any insights would be appreciated. Thanks, Travis Parks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python ORMs Supporting POPOs and Substituting Layers in Django

2011-11-05 Thread Travis Parks
On Nov 5, 4:11 pm, Travis Parks wrote: > Hello: > > A new guy showed up at work a few weeks ago and has started talking > about replacing a 6 month old project, written in ASP.NET MVC, with an > open source solution that can handle massive scaling. I think his > primary concern

Re: Python ORMs Supporting POPOs and Substituting Layers in Django

2011-11-07 Thread Travis Parks
On Nov 7, 12:44 pm, John Gordon wrote: > In John Gordon writes: > > > In <415d875d-bc6d-4e69-bcf8-39754b450...@n18g2000vbv.googlegroups.com> > > Travis Parks writes: > > > Which web frameworks have people here used and which have they found > > > t

xmlrpclib date times and a trailing Z

2011-11-11 Thread Travis Parks
e doesn't look like it handles time zones at all. I guess, is there a way to tell xmlrpclib to include time zones when parsing date times? Thanks, Travis Parks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python ORMs Supporting POPOs and Substituting Layers in Django

2011-11-12 Thread Travis Parks
On Nov 8, 12:09 am, Lie Ryan wrote: > On 11/08/2011 01:21 PM, Travis Parks wrote: > > > > > > > On Nov 7, 12:44 pm, John Gordon  wrote: > >> In  John Gordon  writes: > > >>> In<415d875d-bc6d-4e69-bcf8-39754b450...@n18g2000vbv.googlegroups.

Re: xmlrpclib date times and a trailing Z

2011-11-13 Thread Travis Parks
On Nov 11, 7:20 pm, Travis Parks wrote: > I am trying to connect to Marchex's a call tracking software using > xmlrpclib. I was able to get some code working, but I ran into a > problem dealing with transfering datetimes. > > When I construct a xmlrpclib.ServerPro

Using the Python Interpreter as a Reference

2011-11-20 Thread Travis Parks
generated because I see state transition tables, which I doubt someone built by hand. Any help would be greatly appreciated. It will be cool to see how the interpreter works internally. I am still wonder whether designing the language (going on 4 months now) will be harder than implementing it. Than

Re: Using the Python Interpreter as a Reference

2011-11-21 Thread Travis Parks
On Nov 21, 12:44 am, Steven D'Aprano wrote: > On Mon, 21 Nov 2011 13:33:21 +1100, Chris Angelico wrote: > > What's your language's "special feature"? I like to keep track of > > languages using a "slug" - a simple one-sentence (or less) statement of > > when it's right to use this language above o

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

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-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-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 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, 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, 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: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: switching to numpy and failing, a user story

2006-10-04 Thread Travis Oliphant
[EMAIL PROTECTED] wrote: > Travis E. Oliphant wrote: > > > Given the quality of python's (free) documentation and how good it's > been for a very long time, it's bit ironic to be using the phrase > "normal open-source documentation" on this mailing lis

Re: numpy slice: create view, not copy

2006-10-12 Thread Travis Oliphant
e(-1,a.shape[1]-1)] > > As you can see, this also defines periodic boundaries (i.e. west[0,0] = 9) > but it seems that this returns a copy of a, not a view. > How can I change the slice definition in such a way it returns a view? You can't get periodic boundary conditions but

Re: Good Form

2006-10-21 Thread Travis Vachon
= A() >>> obj.a = 2 obj.a = 2 will call _set_a(self, 2), which in this case will run some_other_additional_action() and then set a to 2. Gregor's post contains prudent advice on when to use this property() business (that is, only when definitely needed :) ). Best, Travis Vachon

Re: numpy numbers converted wrong

2006-10-26 Thread Travis Oliphant
robert wrote: > in Gnuplot (Gnuplot.utils) the input array will be converted to a Numeric > float array as shown below. When I insert a numpy array into Gnuplot like > that below, numbers 7.44 are cast to 7.0 > Why is this and what should I do ? Is this bug in numpy or in Numeric? > > > [Dbg]>

Re: iterator question

2006-09-29 Thread Travis Oliphant
return [tuple(x) for x in a] or use a "record-array": import numpy as N def transform(seq, num): a = N.asarray(seq) dt = a.dtype newdt = [('',dt)]*num return a.view(newdt).tolist() This would return a list of tuples as requested. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: cannot install scipy

2006-02-06 Thread Travis Oliphant
go well. Try >>> import numpy from a standard Python shell. It looks like you are using Python 2.3 and NumPy 0.9.4 built without the required Python 2.3 patch. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Comments sought for PEP 357 --- allowing any object in slice syntax

2006-03-03 Thread Travis Oliphant
Any Object to be Used for Slicing Version: $Revision: 42549 $ Last Modified: $Date: 2006-02-21 21:00:18 -0700 (Tue, 21 Feb 2006) $ Author: Travis Oliphant <[EMAIL PROTECTED]> Status: Draft Type: Standards Track Created: 09-Feb-2006 Python-Version: 2.5 Abstract This PEP proposes add

reading a python file object in c extension crashes python

2005-06-13 Thread travis ray
Hi, I have an extension in which a file object is created in python and passed down to a c extension which attempts to read from it or write to it. Writing to the file pointer seems to work okay, but reading from it results in EBADF and causes python to crash on exit. I've attached the minimal (

reading a python file object in c extension crashes python

2005-06-13 Thread travis ray
Hi, I have an extension in which a file object is created in python and passed down to a c extension which attempts to read from it or write to it. Writing to the file pointer seems to work okay, but reading from it results in EBADF. It also causes python to crash on exit. I've attached the min

Re: Direct memory access

2007-03-07 Thread Travis Oliphant
e to hexadecimal 24 etc... If you don't have permission to write to addr then you will get memory violations and your program will crash if you try to read from or write to the resulting sequence. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: Python equivalents to MATLAB str2func, func2str, ischar, isfunc?

2007-03-14 Thread Travis Oliphant
str() has some similarity with func2str ischar(A) is similiar to isinstance(A, str) isfunc is similiar to callable -Travis P.S. (if you are using NumPy, then there are other possibilities as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: An error of matrix inversion using NumPy

2007-04-04 Thread Travis Oliphant
't amplifiying low-valued singular vectors. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: Database in memory

2007-04-09 Thread Travis Oliphant
ated. Mind you, it is SQL-less. NumPy only provides the "tables" it does not provide the fancy logic on-top of the tables. So, perhaps it would be better to say that NumPy could serve as the foundation for a simple data-base application. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: pytz has so many timezones!

2007-10-08 Thread Travis Jensen
lock. > > > > Maybe this is where I'm not understanding you: Do you have another use > for setting a timezone? The only thing a time zone does, as far as I can > tell, is set clocks relative to a shared conception of time. > > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Travis Jensen [EMAIL PROTECTED] http://cmssphere.blogspot.com/ Software Maven * Philosopher-in-Training * Avenged Nerd -- http://mail.python.org/mailman/listinfo/python-list

Committing latest patch on Issue 708374 to SVN (adding offset to mmap)

2007-10-22 Thread Travis Oliphant
Hi all, I think the latest patch for fixing Issue 708374 (adding offset to mmap) should be committed to SVN. I will do it, if nobody opposes the plan. I think it is a very important addition and greatly increases the capability of the mmap module. Thanks, -Travis Oliphant -- http

Re: Committing latest patch on Issue 708374 to SVN (adding offset to mmap)

2007-10-22 Thread Travis Oliphant
Travis Oliphant wrote: > Hi all, > > I think the latest patch for fixing Issue 708374 (adding offset to mmap) > should be committed to SVN. > > I will do it, if nobody opposes the plan. I think it is a very > important addition and greatly increases the capabili

Re: parsing the output from matlab

2007-10-23 Thread Travis Brady
p('variable'), var.group ('value')) : : x1 = 0.5 But I'm betting these files get more complex than just the snippet you included, in which case it's probably worth looking at pyparsing http://pyparsing.wikispaces.com/ and regular expressions. -- Travis Brady http://travisbrady.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: delineating by comma where commas inside quotation marks don't count

2007-10-25 Thread Travis Brady
v reader = csv.reader(open('testfile.txt')) for ct,row in enumerate(reader): print "var2=", row[2] if ct>2: break The comma separated list parser in pyparsing is also great for this, particularly when the input gets dirtier: http://pyparsing.wikispaces.com/space

Re: why scipy cause my program slow?

2007-01-17 Thread Travis Oliphant
dled more generically (the same algorithm covers all the cases). The speed could be improved but hasn't been because it is so easy to get a Python float if you are concerned about speed. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: Two dimensional lists

2007-01-25 Thread Travis Oliphant
nsitioning their own code to use NumPy and numarray will cease being supported at some point. http://numpy.scipy.org http://www.numpy.org --- sourceforge site. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: export an array of floats to python

2007-02-22 Thread Travis Oliphant
my float array > in the C module, and passed it to python. How about creating an array directly from your float array using PyArray_SimpleNewFromData (the NumPy C-API) or PyArray_FromDimsAndData (the Numeric C-API). -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: array and list

2008-01-18 Thread Travis Jensen
modeled after functional languages. tj Travis Jensen [EMAIL PROTECTED] http://softwaremaven.innerbrane.com/ You should read my blog; it is more interesting than my signiature. -- http://mail.python.org/mailman/listinfo/python-list

OS X, Python, and Emacs

2008-01-24 Thread Travis Jensen
ing I type gets echoed back to the buffer before being processed. For example: >>> 'a' 'a' 'a' >>> for x in xrange(5): for x in xrange(5): ... print x print x ... 0 1 2 3 4 Any ideas on what is causing this or how I can fix it? Thanks. tj Travi

Re: Which is more pythonic?

2008-01-24 Thread Travis Jensen
w_goal.best = solution >new_goal.best_score = score >return score >new_goal.best = new_goal.best_score = None >return new_goal > > -Ben > -- > http://mail.python.org/mailman/listinfo/python-list Travis Jensen [EMAIL PROTECTED] http://softwaremaven.inner

Return lines in file that match string

2008-10-28 Thread Travis Kirstine
I am new to python and could use some help with a fairly easy task. I would like to return all lines in a file that have the string '' to a list. Regards, -- Travis K. Toronto, Canada "She knows there's no succ

python image - ignore values in resize

2009-03-06 Thread Travis Kirstine
= Image.merge('RGBA', (multi[0], multi[1], multi[2], mask)) out_im = out_im.resize((100, 100), Image.ANTIALIAS) out_im = out_im.convert('RGB') out_im.save('dst.tif') Any help would be great -- Travis K. Toronto, Canada

Creating a python extension that works with multiprocessing.Queue

2009-03-14 Thread Travis Miller
do its stuff. What am I missing? Travis Miller -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating a python extension that works with multiprocessing.Queue

2009-03-19 Thread Travis Miller
ssive. travis On Mar 17, 8:43 pm, "Gabriel Genellina" wrote: > En Sun, 15 Mar 2009 01:51:35 -0200, Travis Miller   > escribió: > > > I am very new to the python C API, and have written a simple type > > called SU2 that has 4 members that are all doubles.  Everything s

NumPy arrays that use memory allocated from other libraries or tools

2008-09-09 Thread Travis Oliphant
http://blog.enthought.com/?p=62 Best regards, -Travis Oliphant -- http://mail.python.org/mailman/listinfo/python-list

Re: NumPy arrays that use memory allocated from other libraries or tools

2008-09-11 Thread Travis Oliphant
sturlamolden wrote: On Sep 10, 6:39 am, Travis Oliphant <[EMAIL PROTECTED]> wrote: I wanted to point anybody interested to a blog post that describes a useful pattern for having a NumPy array that points to the memory created by a different memory manager than the standard one used by

[ANN] NumPy 0.9.6 released

2006-03-14 Thread Travis Oliphant
This post is to announce the release of NumPy 0.9.6 which fixes some important bugs and has several speed improvments. NumPy is a multi-dimensional array-package for Python that allows rapid high-level array computing with Python. It is successor to both Numeric and Numarray. More informatio

Re: Computing correlations with SciPy

2006-03-17 Thread Travis Oliphant
[EMAIL PROTECTED] wrote: > I want to compute the correlation between two sequences X and Y, and > tried using SciPy to do so without success.l Here's what I have, how > can I correct it? > This was a bug in NumPy (inherited from Numeric actually). The fix is in SVN of NumPy. Here are the new v

Looking for some PyPI query help

2011-02-22 Thread Travis Griggs
or any help or pointers or hints or data you can give me. (I apologize if this is overtly naive). -- Travis Griggs Objologist "I did not have time to write you a short program, so I wrote you a long one instead." -- http://mail.python.org/mailman/listinfo/python-list

https post request

2009-06-13 Thread Travis Altman
i'm trying to make a https post request, i'm following the example linked below. http://www.java2s.com/Tutorial/Python/0420__Network/SendinganHTTPPOSTRequestfromaPythonScript.htm i'm trying to make the https post request to netflix.com, below is my code 1 import httplib 2 3 # def statement

unsuccessful post request hangs, what gives?

2009-06-15 Thread Travis Altman
i'm trying to use a post request to authenticate to a web application. let's say username = alice is valid but username = bob does not exits. making the request with alice works like a charm but when i try username = bob it hangs? any suggestions? -- http://mail.python.org/mailman/listinfo/python

Re: PythonMagick on Windows

2005-12-05 Thread Travis E. Oliphant
imagemagick on the pylab project page at Sourceforge. Last I checked it compiled for windows. But, I haven't really played with it for a while. You might find the old binaries there useful for at least some version of Image Magick. http://sourceforge.net/project/showfiles.php?group_id=1315 -Travis Oliphant -- http://mail.python.org/mailman/listinfo/python-list

Re: Best library for basic stats

2005-12-29 Thread Travis E. Oliphant
e checked out of SVN anonymously (or browsed through the web) at http://svn.scipy.org/svn/scipy/trunk -Travis Oliphant -- http://mail.python.org/mailman/listinfo/python-list

Re: csrss.exe & Numeric

2005-12-30 Thread Travis E. Oliphant
> Are you memory-limited so that the process is swapping memory to disk? We'll need more details to offer a better suggestion. Best, -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: Hypergeometric distribution

2006-01-02 Thread Travis E. Oliphant
ong integer is computed. Notes: - Array arguments accepted only for exact=0 case. - If k > N, N < 0, or k < 0, then a 0 is returned. -Travis Oliphant -- http://mail.python.org/mailman/listinfo/python-list

Re: void * C array to a Numpy array using Swig

2006-01-12 Thread Travis E. Oliphant
Philip Austin wrote: > "Travis E. Oliphant" <[EMAIL PROTECTED]> writes: > > >>Krish wrote: > > >>Yes, you are right that you need to use typemaps. It's been awhile >>since I did this kind of thing, but here are some pointers. >

Re: how do "real" python programmers work?

2006-01-13 Thread Travis E. Oliphant
use the python shell, I can use import (and > reload), or execfile perhaps. Try IPython. It makes the process of executing live code very productive. http://ipython.scipy.org -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: void * C array to a Numpy array using Swig

2006-01-13 Thread Travis E. Oliphant
.h with numpy/arrayobject.h 2) In full scipy there are typemaps for numpy arrays in cluster/src/swig_num.i Look here... http://projects.scipy.org/scipy/scipy/file/trunk/Lib/cluster/src/swig_num.i This should help you get started with some examples. Typemaps can be a little confusing at first, b

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-21 Thread Travis E. Oliphant
weekend. It's closer to 1.0 and so should be more stable.It also has some speed improvements in matrix-vector operations (if you have ATLAS BLAS --- or if you download a binary version with ATLAS BLAS compiled in). I would wait for it. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: How to convert this list to string?

2006-10-18 Thread Travis E. Oliphant
Jia Lu wrote: > Hi all > > I have a list like: > >>>> list > [1, 2, 3] >>>> list[1:] > [2, 3] > > I want to get a string "2 3" > >>>> str(list[1:]) > '[2, 3]' > > How can I do that ? > " ".join(str(x) for x in list) -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: using mmap on large (> 2 Gig) files

2006-10-23 Thread Travis E. Oliphant
es by Martin have seen more testing than he is probably aware of. -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy error

2006-10-23 Thread Travis E. Oliphant
> Numpy version 102 seems to be numpy-1.0b5 which is not downloadable > anymore. Any hints ? > You need to re-compile matplotlib (or wait until they release a new binary that is compiled against numpy 1.0) Or install the numpy-1.0rc2 binary which is now again available on sour

Re: numbers to string

2006-10-24 Thread Travis E. Oliphant
s another numpy solution just for fun: import numpy z = numpy.array(y,dtype='u1').view('S%d' % len(y))[0] -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: unsigned 32 bit arithmetic type?

2006-10-25 Thread Travis E. Oliphant
Robin Becker wrote: > Hi, just trying to avoid wheel reinvention. I have need of an unsigned 32 bit > arithmetic type to carry out a checksum operation and wondered if anyone had > already defined such a beast. > > Our current code works with 32 bit cpu's, but is failing with 64 bit > compariso

Re: problem with fft periodogram

2006-10-25 Thread Travis E. Oliphant
city of ~9 sample spacings. To get it in unites of minutes you need to multiply period by the difference in minutes period_in_minutes = period * (minutes[1] - minutes[0]) Then, plot period_in_minutes versus power. I see a peak around 180 minutes in your data. -Travis -- http://mail.python.org/mailman/listinfo/python-list

[ANN] NumPy 1.0 release

2006-10-26 Thread Travis E. Oliphant
have to be altered. Several people are available to help with that process, just ask (we will do it free for open source code and as work-for-hire for commercial code). This release would not have been possible without the work of many people. Thanks go to (if we have missed your contribution ple

Re: latest numpy & scipy - incompatible ?

2006-10-29 Thread Travis E. Oliphant
umpy.core.multiarray >>>> >>>> import scipy >>>> scipy.__version__ > '0.5.1' >>>> numpy.__version__ > '1.0' Download the 1.0rc2 binary until SciPy 0.5.2 which should be out in a few days. If you can recompile, SciPy yourself, then it will work fine with 1.0 -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: concatenating numpy arrays

2006-10-31 Thread Travis E. Oliphant
se a1.shape is (n1,n2) and a2.shape is (n1,n3) Then you want to do a3 = concatenate((a1,a2),axis=1) or equivalently a3 = hstack([a1,a2]) a3 = r_['1',a1,a2] -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: reordering elements of a list

2006-06-03 Thread Travis E. Oliphant
NumPy ( http://numeric.scipy.org ) can do this using element-based indexing on an array of strings. Your example: import numpy a = numpy.array('qwertyuiop','c') newlist = a[[2,3,1,0]+range(4,10)].tolist() print newlist Returns: ['e', 'r', 'w', 'q', 't', 'y', 'u', 'i', 'o', 'p'] But you can also do it with list comprehension pretty easily, so this is probably just a shameless plug for NumPy :-) -Travis -- http://mail.python.org/mailman/listinfo/python-list

Re: numpy : argmin in multidimensional arrays

2006-07-06 Thread Travis E. Oliphant
dimension and you get an N-1 dimensional array of indices that will all be between 1 and myarray.shape[axis] -Travis -- http://mail.python.org/mailman/listinfo/python-list

[ANN] NumPy 1.0b4 now available

2006-08-26 Thread Travis E. Oliphant
The 4th beta release of NumPy 1.0 has just been made available. NumPy 1.0 represents the culmination of over 18 months of work to unify the Numeric and Numarray array packages into a single best-of-breed array package for Python. NumPy supports all the features of Numeric and Numarray with a he

<    1   2   3   >