looping = True
while looping:
guess = int(raw_input("Take a guess: "))
tries += 1
if guess > the_number:
print "Lower..."
elif guess < the_number:
print "Higher..."
else:
print "You guessed it! The number was", the_number
print "And it only took y
MRAB,
I will check it out. Thanks!
Daniel
On Tue, Jan 11, 2011 at 10:23 PM, MRAB wrote:
> On 12/01/2011 01:50, Daniel da Silva wrote:
>
>> Hi,
>>
>> I have come across a task where I would like to scan a short 20-80
>> character line of text for instances of " ". Ideally
>> could be of any
This is something I've been fighting for a couple of days. Let me try to
describe it as I can.
I use "python2.5 + django1.0 + mod_python + apache2" to develop a website.
the website has run for two years. But the problem happend these days. when
I log in my system, the first browser's sessin will
(Please don't top-post replies. Instead, reply in-line with the quoted
material, removing irrelevant material. An example is this message.)
Catherine Moroney writes:
> I've looked at my sys.path variable and I see that it has a whole
> bunch of site-package directories, followed by the contents
I don't know where the site-packages directories are coming from -
maybe a site.py or sitecustomize.py? Sometimes you can strace with a
very large -s to see where something like this is coming from. -o is
your friend for saving the output to a file in, EG, /tmp.
What I usually do is to put speci
On Jan 4, 11:46 pm, Inyeol wrote:
> Which coding style do you prefer? I'm more toward public API way,
> since it requires less code change if I refactor private data
> structure later.
> Plz give pros and cons of these.
Great question. It gets at the heart of Python style.
It's a tricky question
On 13/01/2011 00:49, Corey Richardson wrote:
On 01/12/2011 07:39 PM, Corey Richardson wrote:
On 01/12/2011 07:35 PM, Cathy James wrote:
Dear all,
I hope someone out there can help me.
The output string of my code is close to what i need, but i need it
1)printed on one line and
2) reversed
Try
print s[::-1]
Nick
On Wednesday, January 12, 2011, Cathy James wrote:
> Dear all,
>
> I hope someone out there can help me.
>
> The output string of my code is close to what i need, but i need it
> 1)printed on one line and
>
> 2) reversed
>
>
> #mycode:
> s= input("Enter message: ")
> key
On 01/12/2011 07:39 PM, Corey Richardson wrote:
> On 01/12/2011 07:35 PM, Cathy James wrote:
>> Dear all,
>>
>> I hope someone out there can help me.
>>
>> The output string of my code is close to what i need, but i need it
>> 1)printed on one line and
>> 2) reversed
>>
>> #mycode:
>> s= inp
On 01/12/2011 07:35 PM, Cathy James wrote:
> Dear all,
>
> I hope someone out there can help me.
>
> The output string of my code is close to what i need, but i need it
> 1)printed on one line and
> 2) reversed
>
> #mycode:
> s= input("Enter message: ")
> key=1
> for letter in s:
> num=(
Dear all,
I hope someone out there can help me.
The output string of my code is close to what i need, but i need it
1)printed on one line and
2) reversed
#mycode:
s= input("Enter message: ")
key=1
for letter in s:
num=(chr(ord(letter)+1))
print(num)
#or is there a better way to rewrite
In article ,
Alice BevanMcGregor wrote:
> On 2011-01-10 19:49:47 -0800, Roy Smith said:
>
> > One of the surprising (to me, anyway) uses of JavaScript is as the
> > scripting language for MongoDB (http://www.mongodb.org/).
>
> I just wish they'd drop spidermonkey and go with V8 or another, f
On Wed, 2011-01-12 at 17:29 -0500, Scott McCarty wrote:
> Been digging ever since I posted this. I suspected that the response
> might be use a database.
I use shelve extensively; there are many use-cases where it makes sense.
And there are many where a database makes sense.
Basically, if I just
Scott McCarty wrote:
> Been digging ever since I posted this. I suspected that the response might
> be use a database. I am worried I am trying to reinvent the wheel. The
> problem is I don't want any dependencies and I also don't need persistence
> program runs.
I don't think sqlite3 counts as
Try using dividend % divisor, this will return the remainder
Rohan Pai
--
http://mail.python.org/mailman/listinfo/python-list
Been digging ever since I posted this. I suspected that the response might
be use a database. I am worried I am trying to reinvent the wheel. The
problem is I don't want any dependencies and I also don't need persistence
program runs. I kind of wanted to keep the use of petit very similar to cat,
h
In case you still need help:
- # Set the initial values
- the_number= random.randrange(100) + 1
- tries = 0
- guess = None
-
- # Guessing loop
- while guess != the_number and tries < 7:
- guess = int(raw_input("Take a guess: "))
- if guess > the_number:
- print "Lower..."
-
In article <0d7143ca-45cf-44c3-9e8d-acb867c52...@f30g2000yqa.googlegroups.com>,
Daniel da Silva wrote:
>
>I have come across a task where I would like to scan a short 20-80
>character line of text for instances of " ". Ideally
> could be of any tense.
In Soviet Russia, you!
--
Aahz (a...@pyth
On Wed, Jan 12, 2011 at 10:59 AM, Matty Sarro wrote:
> As of now here is my situation:
> I am working on a system to aggregate IT data and logs. A number of
> important data are gathered by a third party system. The only
> immediate way I have to access the data is to have their system
> automatic
Scott McCarty wrote:
> Sorry to ask this question. I have search the list archives and googled,
> but I don't even know what words to find what I am looking for, I am just
> looking for a little kick in the right direction.
>
> I have a Python based log analysis program called petit (
> http://cr
On Wed, Jan 12, 2011 at 1:05 PM, Scott McCarty wrote:
> Sorry to ask this question. I have search the list archives and googled, but
> I don't even know what words to find what I am looking for, I am just
> looking for a little kick in the right direction.
> I have a Python based log analysis prog
On 12/01/2011 21:05, Scott McCarty wrote:
Sorry to ask this question. I have search the list archives and googled,
but I don't even know what words to find what I am looking for, I am
just looking for a little kick in the right direction.
I have a Python based log analysis program called petit
(
> Dan Stromberg wrote:
>> On Tue, Jan 11, 2011 at 4:30 PM, Catherine Moroney
>> wrote:
>>>
>>> In what order does python import modules on a Linux system? I have a
>>> package that is both installed in /usr/lib64/python2.5/site-packages,
>>> and a newer version of the same module in a working dir
On 2011-01-10 19:49:47 -0800, Roy Smith said:
One of the surprising (to me, anyway) uses of JavaScript is as the
scripting language for MongoDB (http://www.mongodb.org/).
I just wish they'd drop spidermonkey and go with V8 or another, faster
and more modern engine. :(
- Alice.
--
Sorry to ask this question. I have search the list archives and googled, but
I don't even know what words to find what I am looking for, I am just
looking for a little kick in the right direction.
I have a Python based log analysis program called petit (
http://crunchtools.com/petit). I am trying
justin wrote:
> The title sounds too complex, but my question is actually simple.
>
> Suppose I have [1,2,3,4,5], then there are many ways of making
> clustering.
> Among them, I want to pair up terminals until there is only one left
> at the end.
> For example, 1,2),3),4),5), (1,(2,(3,(4,5))
On 2011-01-12, Jason Staudenmayer wrote:
> Return False instead of break should work
>
> else:
> print "You guessed it! The number was", the_number
> print "And it only took you", tries, "tries!\n"
> return False
Since he isn't in a function, that isn't any good. He wo
[wrapped lines to <80 characters per RFC 1855]
On 2011-01-12, Physics Python wrote:
> Is this an indentation problem then?
That depends how you look at it. I was not clear from your code exactly
where you wanted to handle things.
> How do I update the sentinel within the secondary while loop. I
Return False instead of break should work
else:
print "You guessed it! The number was", the_number
print "And it only took you", tries, "tries!\n"
return False
Jason
..·><º>
> -Original Message-
> From:
> python-list-bounces+jasons=adventureaquarium.
I've looked at my sys.path variable and I see that it has
a whole bunch of site-package directories, followed by the
contents of my $PYTHONPATH variable, followed by a list of
misc site-package variables (see below).
I've verified that if I manually reverse the order of sys.path
I can then import
I've looked at my sys.path variable and I see that it has
a whole bunch of site-package directories, followed by the
contents of my $PYTHONPATH variable, followed by a list of
misc site-package variables (see below).
I've verified that if I manually reverse the order of sys.path
I can then import
Thanks,
Is this an indentation problem then?
How do I update the sentinel within the secondary while loop. I am trying to
avoid using breaks by the way, as I can program this example using breaks:
--- start---
import random
print "\tWelcome to 'Guess my number'!:"
print "\nI'm thinking of a numb
On 2011-01-12, Terry Reedy wrote:
> On 1/12/2011 9:51 AM, Colin J. Williams wrote:
>
>>> It shows an example of Python code, which happens to have 2 syntax
>>> errors!
>>
>> Why not correct the Wikipedia entry?
>
> As I reported early, the errors, if any, are in .png and .svg images of
> text, wh
On 2011-01-12, Physics Python wrote:
> while guess != the_number:
=
> while tries > 7:
> if guess > the_number:
> print "Lower..."
> else:
> print "Higher..."
> guess = int(raw_input("Take a guess:
Hello,
I am teaching myself python using the book: Python Programming for Absolute
Beginners, 2nd edition by Michael Dawson. I am using python 2.7.1.
In chapter 3 we are learning to use structures (while, if, elif) to write a
program that has the user guess a number between 1 and 100.
Here is
The title sounds too complex, but my question is actually simple.
Suppose I have [1,2,3,4,5], then there are many ways of making
clustering.
Among them, I want to pair up terminals until there is only one left
at the end.
For example, 1,2),3),4),5), (1,(2,(3,(4,5, or (((1,2),(3,4)),
5) wou
As of now here is my situation:
I am working on a system to aggregate IT data and logs. A number of
important data are gathered by a third party system. The only
immediate way I have to access the data is to have their system
automatically email me updates in CSV format every hour. If I set up a
ma
On Jan 12, 2011, at 11:37 AM, Alan Harris-Reid wrote:
>
> Hi there, I wonder if any Python folk out there can help me.
>
> For many years I was a contractor developing desktop and web applications
> using Visual Foxpro as my main language, with Foxpro, SQL-server and Oracle
> as back-end data
On Jan 12, 4:37 pm, Alan Harris-Reid
wrote:
> Hi there, I wonder if any Python folk out there can help me.
>
> For many years I was a contractor developing desktop and web
> applications using Visual Foxpro as my main language, with Foxpro,
> SQL-server and Oracle as back-end databases. Unfortuna
> As I reported early, the errors, if any, are in .png and .svg images of
> text, which would have to be replaced, not corrected. Would be good
> since the imaged snippet is a haphazard except from a much larger file
> and inane out of context.
I don't think it really is a big deal. I mean, this i
On 2011-01-11 21:41:24 -0800, Michele Simionato said:
Originally plac too was able to recognize flags automatically by
looking at the default value (if the default value is a boolean then
the option is a flag); however I removed that functionality because I
wanted to be able to differentiate b
On 1/12/2011 9:51 AM, Colin J. Williams wrote:
It shows an example of Python code, which happens to have 2 syntax
errors!
Why not correct the Wikipedia entry?
As I reported early, the errors, if any, are in .png and .svg images of
text, which would have to be replaced, not corrected. Would
On 1/12/2011 11:37 AM, Alan Harris-Reid wrote:
...
updating my programming skills by learning Python (3) with SQLite,
JavaScript, HTML and CSS to a level where I can create and deploy
data-based web-sites.
...
I would even consider doing small projects for nothing so that I can
'get my foot in
Hi there, I wonder if any Python folk out there can help me.
For many years I was a contractor developing desktop and web
applications using Visual Foxpro as my main language, with Foxpro,
SQL-server and Oracle as back-end databases. Unfortunately Foxpro was
killed-off by Microsoft, hence my
On 10-Jan-11 16:02 PM, MRAB wrote:
On 10/01/2011 20:29, Dan Stromberg wrote:
I invite folks to check out Tiobe's Language Popularity Rankings:
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
The gist is: Python grew faster than any other programming language
over the last year
Hi All,
During automation of a test case the web interface throws failure and sucess
text in RED and GREEN colors respectively. Is there a method to read the
color of the Success(green) and Failure(red) from the screenshots of the
webinterfaces collect for Failure and Success
say :
import Image
Ian Kelly wrote:
> reader_iter = iter(self.reader)
> headers = reader_iter.next()
> # intermediate code
> for line in reader_iter:
> data.append(line)
> return data
If data is a list the for loop can be replaced with
data.extend(reader_iter)
or, if data is an empty list created within the
47 matches
Mail list logo