> From: alex23
> (I also think there's value to be gained in studying _bad_ code,
> too...)
Oh, very true. And not just true for python. But, only if an 'expoert'
points out why it is bad and provides an alternative. And saying things
like, "it isn't pyhonic" or that such and such is a more "
> From: Arnaud Delobelle
>
>
> > >>> XstrNmbr = 3579.127893
>
> I meant
> >>> XstrNmbr = "3579.127893"
>
> > >>> round(float(XstrNmbr), -2)
> > 3600.0
Ah, then you will need to cast it first.
>>> XstrNmbr = '3579.127893'
>>> round(float(XstrNmbr) ,-2)
3600.0
The information contained in
> From: noydb
> If one has a floating number as a string, is there a spiffy way to
> round that string-number UP to the nearest 100?
>
> XstrNmbr = 3579.127893 -- would want to round that to 3600.
What's wrong with round? round( XstrNmbr, -2 ) seems to do the trick.
Or do you want to get ri
> From: Dotan Cohen
>
> 2008/10/8 Support Desk <[EMAIL PROTECTED]>:
> > I got a solution, cutt it off, and then Kill yourself.
> >
>
> Cut what off? The OP is female.
Are you sure about that? :)
The information contained in this message and any attachment may be
proprietary, c
> -Original Message-
> From: Calvin Spealman
>
> God forbid I try to make a joke.
No kidding! As a lurker newbie, I don't mind one bit. Actually, I have
yet to meet a person that codes in Ruby that doesn't also do Python. I
have met many Python coders that have never even looked at
> From: Derek Martin
> The term "PC" is commonly used in
> English, in the United States and other English speaking countries, to
> mean a computer running Microsoft Windows.
That isn't quite true.
My kids are heading off to college and are in the market for laptops.
The question they had f
>
> From: mk
> Wrong! Real programmers can program using only Touring machine (and
> something having to do with post for some reason). I'm sure our
> brilliant OP[1] could program in both.
Ah, now we can really got OT. My favorite Touring machine is a Jaguar (
with the pronounced 'U' in t
> -Original Message-
> From: Hank @ITGroup
> I am writing this letter to unsubscribe this mail-address from python
> mail-list.
> --
> http://mail.python.org/mailman/listinfo/python-list
>
No problem, Hank. You will be officially off of this 'mail-list' after
a visit to this site;
> From: Grant Edwards
>
> Anyway, I apologize for my attempt at humor, since it appears
> to have somehow offended.
Why apologize? If someone doesn't like the name given to a piece of
software by its author(s), screw them. If I find the software useful,
I'll use it. Even if its called 'bounci
> -Original Message-
> From: thebjorn
>
> On Sep 29, 9:32 pm, stdazi <[EMAIL PROTECTED]> wrote:
> > On Sep 29, 6:07 pm, [EMAIL PROTECTED] wrote:
> >
> > > You did not mention the OS, but because you are using
> > > "pathname\editfile.txt", it sounds like you are using an
> MS OS. From
> -Original Message-
> From: stdazi
> On Sep 29, 6:07 pm, [EMAIL PROTECTED] wrote:
>
> > You did not mention the OS, but because you are using
> > "pathname\editfile.txt", it sounds like you are using an MS OS.
From
> > past experience with various MS OSes, I found that as the number of
> -Original Message-
> From: [EMAIL PROTECTED]
> the program works great except for one thing. It's significantly
> slower through the later files in the search then through the early
> ones... Before anyone criticizes, I recognize that that middle section
> could be simplified with a fo
::CLAP CLAP::
thank you!
I have been in the newsgroups for over 12 years and I never cared about the
top/bottom post silliness. All I care about is that the message is clearly
written. Everything else is doggerel.
> -Original Message-
> From: Carroll, Barry
>
> Personally, I don't
After 394 postings in this thread, you all have convinced me. I am dropping
all of my python code and switching to Lisp.
thank-you
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus pro
> -Original Message-
> From: John Salerno
>
> I don't use IDLE too much anymore, just for quick tests, but
Just curious. I have tried IDLE, but stopped using it after going through a
few of the tutorials. I just type things in at the 'python' prompt, regardless
of which platform I
> -Original Message-
> From: [EMAIL PROTECTED]
> How can I access partial seconds on the system clock?
What is wrong with time.time()?
>>> import time
>>> time.time()
1160578386.0109401
>>> time.time()
1160578386.87324
>>> time.time()
1160578387.5790291
>>> x = time.time()
>>> y = tim
> -Original Message-
> From: Kay Schluehr
>
> >
> > python:
> > while i < length:
> > i += 1
>
> As AlbaClause had demonstrated you can iterate over indices as well
> using the for-statement and the range() function. But you can also
> combine iterating over elements
-Original Message-
From: Grant Edwards
>>> Actually having mailing lists send you mail is insane.
Once upon a time, I would have agreed. However, it is becoming increasingly
difficuilt to get to the newgroups directly from the workplace. The only
recourse is to use the mailing lists
!
!
-Original Message-
From: John Bokma
And ain't it cool that reporting Xah's abuse might stop both?
--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/
CRAP!
huh?
This seems to work just fine for me...
>>> name = '%raj%'
>>> test = "SELECT * FROM tb_name WHERE firstname LIKE '%s'" % name
>>> print test
SELECT * FROM tb_name WHERE firstname LIKE '%raj%'
-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
n.org]On Behalf
Well, it works for me and x is a list, not a tuple. Or am I reading too
much into your subject line?
-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
n.org]On Behalf Of Tuvas
Sent: Thursday, December 15, 2005 12:20 PM
To: python-list@python.org
Subject: Tuples
Let's
Actually, the continuous complaining and ranting about Xah's 'postings' are
far worse than Xah's actual postings. I can filter his stuff to /dev/null.
The drivel that follows is almost as bad as the moronic effluent about how
extra-python things should be done or not be done or the legal notices
How about doing an 'ls -la' once you have connected to the server? That
returns a listing of the files with the size in bytes.
-Original Message-
From: Michele Simionato
I am having a hard time in finding out how to retrieve information about the
*size* of files I want to download from
I'll assume that you are not familiar with Windows, so forgive me if you
know this.
1) Go to a command prompt.
The location of this depends on which OS you are running. But, you can go
to Start / Run... and type in cmd or command. This will give you a window
with a 'DOS' prompt.
2) Type pat
Jason,
YMMV = Your Mileage May Vary
In other words, how well it works for you depends on a lot of things. You
need to determine the suitability for a given task. :)
Michael
Don't like the legal notice at the end of my email? Too bad, you can
stuff it where the sun don't shine.
-O
Maybe you can get some ideas over at http://validator.w3.org/docs/. At
least they have the whole parser thing worked out.
-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
n.org]On Behalf Of DENG
Sent: Friday, September 02, 2005 8:36 AM
To: python-list@python.org
Subje
update works like append for lists
a = {}
a['a']='a'
a['c']='c'
b={}
b['b'] = 'b'
c={}
c.update(a)
c.update(b)
-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
n.org]On Behalf Of DENG
Sent: Tuesday, August 30, 2005 10:45 AM
To: python-list@python.org
Subject: how to
Tom,
Well, as one newbie to another, I tried this;
>>> x = '22,44,66,88,"asd,asd","23,43,55"'
>>> y = eval(x)
>>> y
(22, 44, 66, 88, 'asd,asd', '23,43,55')
given that x some how comes from a single line in your file.
BTW, do you get the tutor list as well? My guess is that the 'experts' over
h
All,
As the subject line says, I am having some trouble passing bind variables to
Oracle. When I pass a printable string value, such as 'NM', I get data.
When I try to pass a non-printable character, such as 'return' - chr(13), I
get no data back. I can't simply make NactionCode = chr(13), as py
try b1="c:/test.txt"
It seems to work for me on Windows 2000.
-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
n.org]On Behalf Of George
Sent: Thursday, May 12, 2005 9:41 AM
To: python-list@python.org
Subject: Launch file in Notepad
Newbie question:
I'm trying to l
def testSpiritual():
''' look within '''
if knowChrist:
cryWithTheSaints()
else:
laughWithTheSinners()
-Original Message-
[mailto:[EMAIL PROTECTED]
g]On Behalf Of rbt
Who is this Jesus you are talking about? Does he know Python or
something? What do fig t
> From: [EMAIL PROTECTED]
>
> I want to remove the commas, and square brackets [ and ]
> characters and
> rewrite this whole line (and all the ones following in a text file
> where only space would be a delimiter. How do I do this ?
>
If all you want to do to the data as you read in and write
Laszlo,
>>> Is it something like 'center' or 'color' for Americans and 'centre' or
'colour' for British people?
Yes, exactly.
>>> (Sorry to be offtopic)
No need to apologize. I started to read the postings on this list and was
dismayed at the depth of rudeness on here. I thought that python
print a[10:15]
or
print a[10:]
-Original Message-
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
n.org]On Behalf Of praba kar
Sent: Saturday, April 16, 2005 10:28 AM
To: python-list@python.org
Subject: trouble to print array contents using slice operator
Dear all,
In Php array
All,
I have been going through the manuals and not having much luck with the
following code. This is basically an issue of giving 'split' multiple
patterns to split a string. If it had an ignore case switch, the problem
would be solved. Instead, I have to code the following, which works fine
fo
how about?
test = 3 #find person with this number
for x in xrange(len(phone.keys())):
print x
if phone[phone.keys()[x]] == test:
print phone.keys()[x]
break
Being a newbie myself, I'd love a little critique on the above. Be kind as
I don't know what else needs to be done
36 matches
Mail list logo