On Fri, Jun 10, 2011 at 12:58 PM, Mark Phillips
wrote:
> How do I write my script so it picks up argument from the output of commands
> that pipe input into my script?
def main():
import sys
print sys.stdin.read()
if __name__ == '__main__':
main()
$ echo "fred" | python script.py
fr
On Wed, Feb 16, 2011 at 12:35 PM, snorble wrote:
> I use Python a lot, but not well. I usually start by writing a small
> script, no classes or modules. Then I add more content to the loops,
> and repeat. It's a bit of a trial and error learning phase, making
> sure I'm using the third party modul
On Thu, Jan 6, 2011 at 3:32 PM, Alan Meyer wrote:
> On 1/5/2011 11:40 AM, Tomasz Rola wrote:
>>
>> On Tue, 4 Jan 2011, Roy Smith wrote:
>>
>>> There. Now that I've tossed some gasoline on the language wars fire,
>>> I'll duck and run in the other direction :-)
>>
>> May I suggest a better strateg
On Thu, Mar 11, 2010 at 8:57 AM, gb345 wrote:
>
>
>
> I'm hoping to get advice from anyone with prior experience setting
> up a Python group.
>
> A friend of mine and I have been trying to start a
> scientific-programming-oriented Python group in our school (of
> medecine and bio research), with n
On Thu, Feb 18, 2010 at 10:46 PM, Steve Howell wrote:
> On Feb 18, 2:49 pm, Jonathan Gardner
> wrote:
>> On Feb 18, 8:15 am, Steve Howell wrote:
>>
>>
>>
>> > def print_numbers()
>> > [1, 2, 3, 4, 5, 6].map { |n|
>> > [n * n, n * n * n]
>> > }.reject { |square, cu
On Wed, Feb 17, 2010 at 9:08 AM, mk wrote:
> Bruno Desthuilliers wrote:
>>
>> mk a écrit :
>>>
>>> P.S. Method resolution order in Python makes me want to kill small
>>> kittens.
>>
>> mro is only a "problem" when using MI.
>
> Oh sure! And I have the impression that multiple inheritance is not us
On Wed, Jan 20, 2010 at 9:32 AM, KB wrote:
> Hi there,
>
> I have an application that only publishes a Java API. I can use jython
> to access java classes, but jython currently (to the best of my
> knowledge) does not support numpy/scipy.
>
> Ideally I would like to have jython call a "native" pyt
On Sun, Aug 23, 2009 at 9:21 AM, Stefan Behnel wrote:
> n...@cam.ac.uk wrote:
>> I am interested in surveying people who want to interoperate between
>> Fortran and Python to find out what they would like to be able to do
>> more conveniently, especially with regard to types not supported for C
>>
On Wed, Jul 22, 2009 at 2:48 AM, Bearophile wrote:
> greg:
>> Posting benchmark times for Pyrex or Cython is pretty
>> meaningless without showing the exact code that was
>> used, since times can vary enormously depending on
>> how much you C-ify things.
>
> Was this link, shown by William, not eno
On Fri, Jul 10, 2009 at 2:22 PM, walterbyrd wrote:
> I believe Guido himself has said that all indentions should be four
> spaces - no tabs.
>
> Since backward compatibility is being thrown away anyway, why not
> enforce the four space rule?
>
> At least that way, when I get python code from somebo
On Mon, Jun 22, 2009 at 9:49 PM, Andras
Pikler wrote:
> Hi!
>
>
>
> Short: I need to turn a Python program that I (mostly) wrote into C code,
> and I am at a loss.
>
>
>
> Long: I’m doing research/programming for a professor, and we are working
> with MIDI files (a type of simple music file). The r
On Tue, Jun 16, 2009 at 7:48 AM, Lucas P Melo wrote:
> Is there any tool for browsing python code? (I'm having a hard time trying
> to figure this out)
> Anything like cscope with vim would be great.
Check out pycscope:
http://pypi.python.org/pypi/pycscope/0.3
I use it myself, and it works fine.
On Fri, Mar 13, 2009 at 1:13 PM, psaff...@googlemail.com
wrote:
> Thanks for all the replies.
>
[snip]
>
> The numpy solution does work, but it uses more than 1GB of memory for
> one of my 130MB files. I'm using
>
> np.dtype({'names': ['chromo', 'position', 'dpoint'], 'formats': ['S6',
> 'i4', 'f8
On Fri, Mar 13, 2009 at 11:33 AM, Kurt Smith wrote:
[snip OP]
>
> Assuming your data is in a plaintext file something like
> 'genomedata.txt' below, the following will load it into a numpy array
> with a customized dtype. You can access the different fields by name
> (
On Fri, Mar 13, 2009 at 10:59 AM, psaff...@googlemail.com
wrote:
> I'm reading in some rather large files (28 files each of 130MB). Each
> file is a genome coordinate (chromosome (string) and position (int))
> and a data point (float). I want to read these into a list of
> coordinates (each a tupl
On Tue, Mar 10, 2009 at 12:39 PM, wrote:
>
>
> John> The only complaint I have there is that mixing tabs and spaces for
> John> indentation should be detected and treated as a syntax error.
>
> Guido's time machine strikes again (fixed in Python 3.x):
>
> % python3.0 ~/tmp/mixed.py
>
On Sat, Feb 28, 2009 at 10:08 AM, steven.oldner wrote:
>
> Thanks guys. While shopping today I've thought of a few more columns
> for my data so my first item will be building the 3 DB tables and a
> way to populate them. Since this was intended to automate what I do
> on a weekly basis, I didn
On Fri, Feb 20, 2009 at 4:27 PM, Grant Edwards wrote:
> On one hand, the upshot of that is that by finding an
> appropriate library module you might gain some of the same
> benefits as removing the GIL.
>
> On the other hand, that doesn't help if you're doing something
> original enough that nobod
On Thu, Feb 19, 2009 at 12:55 PM, Ron Garret wrote:
> I'm trying to split a CamelCase string into its constituent components.
> This kind of works:
>
re.split('[a-z][A-Z]', 'fooBarBaz')
> ['fo', 'a', 'az']
>
> but it consumes the boundary characters. To fix this I tried using
> lookahead and
On Wed, Feb 18, 2009 at 2:18 PM, eliben wrote:
>
> Hello,
>
> What are some good & recommended number theory libs for Python (or
> accessible interfaces to C libs), for things like primes,
> factorization, etc. Naturally, speed is of utmost importance here.
>
> In other words, which Python librari
On Sat, Feb 14, 2009 at 2:06 PM, tripp wrote:
> OK. It sounds like it would be easiest for me, then, to dump the
> arrays to a binary file (much faster than dumping it to a text) from
> the fortran program. Then use f2py to load a fortran module to read
> it.?.
I've done something similar and
On Wed, Dec 17, 2008 at 1:52 PM, Rominsky wrote:
> On Dec 17, 10:59 am, Christian Heimes wrote:
> > Rominsky schrieb:
> >
> > > I am trying to use dir to generate a list of methods, variables, etc.
> > > I would like to be able to go through the list and seperate the
> > > objects by type using
On Thu, Oct 30, 2008 at 9:37 AM, Łukasz Ligowski <[EMAIL PROTECTED]>wrote:
> Hi,
>
> There is small inconsistency (or I don't understand it right) between
> python
> 2.5 docs and python 2.6 docs.
>
> 2.5 docs say that:
> "a.has_key(k) Equivalent to k in a, use that form in new code"
Meaning: do
On Fri, Oct 17, 2008 at 11:48 AM, Joe Strout <[EMAIL PROTECTED]> wrote:
> On Oct 17, 2008, at 10:35 AM, coldpizza wrote:
>
>> If you are using and IDE, such as Eclipse, PyScripter, etc, then CTR
>> +click on 'this' should do the trick.
>> In ipython you can do 'import this' and then type 'this??' O
On Sun, Sep 7, 2008 at 5:41 PM, Mars creature <[EMAIL PROTECTED]> wrote:
> Hi guys,
> I am new to Python, and thinking about migrating to it from matlab
> as it is a really cool language. Right now, I am trying to figure out
If you're trying to migrate from matlab to python I'd take a look at num
On Fri, Jul 25, 2008 at 5:02 PM, aditya shukla
<[EMAIL PROTECTED]> wrote:
> Hello folks,
>
> I have a list say
>
> data=[0.99,0.98,0.98,0.98,0.97,0.93,0.92,0.92,0.83,0.66,0.50,0.50]
>
> i am trying to plot histogram of these values
>
> i have installed numpy and matplotlib and this is what i am do
On Thu, May 22, 2008 at 10:55 AM, duli <[EMAIL PROTECTED]> wrote:
> Hi:
> I would like recommendations for books (in any language, not
> necessarily C++, C, python) which have walkthroughs for developing
> a big software project ? So starting from inception, problem
> definition, design, coding and
On Wed, Mar 26, 2008 at 12:15 AM, skunkwerk <[EMAIL PROTECTED]> wrote:
> On Mar 25, 9:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]>
> wrote:
> > En Wed, 26 Mar 2008 00:39:05 -0300, skunkwerk <[EMAIL PROTECTED]>
> > escribió:
>
> >
> > >>i'm trying to call subprocess.popen on the 'rename' f
Hi List:
Class inheritance noob here.
For context, I have the following base class and subclass:
class Base(object):
def __init__(self, val):
self.val = val
class Derived1(Base):
def __init__(self, val):
super(Derived1, self).__init__(val)
I'm curious as to other's thou
On 10/15/07, Gary Herron <[EMAIL PROTECTED]> wrote:
> Dmitri O.Kondratiev wrote:
> > Gary, thanks for lots of info!
> > Python strings are not lists! I got it now. That's a pity, I need two
> > different functions: one to reverse a list and one to reverse a string:
> True, they are not both lists,
On 10/4/07, Casey <[EMAIL PROTECTED]> wrote:
[snippage]
>
> Following the reference to section 3.2 provides a (non-rigorous)
> description of what a slice object is, in terms of the extended
> slicing semantics. But it doesn't shed any additional light on the
> meaning of [::-1].
>
> >From this, I
On 9/17/07, Stefano Esposito <[EMAIL PROTECTED]> wrote:
> Hi all
>
> what i'm trying to do is this:
>
> >>>def foo ():
> ... return None
> ...
> >>>def bar ():
> ... print "called bar"
> ...
> >>>def assigner ():
> ... foo = bar
> ...
You need to tell "assigner()" that foo doesn't belo
On 8/12/07, Ghirai <[EMAIL PROTECTED]> wrote:
> Hello list,
>
> I need to draw a graph, 2 axes, 2D, nothing fancy.
> One of the axes is time, the other one is a series of integers.
>
> I don't care much about the output format.
>
> Are there any specialized libraries for this, or should i use PIL?
On 8/3/07, Stephen Webb <[EMAIL PROTECTED]> wrote:
> Greetings all,
>
> I've recently begun using Python to do scientific computation, and I wrote
> the following script to find approximate eigenvalues for a semi-infinite
> matrix:
>
>
> from pylab import *
> from numpy import *
> from scipy impor
Sorry, forgot to "Reply to all."
On 8/3/07, Stephen Webb <[EMAIL PROTECTED]> wrote:
> Greetings all,
<>
> Also, I've been having trouble with the plot function in matplotlib. For
> example, I enter the following in the terminal:
>
> >>> from pylab import *
> >>> plot([1,2,3])
> []
>
I can help
35 matches
Mail list logo