focus on the AND condition ... return is true only if both conditions are
true so unless the factorial is calculated (second portion of AND statement)
return will not give factorial. the second portion is recursive call to
self as long as x is greater than 1
On Wed, Oct 27, 2010 at 11:55 AM, Geob
I am a beginner in Python and would ask for a help.
I was searching for smaller version of code to calculate
factorial . Found this one
def fact(x):
return x > 1 and x * fact(x - 1) or 1
But I don't really get how ( x > 1 and x * fact(x - 1))
works .
--
http://mail
Andy wrote:
> Hi guys!
>
> I got a new laptop computer which came with the 64-bit version of
> Windows 7. I installed the 64-bit versions of Python and a few other
> libraries and wrote a few Python programs right there. If I copy the
> Python scripts to a 32-bit computer, it runs flawlessly. B
On 10/26/2010 09:28 PM, rantingrick wrote:
On Oct 26, 12:07 pm, Andre Alexander Bell wrote:
Hello,
I occasionally use LCs, if they seem useful. However, what I don't like
about LCs is that they 'look-like' being a closed scope, while actually
they are in the scope of there call. Example:
i =
On Oct 26, 12:07 pm, Andre Alexander Bell wrote:
> Hello,
>
> I occasionally use LCs, if they seem useful. However, what I don't like
> about LCs is that they 'look-like' being a closed scope, while actually
> they are in the scope of there call. Example:
>
> >>> i = 5
> >>> l = [i**2 for i in ran
On Oct 26, 11:29 am, John Nagle wrote:
> On 10/26/2010 2:31 AM, Xah Lee wrote:
>
> > recently wrote a article based on a debate here. (can't find the
> > original thread on Google at the moment)
>
> > • 〈What's List Comprehension and Why is it Harmful?〉
> >http://xahlee.org/comp/list_comprehension
On Oct 26, 2010, at 11:10 PM, Jorge Biquez wrote:
> Hello Christian and all .
>
> Thanks for the comments. I am newbie to Python trying to learn all the
> comments, that , by the way, I am very impressed of the knowledge of the
> people present in this list.
>
> I was wondering if you can com
Hello Christian and all .
Thanks for the comments. I am newbie to Python trying to learn all
the comments, that , by the way, I am very impressed of the knowledge
of the people present in this list.
I was wondering if you can comment more about what alternatives to
use instead to MySql. My w
On Tue, Oct 26, 2010 at 7:51 PM, Benjamin Peterson wrote:
> Inyeol gmail.com> writes:
>>
>> or am I missing something obvious?
>
> The attribute access is evaluated before the call to assertRaises, so unittest
> never has a
> cache to cache it.
or rather, "chance to catch it."
Seems there were
Inyeol gmail.com> writes:
>
> or am I missing something obvious?
The attribute access is evaluated before the call to assertRaises, so unittest
never has a cache to cache it.
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Oct 26, 2010 at 5:24 PM, Ben wrote:
> b...@sdrfid:~/gen2_rfid/trunk/src/app$ python -c "from gnuradio import
> rfid"
>
> works fine (at least, it doesn't say anything, which I take to be a
> good sign), but
>
> b...@sdrfid:~/gen2_rfid/trunk/src/app$ sudo python -c "from gnuradio
> import r
On 10/26/2010 1:46 PM, Krister Svanlund wrote:
You should check out OpenCV.
Yes. See
http://code.google.com/p/pyopencv/
Note the "people detector" example.
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
Am 27.10.2010 03:38, schrieb Jorge Biquez:
> And what about if I only were to develop for the web? I mean web
> applications, Mysql, etc? It would be better to still be in 2.7?
Most frameworks and database adapters at least target Python 2.6+ as
their main Python version. I guess the majority has
Hi guys!
I got a new laptop computer which came with the 64-bit version of
Windows 7. I installed the 64-bit versions of Python and a few other
libraries and wrote a few Python programs right there. If I copy the
Python scripts to a 32-bit computer, it runs flawlessly. But in the
future I may s
In brief summary, I have installed gnuradio [gnuradio.org] and the
gen2_rfid module [https://www.cgran.org/wiki/Gen2] on Ubuntu 10.04,
with all installed packages up to date as of a few days ago.
When I try to run the rfid reader/decoder script, I get the following
error:
b...@sdrfid:~/gen2_rfid
Unittest assertRaises cannot handle exception raised inside
__getattr__ method. Is it a bug? or am I missing something obvious?
Here is a sample of this problem:
-
import unittest
class C():
def simple_attr(self):
raise Att
Am 27.10.2010 02:16, schrieb Braden Faulkner:
>
> Which is better for a beginner to get started in Python with?
> Thanks!
It depends on your needs. Most 3rd party library haven't been ported to
Python 3 yet. You'll get more useful stuff with 2.7 or even 2.
On Wed, 27 Oct 2010 13:46:28 +1300, Lawrence D'Oliveiro wrote:
> Why would you want both CLI and GUI functions in one program?
An obvious example was the one which was being discussed, i.e. the Python
interpreter. Depending upon the "script", it may need to behave as a
command-line utility (read
In message , Dennis Lee
Bieber wrote:
> (The Amiga made it simple -- a shell invocation received a non-zero
> argc, with command line parameters in argv; a "clicked" invocation
> received argc of 0, and argv pointed to a structure containing the
> information from the associated .info file [Workb
Which is better for a beginner to get started in Python with?
Thanks! --
http://mail.python.org/mailman/listinfo/python-list
Chris Rebert wrote:
> On Mon, Oct 25, 2010 at 7:18 PM, Arthur Divot wrote:
> > Is there a python library equivalent to Perl's News::Article
> > (load a file containing a news or mail message into an
> > object, manipulate the headers and body, create a new empty
> > one, save one to a file)?
>
>
In message , Nobody wrote:
> python.exe is a console executable, pythonw.exe is a GUI executable. Hence
> python.exe automatically gets a console window, while pythonw.exe doesn't.
> That's the whole reason why Windows has separate python.exe and
> pythonw.exe programs, while Unix can use a single
Curious if there are any higher level frameworks that attempt to
wrap Tkinter? For example, wxPython is wrapped by the Dabo
framework (http://dabodev.com/) and PythonCard.
Motivation: We've recently moved to Python 2.7 (Windows) and are
very impressed with the new ttk (Tile) support which allows o
On 10/26/2010 2:46 PM, AK wrote:
> Hi, I have a question about unittest: let's say I create a temp dir for
> my tests, then use loadTestsFromNames() to load my tests from packages
> and modules they're in, then use TextTestRunner.run() to run the tests,
> how can I pass information to TestCase inst
On 10/26/2010 2:44 PM, kj wrote:
> In Steve Holden
> writes:
>
>> The answer is probably the same as you will see if you try
>
>> from __future__ import braces
>
>> That feature *is* available in Python 2.6 ;-)
>
> Now, that's hilarious.
>
See, there *is* a place for humor :)
regards
Ste
AK writes:
> Hi, I have a question about unittest: let's say I create a temp dir
> for my tests, then use loadTestsFromNames() to load my tests from
> packages and modules they're in, then use TextTestRunner.run() to run
> the tests, how can I pass information to TestCase instances, e.g. the
> lo
On Tue, Oct 26, 2010 at 10:31 AM, Mikael B wrote:
>
>
>
> >
> > That's from the functional programming crowd.
> >
> > Python isn't a functional language.
>
>
> A noob question: what is a functional language? What does it meen?
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
It's
You should check out OpenCV.
On Tue, Oct 26, 2010 at 8:53 PM, Kechagias Apostolos
wrote:
> Hello there.
> I ve been using python a lot lately for my school in order to make small
> gui(wxpython) apps.
> Today a teacher came up with an interesting project.
> The idea is that he gives you a series
On 10/26/10, Mikael B wrote:
>> That's from the functional programming crowd.
>>
>> Python isn't a functional language.
>
> A noob question: what is a functional language? What does it meen?
A language which supports the functional programming paradigm:
http://en.wikipedia.org/wiki/Funct
On 10/26/2010 07:22 PM, Ian Kelly wrote:
> >>> i = 5
> >>> l = [i**2 for i in range(3)]
> >>> i
> 2
>
>
> This has been corrected in Python 3.
Sorry. You're right. I forgot to mention that...
Andre
--
http://mail.python.org/mailman/listinfo/python-list
On 26/10/2010 14:18, Benjamin Kaplan wrote:
This is a programming language named after a British comedy group (not
the snake). There are going to be jokes inserted in lots of otherwise
serious things. Like the standard library.
Please, lets NOT get a newsgroup cross feed!
I don't want spam, spa
Hello there.
I ve been using python a lot lately for my school in order to make small
gui(wxpython) apps.
Today a teacher came up with an interesting project.
The idea is that he gives you a series of photos with some objects inside.
For example a photo could contain two black circles in a white ba
Hello there.
I ve been using python a lot lately for my school in order to make small
gui(wxpython) apps.
Today a teacher came up with an interesting project.
The idea is that he gives you a series of photos with some objects inside.
For example a photo could contain two black circles in a white ba
On 10/26/2010 10:54 AM, Daniel Fetchinson wrote:
PyGUI 2.3 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
This version works on Snow Leopard with PyObjC 2.3.
I suspect that "Python 2.3 or later is required." should read
"Python 2.3 to Python 2.7 is required.
--
Ter
Schengen States free EDUCATION STUDY VISA
http://childschooledu.blogspot.com/2010/10/get-internship-in-united-states.html
The European Union (EU) allows for the free movement of goods between
Italy and other member states: Austria, Belgium, Bulgaria, Cyprus,
Czech Republic, Denmark, Estonia, Fin
Schengen States free EDUCATION STUDY VISA
http://childschooledu.blogspot.com/2010/10/get-internship-in-united-states.html
The European Union (EU) allows for the free movement of goods between
Italy and other member states: Austria, Belgium, Bulgaria, Cyprus,
Czech Republic, Denmark, Estonia, Fin
On Oct 19, 2:29 pm, David Boddie wrote:
> On Monday 18 October 2010 23:26, Andrew wrote:
>
> > I have two issues dealing with the table widget, though they may be
> > interconnected. I'm not sure. Both delete the cell widgets off of my
> > table but leave the rows, and then when I have the table u
In Steve Holden
writes:
>The answer is probably the same as you will see if you try
> from __future__ import braces
>That feature *is* available in Python 2.6 ;-)
Now, that's hilarious.
kj
--
http://mail.python.org/mailman/listinfo/python-list
Hi, I have a question about unittest: let's say I create a temp dir for
my tests, then use loadTestsFromNames() to load my tests from packages
and modules they're in, then use TextTestRunner.run() to run the tests,
how can I pass information to TestCase instances, e.g. the location of
the temp dir
On Tue, 2010-10-26 at 09:45 -0700, John Nagle wrote:
> On 10/25/2010 6:34 AM, Alex Willmer wrote:
> > On Oct 25, 11:07 am, kj wrote:
> >> In "The Zen of Python", one of the "maxims" is "flat is better than
> >> nested"? Why? Can anyone give me a concrete example that illustrates
> >> this point?
On Tue, 26 Oct 2010 14:44:11 +, Grant Edwards wrote:
>> There is no difference based on the name of your executable, how it
>> is built, or what libraries it links to; the only difference is in
>> its run-time behaviour, whether it invokes any GUI functions or not.
>
> No, we're not talking a
>
> That's from the functional programming crowd.
>
> Python isn't a functional language.
A noob question: what is a functional language? What does it meen?
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Oct 26, 2010 at 11:07 AM, Andre Alexander Bell
wrote:
> Hello,
>
> I occasionally use LCs, if they seem useful. However, what I don't like
> about LCs is that they 'look-like' being a closed scope, while actually
> they are in the scope of there call. Example:
>
> >>> i = 5
> >>> l = [i**2
Andre Alexander Bell writes:
> I occasionally use LCs, if they seem useful. However, what I don't like
> about LCs is that they 'look-like' being a closed scope, while actually
> they are in the scope of there call. Example:
>
i = 5
l = [i**2 for i in range(3)]
i
> 2
>
Although:
Hello,
I occasionally use LCs, if they seem useful. However, what I don't like
about LCs is that they 'look-like' being a closed scope, while actually
they are in the scope of there call. Example:
>>> i = 5
>>> l = [i**2 for i in range(3)]
>>> i
2
Regards
Andre
--
http://mail.python.org/mailm
On 10/26/2010 12:32 PM, John Nagle wrote:
> On 10/19/2010 12:02 PM, Tobiah wrote:
>> I've been reading about the Unicode today.
>> I'm only vaguely understanding what it is
>> and how it works.
>>
>> Please correct my understanding where it is lacking.
>
> http://justfuckinggoogleit.com/
Neit
On 10/25/2010 6:34 AM, Alex Willmer wrote:
On Oct 25, 11:07 am, kj wrote:
In "The Zen of Python", one of the "maxims" is "flat is better than
nested"? Why? Can anyone give me a concrete example that illustrates
this point?
I take this as a reference to the layout of the Python standard
libr
On 10/24/2010 11:44 PM, Stefan Behnel wrote:
josh logan, 25.10.2010 04:14:
I found the error. The HTML file I'm parsing has invalid HTML at line
193. It has something like:
Note there is no space between the closing quote for the "href" tag
and the class attribute. I guess I'll go through eac
On 10/19/2010 12:02 PM, Tobiah wrote:
I've been reading about the Unicode today.
I'm only vaguely understanding what it is
and how it works.
Please correct my understanding where it is lacking.
http://justfuckinggoogleit.com/
--
http://mail.python.org/mailman/listinfo/python-list
On 10/26/2010 2:31 AM, Xah Lee wrote:
recently wrote a article based on a debate here. (can't find the
original thread on Google at the moment)
• 〈What's List Comprehension and Why is it Harmful?〉
http://xahlee.org/comp/list_comprehension.html
it hit reddit.
http://www.reddit.com/r/programming/
On Tue, 26 Oct 2010 08:38:45 -0700
Gary Herron wrote:
> On 10/26/2010 06:18 AM, Ed Keith wrote:
>> I was planing on using ReportLab, but recently found some references to
>> pango Try a package named reportlab. It's very comprehensive, opensource,
On the other hand, there is always reportlab.
On 10/26/2010 06:18 AM, Ed Keith wrote:
I need to generate PDF files and I'm exploring what tools to use. I was planing
on using ReportLab, but recently found some references to pango
(http://www.pango.org/) and ciaro (http://cairographics.org/) being able to
generate PDF files. But am having
On 26/10/2010 15:42, Steve Holden wrote:
he answer is probably the same as you will see if you try
from __future__ import braces
That feature*is* available in Python 2.6;-)
In the past I used to think it was really cool that one could do
from __future__ import exciting_and_cool_new_stuff
> PyGUI 2.3 is available:
>
>http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
>
> This version works on Snow Leopard with PyObjC 2.3.
Any reason your project is not easy_installable?
Cheers,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
--
http://mail.pyth
On 2010-10-26, Lawrence D'Oliveiro wrote:
> In message , Steve
> Holden wrote:
>
>> and, in fact, the console is only a GUI window in a windowed system. It
>> might be one of the console emulation windows that init starts under
>> linux, or even a terminal connected to a computer by a serila line
On 10/26/2010 9:05 AM, kj wrote:
> Perhaps the disconnect here is that you're seeing the whole thing
> from an insider's point of view, while I'm still enough of an
> outsider not to share this point of view. (I happen to think that
> one the hallmarks of being an initiate to a discipline is an al
[posted & e-mailed]
[chiming in late]
In article ,
Marco Gallotta wrote:
>
>I'm sure you get a lot of "2 or 3" questions, but here's another.
>Umonya [1] uses Python to introduce school kids to programming. The
>initiative is only 15 months old and up till now we've been using
>existing notes a
[posted & e-mailed]
In article <43bd55e3-e924-40b5-a157-b57ac8544...@f25g2000yqc.googlegroups.com>,
Kruptein wrote:
>
>I've released the second alpha for minimal-D a program I've written in
>python which should make developing easier.
>I need people to test the app on bugs and give ideas.
You s
On 2010-10-26, kj wrote:
> (Though, humorless as it is of me, I still would prefer the ZoP
> out of the standard library, to save myself having to tell those
> who are even newer to Python than me not to take it seriously.)
Well, not to take it *too* seriously.
It's like any other Zen -- it's wo
I need to generate PDF files and I'm exploring what tools to use. I was planing
on using ReportLab, but recently found some references to pango
(http://www.pango.org/) and ciaro (http://cairographics.org/) being able to
generate PDF files. But am having difficulty finding details.
The program m
On Tue, Oct 26, 2010 at 9:05 AM, kj wrote:
> In Terry Reedy
> writes:
>
>>On 10/25/2010 3:11 PM, kj wrote:
>
>>> Well, it's pretty *enshrined*, wouldn't you say?
>
>>No.
>
>> > After all, it is part of the standard distribution,
>
>>So is 'import antigravity'
>
> Are you playing with my feelin
On Oct 25, 5:44 pm, gershar wrote:
> I had some problems with some Python projects that gave variable
> results that I could not track down. Eventually and reluctantly I
> converted them to Java. Later, when I had more time I tried to analyze
> what the Python code was doing and found something st
In Terry Reedy
writes:
>On 10/25/2010 3:11 PM, kj wrote:
>> Well, it's pretty *enshrined*, wouldn't you say?
>No.
> > After all, it is part of the standard distribution,
>So is 'import antigravity'
Are you playing with my feelings?
% python
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29
On Tue, 26 Oct 2010 02:38:43 -0400, Steve Holden wrote:
>
> I really don't understand what you are trying to say here. Could you
> please explain? I know you to be a capable and sensible person, but this
> sounds like nonsense to me, so I must be misunderstanding.
>
I think he's saying that on a
Steve Holden wrote:
> On 10/24/2010 1:55 PM, mukkera harsha wrote:
>> Hello
>> I was wondering if there is an existing function that would let me
>> determine the difference in time. To explain:
>>
>> Upon starting a program:
>>
>> startup = time.time()
>>
>> After some very long processing:
recently wrote a article based on a debate here. (can't find the
original thread on Google at the moment)
• 〈What's List Comprehension and Why is it Harmful?〉
http://xahlee.org/comp/list_comprehension.html
it hit reddit.
http://www.reddit.com/r/programming/comments/dw8op/whats_list_comprehension_
John Nagle writes:
> On 10/25/2010 7:38 AM, Tim Chase wrote:
>> While a dirty hack for which I'd tend to smack anybody who used it...you
>> *can* assign to instance.__class__
>
>That's an implementation detail of CPython. May not work in
> IronPython, Unladen Swallow, PyPy, or Shed Skin.
>
>
'''
C:\Documents and Settings\Administrator\Desktop>python wtf.py
301 Moved Permanently
b'
\n301 Moved\n301 Moved\nThe
document has mo
ved\nhttp://www.google.de/";>here.\r\n\r\n'
foo 5.328 secs
301 Moved Permanently
bar 241.016 secs
C:\Documents and Settings\Administrator\Desktop>
'''
import http.
On 25 oct, 17:18, Joost Molenaar wrote:
> Thanks, Bruno.
> Your python-wiki page and walk-through for the Decorator code make it
> clear. I now finally understand that methods are in fact ordinary
> functions at the time the class is created, and that the descriptor
> protocol turns them into boun
On Oct 25, 11:20 pm, Jorgen Grahn wrote:
> On Mon, 2010-10-25, bruno.desthuilli...@gmail.com wrote:
> > On 25 oct, 15:34, Alex Willmer wrote:
> >> On Oct 25, 11:07 am, kj wrote:
>
> >> > In "The Zen of Python", one of the "maxims" is "flat is better than
> >> > nested"? Why? Can anyone give me
Greetings Philip !
> File "openastro.py", line 90, in
> >TRANSLATION[LANGUAGES[i]] =
> > gettext.translation("openastro",TDomain,languages=['en'])
> > File "/usr/lib/python2.6/gettext.py", line 484, in translation
> >raise IOError(ENOENT, 'No translation file found for domain', domain)
71 matches
Mail list logo