Re: OOP noob question: Mixin properties

2012-12-14 Thread Micky Hulse
Hi Steven!!! Thanks so much for the pro help, I really do appreciate it. :) On Thu, Dec 13, 2012 at 4:53 PM, Steven D'Aprano wrote: > Indentation is important. Please don't remove it. I've added it back in > below: Yikes! Sorry about that. I won't do that again in the future. :( Thanks for addi

Re: OOP noob question: Mixin properties

2012-12-13 Thread Steven D'Aprano
On Thu, 13 Dec 2012 16:20:51 -0800, Micky Hulse wrote: > Learning things here... > > In my mixin class (a version I wrote for Django) I had this (indentation > removed for better list readability): Indentation is important. Please don't remove it. I've added it back in below: > class JSONRespo

Re: OOP noob question: Mixin properties

2012-12-13 Thread Micky Hulse
On Wed, Dec 12, 2012 at 7:49 PM, Micky Hulse wrote: > I hope you don't mind that this question involves Django... I'm just > looking to improve my core Python skills (so, generic Python examples > would be cool). Just experimenting: I think that will help me ac

OOP noob question: Mixin properties

2012-12-12 Thread Micky Hulse
Dear Python Santa gurus, ;D I have this Django mixin: ...which is used to override render_to_response() so I can output a JSON response (the above code is pretty much straight

Re: Python Noob Question.

2012-12-10 Thread Alexander Blinne
Am 05.12.2012 21:24, schrieb Owatch: > Thanks a TON for your answer thought, this is exactly what I really hoped for. > The problem for me is that I don't actually know anything about writing a > function that opens a network socket, and "connects to that plugin und asks > it for the > informati

Re: Python Noob Question.

2012-12-05 Thread Owatch
Re On Monday, December 3, 2012 4:19:51 PM UTC+2, Alexander Blinne wrote: > Hello, > > > > by having a quick look at their website i found a plugin for CoreTemp > > which acts as a server and can be asked for status information of the > > cpu. Now your task is really simple: write a little fun

Re: Python Noob Question.

2012-12-03 Thread Alexander Blinne
Hello, by having a quick look at their website i found a plugin for CoreTemp which acts as a server and can be asked for status information of the cpu. Now your task is really simple: write a little function or class that opens a network socket, connects to that plugin und asks it for the informat

Re: Python Noob Question.

2012-12-03 Thread Owatch
On Sunday, December 2, 2012 11:44:05 PM UTC+2, Steven D'Aprano wrote: > On Sun, 02 Dec 2012 12:33:58 -0800, Owatch wrote: > > > > > Sorry, but I was redirected here via a thread on another forum > > > concerning where to find help for Python. (Python-forums.org not working > > > for me) > > >

Re: Python Noob Question.

2012-12-02 Thread Steven D'Aprano
On Sun, 02 Dec 2012 12:33:58 -0800, Owatch wrote: > Sorry, but I was redirected here via a thread on another forum > concerning where to find help for Python. (Python-forums.org not working > for me) > > I wanted to ask if there was any way I could write a simple Python > Temperature program. Whe

Python Noob Question.

2012-12-02 Thread Owatch
Sorry, but I was redirected here via a thread on another forum concerning where to find help for Python. (Python-forums.org not working for me) I wanted to ask if there was any way I could write a simple Python Temperature program. Where essentially it somehow (Now sure how, I'm a noob remember)

Re: Issue with Scrapping Data from a webpage- Noob Question

2012-02-09 Thread anon hung
> Hi Fellow Pythoners, > > I'm trying to collect table data from an authenticated webpage (Tool) to > which I have access. > > I will have the required data after 'click'ing a submit button on the tool > homepage. > When I inspect the submit button i see > > > Thus the tool's homepage is of the fo

Issue with Scrapping Data from a webpage- Noob Question

2012-02-07 Thread abhijeet mahagaonkar
Hi Fellow Pythoners, I'm trying to collect table data from an authenticated webpage (Tool) to which I have access. I will have the required data after 'click'ing a submit button on the tool homepage. When I inspect the submit button i see Thus the tool's homepage is of the form www.example.com/

Re: Noob Question

2011-04-19 Thread Felipe Bastos Nunes
Yes, Dan is right, it looked for the sources, and you have only binaries on your system. Look in your distribution repositories for the *-devel or alike for the 5 that failed and try again. 2011/4/19 Dan Stromberg > On Tue, Apr 19, 2011 at 7:55 AM, Rob McGillivray > wrote: > > Hi All, > > > > I

Re: Noob Question

2011-04-19 Thread Dan Stromberg
On Tue, Apr 19, 2011 at 7:55 AM, Rob McGillivray wrote: > Hi All, > > I'm new to Python, and trying to get python 3.2 installed on Centos 5.6. When > I run 'make test', I receive several errors. The readme states that you can > generally ignore messages about skipped tests, but as you can see be

Re: 3.2 test failures on Centos 5.6 (was Re: Noob Question)

2011-04-19 Thread Terry Reedy
On 4/19/2011 1:33 PM, Rob McGillivray wrote: I am trying to install from an RPM downloaded from python.org. That puzzles me. For *nix, I do not see .rpm, just tarballs, on http://python.org/download/releases/3.2/ -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

RE: 3.2 test failures on Centos 5.6 (was Re: Noob Question)

2011-04-19 Thread Rob McGillivray
Reedy Sent: Tuesday, April 19, 2011 12:59 PM To: python-list@python.org Subject: 3.2 test failures on Centos 5.6 (was Re: Noob Question) On 4/19/2011 10:55 AM, Rob McGillivray wrote: > I'm new to Python, and trying to get python 3.2 installed on Centos > 5.6. When I run 'mak

3.2 test failures on Centos 5.6 (was Re: Noob Question)

2011-04-19 Thread Terry Reedy
On 4/19/2011 10:55 AM, Rob McGillivray wrote: I'm new to Python, and trying to get python 3.2 installed on Centos 5.6. When I run 'make test', I receive several errors. Welcome to Python. Newbie lesson 1: write an informative subject line that will catch the attention of people who can answe

Noob Question

2011-04-19 Thread Rob McGillivray
Hi All, I'm new to Python, and trying to get python 3.2 installed on Centos 5.6. When I run 'make test', I receive several errors. The readme states that you can generally ignore messages about skipped tests, but as you can see below, some of the tests failed and a number were 'unexpected skips

Re: Noob question on 2 vs 3 Python releases

2010-12-29 Thread Anssi Saari
Franck Ditter writes: > Pardon my noobness (?) but why is there a 2.x and 3.x development > teams working concurrently in Python ? Well, Python 2.7 is the last major 2.x release, only bugfixes are done for it, like the 2.7.1 release. Actual developement is in the 3.x branch now. > Which one sh

Re: Noob question on 2 vs 3 Python releases

2010-11-14 Thread Dan Stromberg
On Sun, Nov 14, 2010 at 1:03 AM, Franck Ditter wrote: > Pardon my noobness (?) but why is there a 2.x and 3.x development > teams working concurrently in Python ? I hardly saw that in other > languages. Which one should I choose to start with, to cope with > the future ? Isn't 3.x supposed to ext

Re: Noob question on 2 vs 3 Python releases

2010-11-14 Thread Chris Rebert
On Sun, Nov 14, 2010 at 1:03 AM, Franck Ditter wrote: > Pardon my noobness (?) but why is there a 2.x and 3.x development > teams working concurrently in Python ? I hardly saw that in other > languages. You haven't heard of the infamous Perl 6? > Which one should I choose to start with, to cope

Noob question on 2 vs 3 Python releases

2010-11-14 Thread Franck Ditter
Pardon my noobness (?) but why is there a 2.x and 3.x development teams working concurrently in Python ? I hardly saw that in other languages. Which one should I choose to start with, to cope with the future ? Isn't 3.x supposed to extend 2.y ? This situation is very strange... Thanks for your expl

Re: Noob question

2009-01-30 Thread Bruno Desthuilliers
nanoe...@gmail.com a écrit : Hello? Hi. Ok, first, this is mostly OT here - your question should have gone to either the project's maintainer or any Ubuntu forum / mailing-list/whatever. I'm currently installed Ubuntu 8.10. I'm not a Linux person, so I don't know a lot about it. The rea

Noob question

2009-01-30 Thread nanoeyes
Hello? I'm currently installed Ubuntu 8.10. I'm not a Linux person, so I don't know a lot about it. The reason I installed Ubuntu is just for EMAN (http://blake.bcm.tmc.edu/eman/). EMAN 1.8 software requires Python 2.4 not 2.5 which comes with Ubuntu 8.10. I installed Python 2.4 by typing sudo apt

Re: Noob question: Is all this typecasting normal?

2009-01-17 Thread Tim Rowe
2009/1/3 Russ P. : > So unless you think the standard library will someday include code for > air traffic management, I'll stick with camelCase, and I'll thank you > for not making an issue of it. Another late comment, sorry, but as an air traffic management safety consultant, I'm quite intereste

Re: Noob question: Is all this typecasting normal?

2009-01-17 Thread Steven D'Aprano
On Sat, 17 Jan 2009 06:09:29 -0800, Aahz wrote: > You are missing the point: suppose you write a useful library in your > air traffic management application, maybe one that does a good job of > handling user input. If you have done a proper job of abstracting it > from your application as a whole

Re: Noob question: Is all this typecasting normal?

2009-01-17 Thread Aahz
[following up late] In article <2b3c916e-6908-4b12-933f-8f7bfa86c...@i20g2000prf.googlegroups.com>, Russ P. wrote: > >Fair enough, but for code that is not intended for general public >usage (i.e., most code) so-called camelCase is every bit as good if >not better than using underscores to divide

Re: Noob question: Is all this typecasting normal?

2009-01-06 Thread J Kenneth King
"Gabriel Genellina" writes: > En Mon, 05 Jan 2009 02:03:26 -0200, Roy Smith escribió: > > >> The other day, I came upon this gem. It's a bit of perl embedded in a >> Makefile; this makes it even more gnarly because all the $'s get >> doubled to >> hide them from make: >> >> define absmondir >>

Re: Noob question: Is all this typecasting normal?

2009-01-06 Thread vk
> Anyone have something to say about the userio stuff? (If you're going to post something about my coding style, I invite you to do something infinitely more useful: write crapToPep8.py {or is it crap_to_pep8?} to satisfy your sick fetish for consistency.) -- http://mail.python.org/mailman/listinf

Re: Noob question: Is all this typecasting normal?

2009-01-05 Thread Gabriel Genellina
En Mon, 05 Jan 2009 02:03:26 -0200, Roy Smith escribió: The other day, I came upon this gem. It's a bit of perl embedded in a Makefile; this makes it even more gnarly because all the $'s get doubled to hide them from make: define absmondir $(shell perl -e ' \                              

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread James Mills
On Mon, Jan 5, 2009 at 1:47 PM, sprad wrote: > On Jan 3, 6:41 pm, Steven D'Aprano cybersource.com.au> wrote: >> The OP comes from a Perl background, which AFAIK allows you to concat >> numbers to strings and add strings to numbers. That's probably the (mis) >> feature he was hoping Python had. I

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread Roy Smith
In article , sprad wrote: > On Jan 3, 6:41 pm, Steven D'Aprano cybersource.com.au> wrote: > > The OP comes from a Perl background, which AFAIK allows you to concat > > numbers to strings and add strings to numbers. That's probably the (mis) > > feature he was hoping Python had. > > That's cor

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread sprad
On Jan 3, 6:41 pm, Steven D'Aprano wrote: > The OP comes from a Perl background, which AFAIK allows you to concat > numbers to strings and add strings to numbers. That's probably the (mis) > feature he was hoping Python had. That's correct -- and that's been one of the more difficult parts of my

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread alex goretoy
My gmail did that. FYI, it wasn't intentional. А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я Paula Poundstone - "I don't have a bank account because I don't know my mother's maiden name." On Sun, Jan 4, 2009 at

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Steven D'Aprano
On Sat, 03 Jan 2009 16:19:58 +0100, Bruno Desthuilliers wrote: > But indeed, you obviously cannot add strings with numerics nor > concatenate numerics with strings. This would make no sense. The OP comes from a Perl background, which AFAIK allows you to concat numbers to strings and add strings

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Steven D'Aprano
On Sat, 03 Jan 2009 20:35:25 +, alex goretoy wrote: > for each his own. Please don't top-post. Please don't quote the ENTIRE body of text (PLUS doubling it by including a completely useless HTML version) just to add a trivial comment. Trim the text you are replying to. > Any more word on

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread vk
> Any more word on userio? None yet, I'm afraid. Should've started a different thread for it - but it's stuck here (in obscurity) forever xd. -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread alex goretoy
for each his own. Any more word on userio? On Sat, Jan 3, 2009 at 6:14 PM, Russ P. wrote: > On Jan 2, 10:50 pm, Ben Finney > > > > wrote: > > s0s...@gmail.com writes: > > > On Jan 2, 7:20 pm, Ben Finney > > > > > > > > wrote: > > > > They don't need to be creative; they merely need to confo

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Russ P.
On Jan 2, 10:50 pm, Ben Finney wrote: > s0s...@gmail.com writes: > > On Jan 2, 7:20 pm, Ben Finney > > wrote: > > > They don't need to be creative; they merely need to conform with > > > the naming scheme as laid out in the PEP. > > > If it's something to be included in the standard library, I ag

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Bruno Desthuilliers
sprad a écrit : I've done a good bit of Perl, but I'm new to Python. I find myself doing a lot of typecasting (or whatever this thing I'm about to show you is called), Actually, it's just plain object instanciation. and I'm wondering if it's normal, or if I'm missing an important idiom. For

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread vk
> Unless you explicitly *never* intend sharing your code with *anyone*, > it's best to code all your Python code in accordance with PEP 8 anyway. Well said. Let's bury the puppy already. Anyone have something to say about the userio stuff? -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Ben Finney
s0s...@gmail.com writes: > On Jan 2, 7:20 pm, Ben Finney > wrote: > > They don't need to be creative; they merely need to conform with > > the naming scheme as laid out in the PEP. > > If it's something to be included in the standard library, I agree > (just for consistency, not because using_un

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread vk
> etc etc ... IOW consider not biting off more than you can chew. It's possible that I am, but where's the fun without the risk? Good thinking in your post though! I will add "get_date" at some point, and I've modified "get_numeric" already. All-right, the moment you've all been waiting for: ---

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Russ P.
On Jan 2, 6:15 pm, s0s...@gmail.com wrote: > On Jan 2, 7:20 pm, Ben Finney > wrote: > > > vk writes: > > > > If there were, I would expect it to conform with PEP 8 (get those > > > > ugly camelCase names outta there :-) > > > > haha, please forgive me. > > > I'll try and think of some more creati

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Steven D'Aprano
On Fri, 02 Jan 2009 21:02:19 -0500, Steve Holden wrote: > Ben Finney wrote: >> vk writes: >> If there were, I would expect it to conform with PEP 8 (get those ugly camelCase names outta there :-) >>> haha, please forgive me. >>> I'll try and think of some more creative names. >> >> Th

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread r
On Jan 2, 6:57 pm, Andreas Waldenburger wrote: [snip] > You even assumed that distinction in your example: > > > >>> 'hello world".title() [snip] sorry, here is TitleCase.py_b2 py> 'hello world'.title().replace(' ', '') -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread s0suk3
On Jan 2, 7:20 pm, Ben Finney wrote: > vk writes: > > > If there were, I would expect it to conform with PEP 8 (get those > > > ugly camelCase names outta there :-) > > > haha, please forgive me. > > I'll try and think of some more creative names. > > They don't need to be creative; they merely n

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Steve Holden
Ben Finney wrote: > vk writes: > >>> If there were, I would expect it to conform with PEP 8 (get those >>> ugly camelCase names outta there :-) >> haha, please forgive me. >> I'll try and think of some more creative names. > > They don't need to be creative; they merely need to conform with the

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Ben Finney
vk writes: > > If there were, I would expect it to conform with PEP 8 (get those > > ugly camelCase names outta there :-) > > haha, please forgive me. > I'll try and think of some more creative names. They don't need to be creative; they merely need to conform with the naming scheme as laid out

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread John Machin
On Jan 3, 11:16 am, vk wrote: > > If there were, I would expect it to conform with PEP 8 (get those ugly > > camelCase names outta there :-) > > haha, please forgive me. > I'll try and think of some more creative names. > > atm, I've got a chem final to study for. > I'll probably post something re

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Andreas Waldenburger
On Fri, 2 Jan 2009 16:44:11 -0800 (PST) r wrote: > On Jan 2, 6:26 pm, Andreas Waldenburger wrote: > > On Fri, 2 Jan 2009 16:16:10 -0800 (PST) vk wrote: > > > > > > If there were, I would expect it to conform with PEP 8 (get > > > > those ugly camelCase names outta there :-)   > > > > > haha, pl

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread r
On Jan 2, 6:26 pm, Andreas Waldenburger wrote: > On Fri, 2 Jan 2009 16:16:10 -0800 (PST) vk wrote: > > > > If there were, I would expect it to conform with PEP 8 (get those > > > ugly camelCase names outta there :-)   > > > haha, please forgive me. > > I'll try and think of some more creative nam

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Andreas Waldenburger
On Fri, 2 Jan 2009 16:16:10 -0800 (PST) vk wrote: > > If there were, I would expect it to conform with PEP 8 (get those > > ugly camelCase names outta there :-) > > haha, please forgive me. > I'll try and think of some more creative names. FYI: The names themselves aren't he problem at all. T

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread vk
> If there were, I would expect it to conform with PEP 8 (get those ugly > camelCase names outta there :-) haha, please forgive me. I'll try and think of some more creative names. atm, I've got a chem final to study for. I'll probably post something resembling useful code tomorrow morning. until

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Ben Finney
vk writes: > There needs to be a "user_io" or "sanitize" module in the standard > library to take care of this stuff. > Like: > > import userio > > logic = userio.userio() > > number = logic.getNumeric("blah: ") # will offer the user a "re-do" in > case of bad input > number = logic.forceGetNu

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread r
> There needs to be a "user_io" or "sanitize" module in the standard > library to take care of this stuff. [snip] +1 You are sooo right. You know, it is easy to forget about such things after you learn a language, i have written my own input logic, but i remember my __init__ days with python now a

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Andreas Waldenburger
On Fri, 2 Jan 2009 14:36:04 -0800 (PST) vk wrote: > There needs to be a "user_io" or "sanitize" module in the standard > library to take care of this stuff. > [snip example] > Great idea! +1 > ... but there isn't, as far as I know. Well, get to it, then. ;) /W -- My real email address is co

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread vk
> You might better do > > bet = int(raw_input("Enter your bet")) > > because then you don't need to later on convert bet again and again. This is all fine until you give it to an end-user. This is what I picture: $ ./script.py Enter your bet: $10 .. or perhaps "ten", "all", or a jillion other ta

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread TechieInsights
You can use the built-in string formatting options and operations. 2.5: http://www.python.org/doc/2.5.2/lib/typesseq-strings.html 2.6: http://docs.python.org/library/string.html In essence, you can do: print "You still have $%i remaining" %(money) On Jan 2, 2:15 pm, sprad wrote: > I've done a g

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Diez B. Roggisch
sprad schrieb: I've done a good bit of Perl, but I'm new to Python. I find myself doing a lot of typecasting (or whatever this thing I'm about to show you is called), and I'm wondering if it's normal, or if I'm missing an important idiom. It is normal, although below you make things needlessly

Re: Noob question: Is all this typecasting normal?

2009-01-02 Thread Benjamin Kaplan
On Fri, Jan 2, 2009 at 4:15 PM, sprad wrote: > I've done a good bit of Perl, but I'm new to Python. > > I find myself doing a lot of typecasting (or whatever this thing I'm > about to show you is called), and I'm wondering if it's normal, or if > I'm missing an important idiom. > > For example: >

Noob question: Is all this typecasting normal?

2009-01-02 Thread sprad
I've done a good bit of Perl, but I'm new to Python. I find myself doing a lot of typecasting (or whatever this thing I'm about to show you is called), and I'm wondering if it's normal, or if I'm missing an important idiom. For example: bet = raw_input("Enter your bet") if int(bet) == 0: # r

Re: noob question : library versus normal python files

2008-06-06 Thread [EMAIL PROTECTED]
On 6 juin, 19:36, रवींदर ठाकुर (ravinder thakur) <[EMAIL PROTECTED]> wrote: > hello friends, > > i have a python library(rdflib) that i am using in some project using > Google App Engine. I have developed everything using this on my local > machine and things work fine. But in my final deployment,

noob question : library versus normal python files

2008-06-06 Thread ravinder thakur
hello friends, i have a python library(rdflib) that i am using in some project using Google App Engine. I have developed everything using this on my local machine and things work fine. But in my final deployment, i have to use it in source code form rather than in library form. If i remove the li

Re: Noob question

2008-01-07 Thread rocco . rossi
On Jan 7, 12:09 am, GHZ <[EMAIL PROTECTED]> wrote: > Had the same issue. What you want is: reload() Thanks :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Noob question

2008-01-06 Thread GHZ
Had the same issue. What you want is: reload() -- http://mail.python.org/mailman/listinfo/python-list

Noob question

2008-01-06 Thread rocco . rossi
Tinkering with Python I find myself often writing scripts and then experimenting with the interactive interpreter, which is really a cool way to learn a language. However, when, after loading a module with import or from module import * and using it, I make a change to the module file, the cha

Re: noob question How do I run a Python script.

2007-06-30 Thread Bruno Desthuilliers
CarlP a écrit : > How do I run a Python script. usually, it's: $ python /path/to/somescript.py arg1 argN on a command line prompt. > I have one that gmail loader needs to > run on my email box. Here's the script > > http://www.marklyon.org/gmail/cleanmbox.py > > I can't seem to find what I ne

Re: noob question How do I run a Python script.

2007-06-28 Thread Matimus
> I installed python, run the interpreter and the script... Are you trying to run the script from the interpreter? You _can_ run scripts from the interpreter, but it isn't as simple as typing the name of the script. To me, that is what it sounds like you are trying to do. I don't know what environ

Re: noob question How do I run a Python script.

2007-06-28 Thread kyosohma
On Jun 28, 12:17 pm, CarlP <[EMAIL PROTECTED]> wrote: > How do I run a Python script. I have one that gmail loader needs to > run on my email box. Here's the script > > http://www.marklyon.org/gmail/cleanmbox.py > > I can't seem to find what I need to run it. I installed python, run > the interpret

noob question How do I run a Python script.

2007-06-28 Thread CarlP
How do I run a Python script. I have one that gmail loader needs to run on my email box. Here's the script http://www.marklyon.org/gmail/cleanmbox.py I can't seem to find what I need to run it. I installed python, run the interpreter and the script , but all it will do is say invalid syntax. Th

Re: Noob Question: Force input to be int?

2007-01-24 Thread consmash
On 23 Sty, 10:59, [EMAIL PROTECTED] wrote: > Hello everyone! > I have a piece of code that looks like this: > > if len(BuildList) > 0: > print "The script found %d game directories:" % len(BuildList) > print > num = 0 > for i in BuildList: > print str(num) +" " + i >

Re: Noob Question: Force input to be int?

2007-01-23 Thread Daniel Jonsson
Ah, thank you for the respone! I have not gotten around to test it yet, but I hope it will work! :) -Daniel 2007-01-23 10:59:37 [EMAIL PROTECTED] wrote in message <[EMAIL PROTECTED]> > Hello everyone! > I have a piece of code that looks like this: > > if len(BuildList) > 0: > print "The sc

Re: Noob Question: Force input to be int?

2007-01-23 Thread Paul Rubin
[EMAIL PROTECTED] writes: > print "Select a build number from 0 to " + str(len(BuildList) - 1) > buildNum = int(raw_input('Select build #> ')) > > while buildNum > (len(BuildList) -1) or buildNum <= -1: > print > print "Error: Invalid build number!" > print "Sel

Re: Noob Question: Force input to be int?

2007-01-23 Thread Daniel Nogradi
> I have a piece of code that looks like this: > > if len(BuildList) > 0: > print "The script found %d game directories:" % len(BuildList) > print > num = 0 > for i in BuildList: > print str(num) +" " + i > num = num + 1 > print > print "Select a build

Noob Question: Force input to be int?

2007-01-23 Thread wd . jonsson
Hello everyone! I have a piece of code that looks like this: if len(BuildList) > 0: print "The script found %d game directories:" % len(BuildList) print num = 0 for i in BuildList: print str(num) +" " + i num = num + 1 print print "Select a build numbe

Re: noob question

2006-09-22 Thread Jay
http://code.google.com/hosting/ xandeer wrote: > where is a good open-source project website? > thank-you > (sorry for being so annoying)(if I'm annoying)(if not then I'm not > sorry) -- http://mail.python.org/mailman/listinfo/python-list

Re: noob question

2006-09-22 Thread John Salerno
xandeer wrote: > where is a good open-source project website? > thank-you > (sorry for being so annoying)(if I'm annoying)(if not then I'm not > sorry) > sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list

noob question

2006-09-22 Thread xandeer
where is a good open-source project website? thank-you (sorry for being so annoying)(if I'm annoying)(if not then I'm not sorry) -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another noob question

2006-08-15 Thread Jason Nordwick
That isn't what I meant. If there was a a point (and I'm not really sure that I'm even trying to make one), the point was that Google makes heavy use of reduce-like functionality, essentially implementing a distributed reduce across a cluster. From what I hear, they use a lot of Python and hired

Re: yet another noob question

2006-08-15 Thread Steve Holden
Jason Nordwick wrote: > I use reduce to also do indexing, hashing with upsert semantics of lists of > key-value pairs, transitioning through a state table, etc... > > Somebody else pointed out to me how odd it is of Python to be ditching reduce > when Guido van Rossum was hired by Google, and Go

Re: yet another noob question

2006-08-15 Thread Jason Nordwick
I use reduce to also do indexing, hashing with upsert semantics of lists of key-value pairs, transitioning through a state table, etc... Somebody else pointed out to me how odd it is of Python to be ditching reduce when Guido van Rossum was hired by Google, and Google is literally built on map

Re: yet another noob question

2006-08-14 Thread starGaming
Jason Nordwick wrote: > *mouth agape* > > Wow. That really sucks. I make extensive use of reduce. It seems to run more > than twice as fast as a for loop. > > >>> t = Timer('bino.reduceadd(bino.bits)', 'import bino') > >>> s = Timer('bino.loopadd(bino.bits)', 'import bino') > >>> t.timeit(10) > 1

Re: yet another noob question

2006-08-14 Thread Stargaming
Jason Nordwick wrote: > > [EMAIL PROTECTED] wrote: > >> Jason Nordwick: >> >>> Stargaming wrote: >>> Also note that reduce will be removed in Python 3000. >>> >>> What will replace it? >> >> >> Nothing, I presume. You will have to write a function to find another >> way to solve problems. >

Re: yet another noob question

2006-08-14 Thread AlbaClause
mike_wilson1333 wrote: > I would like to generate every unique combination of numbers 1-5 in a 5 > digit number and follow each combo with a newline. So i'm looking at > generating combinations such as: (12345) , (12235), (4) and so on. > What would be the best way to do this? So, basically i

Re: yet another noob question

2006-08-14 Thread Jason Nordwick
*mouth agape* Wow. That really sucks. I make extensive use of reduce. It seems to run more than twice as fast as a for loop. >>> t = Timer('bino.reduceadd(bino.bits)', 'import bino') >>> s = Timer('bino.loopadd(bino.bits)', 'import bino') >>> t.timeit(10) 1.2373670396656564 >>> s.timeit(10) 2.64

Re: yet another noob question

2006-08-14 Thread bearophileHUGS
Jason Nordwick: > Stargaming wrote: > > Also note that reduce will be removed in Python 3000. > What will replace it? Nothing, I presume. You will have to write a function to find another way to solve problems. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another noob question

2006-08-14 Thread Jason Nordwick
Stargaming wrote: > > Also note that reduce will be removed in Python 3000. What will replace it? -j -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another noob question

2006-08-14 Thread Jason Nordwick
Somehow my other response to the list got lost. I'm still learning Python, but this seems much better than my first attempt: def pr(x): print x def cross(x,y): return [a+b for a in x for b in y] x=map(pr, reduce(cross, [map(str,range(1,6))]*5)) -j Stargaming wrote: > Jason Nordwick schrieb: >>

Re: yet another noob question

2006-08-14 Thread bearophileHUGS
Gerard Flanagan: > mod5 = ['1','2','3','4','5'] > X = [ ''.join([a,b,c,d,e]) > for a in mod5 > for b in mod5 > for c in mod5 > for d in mod5 > for e in mod5 ] A modified version of your one is the faster so far: v = "12345" r = [a+b+c+d+e for a in v for b in v for c

Re: yet another noob question

2006-08-14 Thread Gerard Flanagan
mike_wilson1333 wrote: > I would like to generate every unique combination of numbers 1-5 in a 5 > digit number and follow each combo with a newline. So i'm looking at > generating combinations such as: (12345) , (12235), (4) and so on. > What would be the best way to do this? So, basically i

Re: yet another noob question

2006-08-14 Thread bearophileHUGS
Stargaming: > Also note that reduce will be removed in Python 3000. Then let's use it until it lasts! :-) bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: yet another noob question

2006-08-14 Thread Stargaming
Jason Nordwick schrieb: > Or without filter: > > from operator import add > def pr(x): print x > def cross(x,y): return reduce(add, [[a+b for b in y] for a in x]) > x=map(pr, reduce(cross, [map(str,range(1,6))]*5)) > [...] reduce(add, list) is the same as sum(list) and is only half as fast as su

Re: yet another noob question

2006-08-13 Thread Jason Nordwick
better (sorry, still learning Python): def cross(x,y): return [a+b for a in x for y in b] Jason Nordwick wrote: > Or without filter: > > from operator import add > def pr(x): print x > def cross(x,y): return reduce(add, [[a+b for b in y] for a in x]) > x=map(pr, reduce(cross, [map(str,range(1,6)

Re: yet another noob question

2006-08-13 Thread Jason Nordwick
Or without filter: from operator import add def pr(x): print x def cross(x,y): return reduce(add, [[a+b for b in y] for a in x]) x=map(pr, reduce(cross, [map(str,range(1,6))]*5)) mike_wilson1333 wrote: > I would like to generate every unique combination of numbers 1-5 in a 5 > digit number and

Re: yet another noob question

2006-08-13 Thread Jason Nordwick
def pr(x): print(x) >>> x=map(pr,[x for x in xrange(11,56) if '1'<=min(str(x)) and >>> max(str(x))<='5']) 11 12 13 14 15 21 22 23 24 25 31 32 33 34 35 41 42 43 44 45 51 52 53 54 55 mike_wilson1333 wrote: > I would like to generate every unique combination of numbers 1-5 in a 5 > digit number an

Re: yet another noob question

2006-08-13 Thread [EMAIL PROTECTED]
Sybren Stuvel wrote: > mike_wilson1333 enlightened us with: > > I would like to generate every unique combination of numbers 1-5 in a 5 > > digit number and follow each combo with a newline. So i'm looking at > > generating combinations such as: (12345) , (12235), (4) and so on. > > Count fro

Re: yet another noob question

2006-08-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: >mike_wilson1333 <[EMAIL PROTECTED]> wrote: > >> I would like to generate every unique combination of numbers 1-5 in a 5 >> digit number and follow each combo with a newline. So i'm looking at .

Re: yet another noob question

2006-08-13 Thread Paul Rubin
Paul Rubin writes: > Now you can use the function to print the list you wanted: > > for i in xrange(1234,1333): >print base5x(i, 5) Whoops, pasted the wrong thing from my test window. Sorry. That was supposed to say: for i in xrange(5**5): p

Re: yet another noob question

2006-08-13 Thread Paul Rubin
"mike_wilson1333" <[EMAIL PROTECTED]> writes: > I would like to generate every unique combination of numbers 1-5 in a 5 > digit number and follow each combo with a newline. So i'm looking at > generating combinations such as: (12345) , (12235), (4) and so on. > What would be the best way to do

  1   2   3   >