Il Thu, 25 Aug 2011 01:52:25 -0700, Chris Rebert ha scritto:
> On Thu, Aug 25, 2011 at 1:25 AM, Tracubik wrote:
>> Hi all!
cut
> Untested:
>
> from subprocess import Popen, PIPE sudo = Popen("sudo las", shell=True,
> stderr=PIPE)
> tee = Popen(["tee", "/dev/stderr"], stdin=sudo.stderr, stdout=
On Fri, Aug 26, 2011 at 12:56 AM, Tracubik wrote:
> Il Thu, 25 Aug 2011 01:52:25 -0700, Chris Rebert ha scritto:
>> On Thu, Aug 25, 2011 at 1:25 AM, Tracubik wrote:
>>> Hi all!
>
> cut
>
>> Untested:
>>
>> from subprocess import Popen, PIPE sudo = Popen("sudo las", shell=True,
>> stderr=PIPE)
>>
Il Thu, 25 Aug 2011 08:25:59 +, Tracubik ha scritto:
> Hi all!
> i'ld like to execute via Python this simple bash command:
>
> sudo las
>
> las is intended to be a typo for "ls"
>
> the point is that i want to see in the terminal the stderr message (that
> is "sorry, try again" if i insert
Hi Guys,
Not sure if this is the place to ask, but I am trying find out a way to
handle application level errors from a global config. Any help would be
really appreciated.
Regards,
Nav
--
http://mail.python.org/mailman/listinfo/python-list
Il Fri, 26 Aug 2011 01:20:02 -0700, Chris Rebert ha scritto:
> On Fri, Aug 26, 2011 at 12:56 AM, Tracubik wrote:
>> Il Thu, 25 Aug 2011 01:52:25 -0700, Chris Rebert ha scritto:
>>> On Thu, Aug 25, 2011 at 1:25 AM, Tracubik wrote:
Hi all!
>>
>> cut
>>
>>> Untested:
>>>
>>> from subprocess im
Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-2ZCa8v/pycurl-7.19.0/egg-dist-tmp-DyHFls
Using curl-config (libcurl 7.12.1)
src/pycurl.c:42:20: Python.h: No such file or directory
src/pycurl.c:43:22: pythread.h: No such file or directory
src/pycurl.c:58:4: #error "Need Py
In article
,
t...@thsu.org wrote:
> On Aug 23, 7:59 am, smith jack wrote:
> > i have heard that function invocation in python is expensive, but make
> > lots of functions are a good design habit in many other languages, so
> > is there any principle when writing python function?
> > for example
I know the Python syntax pretty well. I know a lot of the libraries
and tools. When I see professional Python programmer's code, I am
often blown away with the code. I realized that even though I know the
language, I know nothing about using it effectively.
I would like to start using Python more
On Fri, Aug 26, 2011 at 10:33 PM, Travis Parks wrote:
> I know the Python syntax pretty well. I know a lot of the libraries
> and tools. When I see professional Python programmer's code, I am
> often blown away with the code. I realized that even though I know the
> language, I know nothing about
On Fri, Aug 26, 2011 at 3:15 PM, Laszlo Nagy wrote:
> Running pycurl-7.19.0/setup.py -q bdist_egg --dist-dir
> /tmp/easy_install-2ZCa8v/**pycurl-7.19.0/egg-dist-tmp-**DyHFls
>
>> Using curl-config (libcurl 7.12.1)
>> src/pycurl.c:42:20: Python.h: No such file or directory
>> src/pycurl.c:43:22: p
Thanks Michael :) . I will keep your suggestions in mind.
On Fri, Aug 26, 2011 at 9:01 AM, Chetan Harjani wrote:
> Hello friends,
>
> I have learned the basic syntax of python through the book HOW TO THINK
> LIKE A COMPUTER SCIENTIST n by reading first 10-11 chapters of
> Apress-BEGINNING PROGRAM
Chris Angelico wrote:
[ ... ]
> You can get books on algorithms from all sorts of places, and with a
> very few exceptions, everything you learn with apply to Python and
> also to every other language you use.
I liked _Programming Pearls_ by Jon Bentley. No reference to Python -- that
would be t
On Aug 26, 8:44 am, Chris Angelico wrote:
> On Fri, Aug 26, 2011 at 10:33 PM, Travis Parks wrote:
> > I know the Python syntax pretty well. I know a lot of the libraries
> > and tools. When I see professional Python programmer's code, I am
> > often blown away with the code. I realized that even
On Fri, Aug 26, 2011 at 10:58 PM, Travis Parks wrote:
> I haven't gotten to the point where I can truly use the language
> features to my full advantage. I haven't seen enough "tricks" to be
> effective. I feel like there is so much of the language I am not
> utilizing because I'm still thinking i
On Fri, Aug 26, 2011 at 2:28 PM, Chris Angelico wrote:
> On Fri, Aug 26, 2011 at 10:58 PM, Travis Parks
> wrote:
> > I haven't gotten to the point where I can truly use the language
> > features to my full advantage. I haven't seen enough "tricks" to be
> > effective. I feel like there is so muc
On Aug 26, 9:28 am, Chris Angelico wrote:
> On Fri, Aug 26, 2011 at 10:58 PM, Travis Parks wrote:
> > I haven't gotten to the point where I can truly use the language
> > features to my full advantage. I haven't seen enough "tricks" to be
> > effective. I feel like there is so much of the languag
I'm looking for a good IDE -- easy to setup, easy to use -- for Python.
Any suggestions?
I use Eclipse for other projects and have no problem with using it for
Python, except that I can't get PyDev to install. It takes forever,
then produces an error that makes no sense.
An error occurred
I downloaded cx_oracle for installation to Ubuntu 11.04 64bit this morning,
and the alien and dpkg operations worked fine,
but on testing the import, the error msg shows that the oracle client lib is
missing. I found a thread that mentioned installing the
oracle instant client on 11.04 to resolve t
In article
<2309ec4b-e9a3-4330-9983-1c621ac16...@ea4g2000vbb.googlegroups.com>,
Travis Parks wrote:
> I know the Python syntax pretty well. I know a lot of the libraries
> and tools. When I see professional Python programmer's code, I am
> often blown away with the code. I realized that even th
On Fri, Aug 26, 2011 at 10:43 AM, Verde Denim wrote:
> Looking for this with find / -name libclntsh.so.11.1 -print produces
> /usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1
>
> I'm confused as to why Python doesn't see it...
Try running "sudo ldconfig".
--
http://mail.python.org/mailman/lis
I've honestly always used either PyDev or IDLE. However, Python is pretty easy
to usd without a big IDE slowing you down, so you could also use a developer's
text editor like Notepad++ or gedit and still be good.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 26, 6:15 am, Roy Smith wrote:
> Maybe. In general, it's certainly true that a bunch of smallish
> functions, each of which performs exactly one job, is easier to work
> with than a huge ball of spaghetti code.
Obviously you need to google the definition of "spaghetti code". When
you mo
On Fri, Aug 26, 2011 at 11:17 AM, Ken Watford wrote:
> On Fri, Aug 26, 2011 at 10:43 AM, Verde Denim wrote:
> > Looking for this with find / -name libclntsh.so.11.1 -print produces
> > /usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1
> >
> > I'm confused as to why Python doesn't see it...
>
>
I like Aptana Studio
http://www.aptana.com/products/studio3
2011/8/26 Dave Boland :
> I'm looking for a good IDE -- easy to setup, easy to use -- for Python. Any
> suggestions?
>
> I use Eclipse for other projects and have no problem with using it for
> Python, except that I can't get PyDev to in
Hi I am new to python I am at bit lost as to why my unit test is
failing below is the code and the unit test:
class Centipede(object):
legs, stomach
def __init__(self):
def __str__(self):
return ','.join(self.stomach)
def __call__(self,*args):
[self.stomach.appe
On Aug 26, 11:12 am, Roy Smith wrote:
> In article
> <2309ec4b-e9a3-4330-9983-1c621ac16...@ea4g2000vbb.googlegroups.com>,
> Travis Parks wrote:
>
> > I know the Python syntax pretty well. I know a lot of the libraries
> > and tools. When I see professional Python programmer's code, I am
> > ofte
In <7b47ca17-d3f1-4d91-91d1-98421e870...@ea4g2000vbb.googlegroups.com>
rantingrick writes:
> Furthermore: If you are moving code out of one function to ONLY be
> called by that ONE function then you are a bad programmer and should
> have your editor taken away for six months. You should ONLY cre
On Aug 26, 2011 11:39 AM, "Moises Alberto Lindo Gutarra"
wrote:
>
> I like Aptana Studio
> http://www.aptana.com/products/studio3
>
FYI, Aptana is just a set of extensions for Eclipse. Aptana Studio is just
Eclipse with all of the Aptana extensions (including PyDev) preinstalled.
> 2011/8/26 Dav
Furthermore: If you are moving code out of one function to ONLY be
called by that ONE function then you are a bad programmer and should
have your editor taken away for six months. You should ONLY create
more func/methods if those func/methods will be called from two or
more places in the code. T
Hot Bollywood Actresses and Hot Football Players of Spain Nation
Soccer Team.
http://bollywoodactresseshotdresses.blogspot.com/
http://spainnationalfootballteamwallpapers.blogspot.com/
--
http://mail.python.org/mailman/listinfo/python-list
In lblake
writes:
> Hi I am new to python I am at bit lost as to why my unit test is
> failing below is the code and the unit test:
> class Centipede(object):
> legs, stomach
You aren't assigning any values to "legs" or "stomach" here. From your
later code, it seems like you intend these
Ian Kelly wrote:
> Thomas 'PointedEars' Lahn wrote:
>> Both variants work (even in Py3) if you only define [a named argument].
>> You have to define [a keyword argument, e.g. `kwargs'].
>>
>> so that
>>
>> data1.merge_with(data2, True);
>>
>> is a syntax error ("TypeError: merge_with() takes exact
Hi,
I'm wondering, why PyImport_ExecCodeModule function takes char*
instead of const char*?
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Aug 27, 2011 at 1:48 AM, Tobiah wrote:
> While I understand and agree with that basic tenet, I think
> that the capitalized 'ONLY' is too strong. I do split out
> code into function for readability, even when the function
> will only be called from the place from which I split it out.
>
You can get a lot done, if not everything, with a simple editor
however for me an IDE is awesome for digging around in the django
internals to see how it all works.
I used PyDev initially then onto emacs but finally I settled on
PyCharm - it's just like PyDev except that everything works.
On Fri, 2011-08-26 at 08:35 -0700, lblake wrote:
> Hi I am new to python I am at bit lost as to why my unit test is
> failing below is the code and the unit test:
>
> class Centipede(object):
> legs, stomach
This doesn't do what you think it does.
"legs, stomach" is a statement and is not de
Dave Boland wrote:
> I'm looking for a good IDE -- easy to setup, easy to use -- for Python.
> Any suggestions?
PyDev (currently 2.2.1.2011073123, from the Aptana Studio 3.0.4 Plugin; but
I can see that 2.2.2 has been released).
> I use Eclipse for other projects and have no problem with usin
Tobiah wrote:
>
>> Furthermore: If you are moving code out of one function to ONLY be
>> called by that ONE function then you are a bad programmer and should
>> have your editor taken away for six months. You should ONLY create
>> more func/methods if those func/methods will be called from two or
Is there an equivelent for the AWK RS in Python?
as in RS='\n\n'
will seperate a file at two blank line intervals
--
maus
.
.
... NO CARRIER
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 26, 10:40 am, John Gordon wrote:
> In <7b47ca17-d3f1-4d91-91d1-98421e870...@ea4g2000vbb.googlegroups.com>
> rantingrick writes:
>
> > Furthermore: If you are moving code out of one function to ONLY be
> > called by that ONE function then you are a bad programmer and should
> > have your e
On 26 Aug 2011 18:39:07 GMT
greymaus wrote:
>
> Is there an equivelent for the AWK RS in Python?
>
>
> as in RS='\n\n'
> will seperate a file at two blank line intervals
open("file.txt").read().split("\n\n")
--
D'Arcy J.M. Cain | Democracy is three wolves
http://www.druid.net/darcy
In Python 3, you can catch an exception and bind it to a name with:
try:
...
except ValueError, KeyError as error:
pass
In Python 2.5, that is written:
try:
...
except (ValueError, KeyError), error:
pass
and the "as error" form gives a SyntaxError.
Python 2.6 and 2.7 accept eit
On 26/08/11 21:56, Steven D'Aprano wrote:
> In Python 3, you can catch an exception and bind it to a name with:
>
> try:
> ...
> except ValueError, KeyError as error:
> pass
>
> In Python 2.5, that is written:
>
> try:
> ...
> except (ValueError, KeyError), error:
> pass
>
> and
On Sat, Aug 27, 2011 at 4:05 AM, rantingrick wrote:
> Now take a look at MY simple ONE module solution. It has JUST enough
> methods and NOT a single more!
I disagree - create_widgets() is completely unnecessary in the
presence of show(), unless it's possible to show the dialog, hide it,
and then
Hi all,
Here is an extract from the dis module doc [1]
"""
RAISE_VARARGS(argc)
Raises an exception. argc indicates the number of parameters to the
raise statement, ranging from 0 to 3. The handler will find the
traceback as TOS2, the parameter as TOS1, and the exception as TOS.
"""
OTOH, looking
On Aug 26, 4:45 pm, Chris Angelico wrote:
> On Sat, Aug 27, 2011 at 4:05 AM, rantingrick wrote:
> > Now take a look at MY simple ONE module solution. It has JUST enough
> > methods and NOT a single more!
>
> I disagree - create_widgets() is completely unnecessary in the
> presence of show(),
Wel
On Aug 26, 1:16 pm, Steven D'Aprano wrote:
> (3) Fault isolation. If you have a 100 line function that fails on line 73,
> that failure may have been introduced way back in line 16. By splitting the
> function up into smaller functions, you can more easily isolate where the
> failure comes from,
Chris Angelico wrote:
> On Sat, Aug 27, 2011 at 4:16 AM, Steven D'Aprano
> wrote:
>> I can think of at least five reasons apart from re-use why it might be
>> appropriate to pull out code into its own function or method even if it
>> is used in one place only:
>
> I'm glad you say "might be", be
On Sat, Aug 27, 2011 at 11:26 AM, Steven D'Aprano
wrote:
> I say "might be" because I mean it: these arguments have to be weighed up
> against the argument against breaking code out of functions. It's easy to
> imagine an extreme case where there are a billion *tiny* functions, each of
> which doe
Thomas Jollans wrote:
> On 26/08/11 21:56, Steven D'Aprano wrote:
>> Is there any way to catch an exception and bind it to a name which will
>> work across all Python versions from 2.5 onwards?
>>
>> I'm pretty sure there isn't, but I thought I'd ask just in case.
>
> It's not elegant, and I ha
Arnaud Delobelle wrote:
> Here is an extract from the dis module doc [1]
>
> """
> RAISE_VARARGS(argc)
> Raises an exception. argc indicates the number of parameters to the
> raise statement, ranging from 0 to 3. The handler will find the
> traceback as TOS2, the parameter as TOS1, and the except
51 matches
Mail list logo