Eclipse with pydev (great debugging) does the trick nicely, free of
charge and throws in some other goodies (JScript/HTML/XML editing) too.
I use the EE for Java developer version
http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/heliosr
Install pydev from Menu Help/Soft
sturlamolden wrote:
> On 11 Aug, 08:40, Ulrich Eckhardt wrote:
> Header (definition) and source (implementation) is not the same.
I'm aware of this and that's not the thing I was talking about.
Uli
--
Sator Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932
--
http
Vito 'ZeD' De Tullio, 12.08.2010 08:49:
I know, maybe I'm just lazily speculating, but I'm curious about what's
next, in python, when GvR will stop the moratorium and will let changes in
the language.
I don't know what to expect... some syntax sugar about concurrent
programming? static types? an
Vito 'ZeD' De Tullio writes:
> I know, maybe I'm just lazily speculating, but I'm curious about
> what's next, in python, when GvR will stop the moratorium and will let
> changes in the language.
Subscribe to the ‘python-ideas’ forum for the latest pie-in-the-sky
discussions about how to change
> So... why does having a non-ascii character in sys.ps1 make the prompt
> vanish?
I can't pinpoint it to a specific line of code. Most likely, it tries
to encode the prompt as ASCII before writing it to stdout. That fails,
and it silently ignores the error.
FWIW, this is fixed in Python 3.
Reg
Hi Steven,
On 08/12/2010 01:37 AM, Steven D'Aprano wrote:
> On Wed, 11 Aug 2010 13:14:35 -0700, Baba wrote:
>
>> level: beginner
>>
>> exercise: given that packs of McNuggets can only be bought in 6, 9 or 20
>> packs, write an exhaustive search to find the largest number of
>> McNuggets that cann
In message , Daniel
Fetchinson wrote:
> A web server may present different output depending on the client
> used.
It may also require execution of some JavaScript to insert HTML content.
> So you might want to make urllib appear as a browser by sending the
> appropriate headers.
If the above i
Steven D'Aprano wrote:
On Wed, 11 Aug 2010 13:14:35 -0700, Baba wrote:
level: beginner
exercise: given that packs of McNuggets can only be bought in 6, 9 or 20
packs, write an exhaustive search to find the largest number of
McNuggets that cannot be bought in exact quantity.
Is this a trick q
On Wed, Aug 11, 2010 at 11:53 PM, Werner Thie wrote:
> Eclipse with pydev (great debugging) does the trick nicely, free of charge
> and throws in some other goodies (JScript/HTML/XML editing) too.
>
> I use the EE for Java developer version
>
> http://www.eclipse.org/downloads/packages/eclipse-ide
On 08/11/2010 10:14 PM, Baba wrote:
> level: beginner
>
> exercise: given that packs of McNuggets can only be bought in 6, 9 or
> 20 packs, write an exhaustive search to find the largest number of
> McNuggets that cannot be bought in exact quantity.
>
> exercise source:
> http://ocw.mit.edu/cours
In article
,
ChrisChia wrote:
> Hi i have the following problem with Python Tkinter.
> I switch to switch the image background (which i used Tkinter.Label
> with image arg to display on the GUI).
>
> How can I do that? the callback function which i have created doesn't
> seem to work...
It is
On Aug 11, 8:31 pm, Back9 wrote:
> Hi,
>
> Does anyone know of what is the most popular gui framework for python
> application?
>
> TIA
I used to prefer using GTK mainly because it is available on most
platforms. I have realised the majority of the enterprises prefer to
use browsers even for loca
Hi all,I am learning Quixote a few days ago,,,and i have no idea about
whether there is any Google Group talking about Quixote,so i post this
post to check that is Quixote been talking in this group before or can
i ask question about Quixote here!
--
http://mail.python.org/mailman/listinfo/python-
Baba wrote:
level: beginner
exercise: given that packs of McNuggets can only be bought in 6, 9 or
20 packs, write an exhaustive search to find the largest number of
McNuggets that cannot be bought in exact quantity.
exercise source:
http://ocw.mit.edu/courses/electrical-engineering-and-computer
Baba writes:
> exercise: given that packs of McNuggets can only be bought in 6, 9 or
> 20 packs, write an exhaustive search to find the largest number of
> McNuggets that cannot be bought in exact quantity.
Is that a homework problem? Hint: first convince yourself that a
largest number actually
ph4nut a écrit :
Hi all,I am learning Quixote a few days ago,,,and i have no idea about
whether there is any Google Group talking about Quixote,so i post this
post to check that is Quixote been talking in this group before or can
i ask question about Quixote here!
From the project's home page:
geremy condra a écrit :
(about eclipse+pydev)
Or you could use a text editor and a terminal and spare yourself the
agony of dealing with 600MB of Java of questionable quality ;).
+1 QOTW
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
On Wed, Aug 11, 2010 at 02:29:24PM -0700, tormod wrote:
> I've tried countless times to build & install cx_Oracle on Python
> 3.1.2, and failed every time, so I'd like to ask someone for help.
...
> I've opened the cx_Oracle.pyd with Dependency Walker (http://
> www.dependencywalker.com/) a
Hi Bhanu,
On Aug 12, 2010, at 4:15 AM, Bhanu Kumar wrote:
Hi All,
Is there any good free python IDE available in Ubuntu?
See a similar discussion at django-users mailing list:
http://groups.google.com/group/django-users/browse_thread/thread/562189578285211
Cheers, Roald
--
http://mail.python
On Aug 12, 2010, at 11:33 AM, Paul Rubin wrote:
Baba writes:
exercise: given that packs of McNuggets can only be bought in 6, 9 or
20 packs, write an exhaustive search to find the largest number of
McNuggets that cannot be bought in exact quantity.
Is that a homework problem? Hint: first con
Hey All!
Hope your thursday is treating you well. I'm looking for suggestions on
books of programming/engineering puzzles that range from beginners to
advanced and even expert level problems. I know they exist; we had them back
in college for practicing before the ACM programming competitions. Howe
A python script I use to backup files on a Windows 2003 server
occasionally fails to retrieve the size of a file with a question mark
in the name. The exception I get is "OSError #123 The filename,
directory name, or volume label syntax is incorrect". I realize that
technically a question mark in t
This is in response to one of the pyWiki pages:
PythonAsAFirstLanguage.
If there's a better place I could have posted this, please tell me
about it. I will be posting this elsewhere over the next few ideas,
because I feel it's my duty to spread this idea.
It's not grandiose, just Quixotic.
Someo
On 12/08/2010 12:49, drodrig wrote:
A python script I use to backup files on a Windows 2003 server
occasionally fails to retrieve the size of a file with a question mark
in the name. The exception I get is "OSError #123 The filename,
directory name, or volume label syntax is incorrect". I realize
On Aug 12, 1:22 am, Ben Finney wrote:
> Vito 'ZeD' De Tullio writes:
>
> > I know, maybe I'm just lazily speculating, but I'm curious about
> > what's next, in python, when GvR will stop the moratorium and will let
> > changes in the language.
>
> Subscribe to the ‘python-ideas’ forum for the lat
I want to create an LDAP database for my company with following
settings.
Only the ldap user belongs to my company can search and view ldap
entries
I want to protect ldap user belongs to my company
One ldap user can't search and view others details
Only allow ldap u
Hi all, I am creating a program that renames all files of the similar
file type. But i am stuck at this part. I tried running this code and
I got this error:new_name = os.rename(path, newpath)
WindowsError: [Error 183] Cannot create a file when that file already
exists. Hope you guys could help
On 12 авг, 18:49, drodrig wrote:
> A python script I use to backup files on a Windows 2003 server
> occasionally fails to retrieve the size of a file with a question mark
> in the name. The exception I get is "OSError #123 The filename,
> directory name, or volume label syntax is incorrect". I rea
Roald de Vries wrote:
On Aug
12, 2010, at 11:33 AM, Paul Rubin wrote:
Baba writes:
exercise: given that packs of McNuggets can only be bought in 6, 9 or
20 packs, write an exhaustive search to find the largest number of
McNuggets that cannot be bought in exact quantity.
Is that a homework
Matty Sarro wrote:
Hey All!
Hope your thursday is treating you well. I'm looking for suggestions on
books of programming/engineering puzzles that range from beginners to
advanced and even expert level problems. I know they exist; we had them back
in college for practicing before the ACM programmi
On Thu, 12 Aug 2010 05:05:55 -0700 (PDT)
เข้านอน wrote:
> have to teach them to enjoy programming, enjoy computers, and develop
> their minds in a way that doesn't involve becoming 'Imams' who are
> essentially the learned mafia bosses of terrorism.
This is the point that I stopped reading your "
Benjamin Kaplan writes:
> Sys.stdin and stdout are files, just like any other. There's nothing
> special about them at compile time. When the interpreter starts, it
> checks to see if they are ttys. If they are, then it tries to figure
> out the terminal's encoding based on the environment.
Just
Hello,
I have,
class C:
n=0
def __init__(s):
__class__.n+=1
I do
>>> C()
This is fine. But of what thing I am taking the __class__ of?
I can also do
@staticmethod
def p():
print(__class__.n)
>>> C.p()
1
Thanks,
Eric J.
--
On 2010-08-12, Dave Angel wrote:
> For puzzles:
>
> http://projecteuler.net
...if you like math problems.
> http://www.pythonchallenge.com
...if you like fooling around with PIL, graphics and bytes.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
I'm using elementtree to create a form.
I would like to set the "selected" attribute.
Setting using the usual
option.set( "selected" = "" )
gives me
Operations
how does one make
Operations
which is what I need.
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 12, 5:40 pm, Bruno Desthuilliers wrote:
> ph4nut a écrit :
>
> > Hi all,I am learning Quixote a few days ago,,,and i have no idea about
> > whether there is any Google Group talking about Quixote,so i post this
> > post to check that is Quixote been talking in this group before or can
> > i
On Aug 12, 5:40 pm, Bruno Desthuilliers wrote:
> ph4nut a écrit :
>
> > Hi all,I am learning Quixote a few days ago,,,and i have no idea about
> > whether there is any Google Group talking about Quixote,so i post this
> > post to check that is Quixote been talking in this group before or can
> > i
Eric J. Van der Velden wrote:
Hello,
I have,
class C:
n=0
def __init__(s):
__class__.n+=1
Should be
class C:
n = 0
def __init__(self):
self.__class__.n+=1
C.n+=1 # equivalent to this line (I prefer this one, more
readable, less refactor-
In article
<72151646-65cb-47bb-bd55-e7eb67577...@z10g2000yqb.googlegroups.com>,
"Eric J. Van der Velden" wrote:
> Hello,
>
> I have,
>
> class C:
> n=0
> def __init__(s):
> __class__.n+=1
>
>
> I do
> >>> C()
>
> This is fine.
No it's not, at least in Pytho
Eric J. Van der Velden wrote:
> I have,
>
> class C:
> n=0
> def __init__(s):
> __class__.n+=1
>
>
> I do
C()
>
> This is fine. But of what thing I am taking the __class__ of?
> I can also do
>
> @staticmethod
> def p():
> p
Doug wrote:
> I'm using elementtree to create a form.
>
> I would like to set the "selected" attribute.
>
> Setting using the usual
> option.set( "selected" = "" )
Maybe that should be option.set(selected="selected"). I think
and
are equivalent.
http://www.w3.org/TR/html4/intro/sgmltut.
On Aug 12, 10:47 am, Peter Otten <__pete...@web.de> wrote:
> Doug wrote:
> > I'm using elementtree to create a form.
>
> > I would like to set the "selected" attribute.
>
> > Setting using the usual
> > option.set( "selected" = "" )
>
> Maybe that should be option.set(selected="selected"). I think
Hello Jean-Michel,
On 2010-08-12 16:06, Jean-Michel Pichavant wrote:
> Eric J. Van der Velden wrote:
> Should be
>
> class C:
> n = 0
> def __init__(self):
>self.__class__.n+=1
>C.n+=1 # equivalent to this line (I prefer this one, more
> readable, less refactor-friendly)
Hi,
I am dealing with very large text files (a few million lines) and would like to
check and modify them according to a well defined format. The format
requires ONLY ONE NEWLINE (followed by some sort of text) on top of the file
and
NO NEWLINE in the very end. The input files can be very dive
Announcing:
python-ghostscript 0.3
A Python-Interface to the Ghostscript
C-API using ctypes
:Copyright: GNU Public License v3 (GPLv3)
:Author: Hartmut Goebel
:Homepage: http://bitbucket.org/htgoebel/python-ghostscript
:Download:
On Thu, Aug 12, 2010 at 5:41 AM, Matty Sarro wrote:
> Hey All!
> Hope your thursday is treating you well. I'm looking for suggestions on
> books of programming/engineering puzzles that range from beginners to
> advanced and even expert level problems. I know they exist; we had them back
> in colle
Hartmut Goebel schreef op de 12e dag van de oogstmaand van het jaar 2010:
> Here is an example for how to use the high-level interface of
> `python-ghostscript`. This implements a very basic ps2pdf-tool::
>
> import sys
> import ghostscript
>
> args = [
> "ps2pdf", # actual val
HELP!!!
I need help with a unicode issue that has me stumped. I must be doing
something wrong because I don't believe this condition would have slipped thru
testing.
Wherever the string u'\udbff\udc00' occurs u'\U0010fc00' or unichr(1113088) is
substituted and the file loses 1 character result
Hi,
When I define my own production rules for the grammar the code below
runs fine. Can anyone tell me how to use the built in grammars of nltk
(if there are any)?
>>> groucho_grammar = nltk.parse_cfg("""
... S -> NP VP
... PP -> P NP
... NP -> Det N | Det N PP | 'I'
... VP -> V NP | VP PP
... De
Is there a utility to extract the stacks from a running python program that
is hung?
Sounds like a long shot but if anyone knows it would be you guys.
--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer
Zindagi Games
--
http://mail.python.org/mailman/listinfo/python-list
blur959 wrote:
Hi all, I am creating a program that renames all files of the similar
file type. But i am stuck at this part. I tried running this code and
I got this error:new_name = os.rename(path, newpath)
WindowsError: [Error 183] Cannot create a file when that file already
exists. Hope yo
How do you use OptParse with constants?
Example:
usage = 'Usage: %prog [OPTIONS]'
parser = OptionParser(usage)
parser.add_option('-l','--level',
action='store_const',
default=LOG_INFO,
help='Set the log level to inject into
On 8/12/10 11:19 AM, J wrote:
How do you use OptParse with constants?
Example:
usage = 'Usage: %prog [OPTIONS]'
parser = OptionParser(usage)
parser.add_option('-l','--level',
action='store_const',
default=LOG_INFO,
he
"D'Arcy J.M. Cain" writes:
> On Thu, 12 Aug 2010 05:05:55 -0700 (PDT)
> เข้านอน wrote:
>> have to teach them to enjoy programming, enjoy computers, and develop
>> their minds in a way that doesn't involve becoming 'Imams' who are
>> essentially the learned mafia bosses of terrorism.
>
> This is
BAvant Garde wrote:
HELP!!!
I need help with a unicode issue that has me stumped. I must be doing
something wrong because I don't believe this condition would have
slipped thru testing.
Wherever the string u'\udbff\udc00' occurs u'\U0010fc00' or
unichr(1113088) is substituted and the file l
In article ,
"Martin v. Loewis" wrote:
> > So... why does having a non-ascii character in sys.ps1 make the prompt
> > vanish?
>
> I can't pinpoint it to a specific line of code. Most likely, it tries
> to encode the prompt as ASCII before writing it to stdout. That fails,
> and it silently ign
Hi!
I have on a few occasions now wanted to have inline-exception
handling, like the inline if/else operator.
For example,
The following might raise ZeroDivisionError:
f = n / d
So, I can look before I leap (which is okay):
f = float("nan") if d == 0 else n/d;
But, what I'd like to be able t
On Thu, Aug 12, 2010 at 12:41, Robert Kern wrote:
> On 8/12/10 11:19 AM, J wrote:
>>
>> How do you use OptParse with constants?
> http://docs.python.org/library/optparse#standard-option-actions
>
> 'store_const' means that the option is a flag without arguments and stores
> the value provided by
On Thursday 12 August 2010, it occurred to wheres pythonmonks to exclaim:
> try:
>f = n / d
> except:
>f = float("nan")
A catch-all except clause. Never a good idea. It's not as bad in this case, as
there is only one expression, but there are still a couple of other exceptions
that have
On Thu, Aug 12, 2010 at 2:08 PM, Thomas Jollans wrote:
> On Thursday 12 August 2010, it occurred to wheres pythonmonks to exclaim:
>> try:
>> f = n / d
>> except:
>> f = float("nan")
>
> A catch-all except clause. Never a good idea. It's not as bad in this case, as
> there is only one expres
On Thu, Aug 12, 2010 at 2:19 PM, wheres pythonmonks
wrote:
> On Thu, Aug 12, 2010 at 2:08 PM, Thomas Jollans wrote:
>> On Thursday 12 August 2010, it occurred to wheres pythonmonks to exclaim:
>>> try:
>>> f = n / d
>>> except:
>>> f = float("nan")
>>
>> A catch-all except clause. Never a g
Hi News123
Thank You for helping me out. Indeed i am not looking for the code but
rather for hints that direct my reasoning as well as hints as to how
to write basic programs like this.
You have broken down the approach into 2 parts. I have tried to solve
part 1 but i'm not quite there yet. Here'
wheres pythonmonks wrote:
Hi!
I have on a few occasions now wanted to have inline-exception
handling, like the inline if/else operator.
For example,
The following might raise ZeroDivisionError:
f = n / d
So, I can look before I leap (which is okay):
f = float("nan") if d == 0 else n/d;
But
On Thu, Aug 12, 2010 at 2:42 PM, MRAB wrote:
> wheres pythonmonks wrote:
>>
>> Hi!
>>
>> I have on a few occasions now wanted to have inline-exception
>> handling, like the inline if/else operator.
>>
>> For example,
>>
>> The following might raise ZeroDivisionError:
>>
>> f = n / d
>>
>> So, I ca
On Thursday 12 August 2010, it occurred to wheres pythonmonks to exclaim:
> [I just hate function call overhead for this.]
I think you've got your priorities wrong. If you want to avoid unnecessary
overhead, avoid exceptions more than functions.
--
http://mail.python.org/mailman/listinfo/python
Baba wrote:
> def can_buy(n_nuggets):
[snip]
> can_buy(55)
>
> as you can see i am trying to loop through all combinations of values
> bewtween 1 and n_nuggets and when the equation resolves it should
> return True, else it should return False.
>
> I was hoping that when i then call my function and
On Aug 12, 12:30 pm, Alexander Gattin wrote:
> Does Windows have anything like
> LD_LIBRARY_PATH/SHLIB_PATH?
No, isn't that only if I have an actual Oracle client installed (not
the instant client)?
But great tip, wasn't exactly the solution, but your question
triggered me to check the Windows e
Baba wrote:
> Thank You for helping me out. Indeed i am not looking for the code but
> rather for hints that direct my reasoning as well as hints as to how
> to write basic programs like this.
>
> You have broken down the approach into 2 parts. I have tried to solve
> part 1 but i'm not quite th
On 8/12/2010 1:34 AM, John Nagle wrote:
Somewhat to my surprise, in Python 2.6,
with urllib2.urlopen(url) as fh :
doesn't work. It fails with
"AttributeError: addinfourl instance has no attribute '__exit__'".
I thought that all the file-like objects supported "with" in 2.6.
No?
This seems
In article ,
Chris Hare wrote:
>
>And I see now what I did wrong - thanks for putting up with the questions.
Posting that information is useful for any other newbies who might be
following along
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
"...if I were
On Thursday 12 August 2010, it occurred to Dlanor Slegov to exclaim:
> Hi,
>
> I am dealing with very large text files (a few million lines) and would
> like to check and modify them according to a well defined format. The
> format requires ONLY ONE NEWLINE (followed by some sort of text) on top o
Baba wrote:
Hi News123
Thank You for helping me out. Indeed i am not looking for the code but
rather for hints that direct my reasoning as well as hints as to how
to write basic programs like this.
You have broken down the approach into 2 parts. I have tried to solve
part 1 but i'm not quite th
In article <2a47b306-45d1-474a-9f8e-5b71eba62...@p11g2000prf.googlegroups.com>,
CM wrote:
>
>Maybe it's not much of an issue, but I think it would be a shame if
>occasional hangs/crashes could be caused by these (rare?) database
>conflicts if there is a good approach for avoiding them. I guess I
On Wed, 11 Aug 2010 18:49:26 -0700, RG wrote:
> This doesn't explain why "cat | cat" when run interactively outputs
> line-by-line (which it does). STDIN to the first cat is a TTY, but the
> second one isn't.
GNU cat doesn't use stdio, it uses read() and write(), so there isn't any
buffering.
In article ,
Peter Kleiweg wrote:
>Hartmut Goebel schreef op de 12e dag van de oogstmaand van het jaar 2010:
>
>> Here is an example for how to use the high-level interface of
>> `python-ghostscript`. This implements a very basic ps2pdf-tool::
>>
>> import sys
>> import ghostscript
>>
>>
On Thursday 12 August 2010, it occurred to RG to exclaim:
> %%% /&%%%
>
> If this were a properly unicode-enabled newsreader you would see a
> yin-yang symbol in the middle of s2.
Are you sure about that? Now maybe the mailing list gateway is messing things
up, but I rather suspect your newsread
On Aug 12, 2010, at 9:02 PM, Peter Otten wrote:
Baba wrote:
Thank You for helping me out. Indeed i am not looking for the code
but
rather for hints that direct my reasoning as well as hints as to how
to write basic programs like this.
You have broken down the approach into 2 parts. I have
On 08/11/10 21:14, Baba wrote:
How about rephrasing that question in your mind first, i.e.:
For every number that is one higher then the previous one*:
If this number is dividable by:
6 or 9 or 20 or any combination of 6, 9, 20
than this number _can_ be bought in an exac
Aahz schreef op de 12e dag van de oogstmaand van het jaar 2010:
> In article ,
> Peter Kleiweg wrote:
> >Hartmut Goebel schreef op de 12e dag van de oogstmaand van het jaar 2010:
> >
> >> Here is an example for how to use the high-level interface of
> >> `python-ghostscript`. This implements a v
On Thu, Aug 12, 2010 at 2:57 PM, Thomas Jollans wrote:
> On Thursday 12 August 2010, it occurred to wheres pythonmonks to exclaim:
>> [I just hate function call overhead for this.]
>
> I think you've got your priorities wrong. If you want to avoid unnecessary
> overhead, avoid exceptions more than
I'm reading a URL which is a .gz file, and decompressing
it. This works, but it seems far too complex. Yet
none of the "wrapping" you might expect to work
actually does. You can't wrap a GzipFile around
an HTTP connection, because GzipFile, reasonably enough,
needs random access, and tries t
I find myself needing to calculate the difference between two Counters
or multisets or bags.
I want those items that are unique to each bag. I know how to
calculate it:
>>> b = Counter(a=1, b=2)
>>> c = Counter(a=3, b=1)
>>> diff = (b - c) + (c - b)
>>> (b - c)
Counter({'b': 1
Hi Baba,
The last tips should really help you getting started:
for testing your function you could do:
Below your uncorrected code and a test for it
def can_buy(n_nuggets):
for a in range (1,n_nuggets):
for b in range (1,n_nuggets):
for c in range (1,n_nuggets):
Peter Otten <__pete...@web.de> wrote:
>
> >>> 1 .conjugate()
>
This is a syntax I never noticed before. My built-in complier (eyes)
took one look and said: "that doesn't work." Has this always worked in
Python but I never noticed? I see other instance examples also work.
>>> '1' .zfill(2)
'01
On Tuesday 10 August 2010, it occurred to kj to exclaim:
> I'm looking for a module that implements "persistent lists": objects
> that behave like lists except that all their elements are stored
> on disk. IOW, the equivalent of "shelves", but for lists rather
> than a dictionaries.
>
> Does anyo
One more small tip to verify whether your code is working:
On 08/12/2010 10:28 PM, News123 wrote:
> Hi Baba,
Your code, but returning the result as suggested in my preious post:
> def can_buy(n_nuggets):
>for a in range (1,n_nuggets):
>for b in range (1,n_nuggets):
>for
[Oops, now complete...]
Peter Otten <__pete...@web.de> wrote:
>
> > >>> 1 .conjugate()
>
This is a syntax I never noticed before. My built-in complier (eyes)
took one look and said: "that doesn't work." Has this always worked in
Python but I never noticed? I see other instance examples also work.
Hi all.
Is there a way I can keep my floating point number as I typed it? For
example, I want 34.52 to be 34.52 and NOT 34.520002.
--
Bradley J. Hintze
Graduate Student
Duke University
School of Medicine
801-712-8799
--
http://mail.python.org/mailman/listinfo/python-list
(Repost with better indentation)
I'm reading a URL which is a .gz file, and decompressing
it. This works, but it seems far too complex. Yet
none of the "wrapping" you might expect to work
actually does. You can't wrap a GzipFile around
an HTTP connection, because GzipFile, reasonably enough,
On 08/12/2010 09:56 PM, Martin P. Hellwig wrote:
> On 08/11/10 21:14, Baba wrote:
>
>
> How about rephrasing that question in your mind first, i.e.:
>
> For every number that is one higher then the previous one*:
> If this number is dividable by:
> 6 or 9 or 20 or any combination of
On 8/12/2010 9:22 AM, Dave Angel wrote:
Now you have to find the largest number below 120, which you can
easily do with brute force
Dept of overkill, iterators/generators division ...
-John
#--
from itertools import imap, product, ifilter
from operator import mul
box_sizes =
David Niergarth wrote:
> [Oops, now complete...]
> Peter Otten <__pete...@web.de> wrote:
>>
>> > >>> 1 .conjugate()
>>
> This is a syntax I never noticed before. My built-in complier (eyes)
> took one look and said: "that doesn't work."
(1).conjugate may hurt a little less. Anyway, the space is
I have a function that I am attempting to call from another file. I am
attempting to replace a string using re.sub with another string. The
problem is that the second string is a variable. When I get the
output, it shows the variable name rather than the value. Is there any
way to pass a variable i
On 08/12/2010 01:43 PM, Bradley Hintze wrote:
Hi all.
Is there a way I can keep my floating point number as I typed it? For
example, I want 34.52 to be 34.52 and NOT 34.520002.
Is this a Python question?
The answer is both Yes and No. The binary floating point representation
of nu
On 2010-08-12, Bradley Hintze wrote:
> Is there a way I can keep my floating point number as I typed it?
No.
> For example, I want 34.52 to be 34.52 and NOT 34.520002.
You can't represent 34.52 using base-2 IEEE floating point (the HW
floating point format used by pretty much all modern co
On 2010-08-12, Grant Edwards wrote:
> On 2010-08-12, Bradley Hintze wrote:
>
>> Is there a way I can keep my floating point number as I typed it?
>
> No.
>
>> For example, I want 34.52 to be 34.52 and NOT 34.520002.
>
> You can't represent 34.52 using base-2 IEEE floating point (the HW
> floa
On Aug 12, 2010, at 4:43 PM, Bradley Hintze wrote:
Hi all.
Is there a way I can keep my floating point number as I typed it? For
example, I want 34.52 to be 34.52 and NOT 34.520002.
Hi Bradley,
Use the Decimal type instead. It's not as convenient as float, but it
will give you a consis
On Thursday 12 August 2010, it occurred to Bradley Hintze to exclaim:
> Hi all.
>
> Is there a way I can keep my floating point number as I typed it? For
> example, I want 34.52 to be 34.52 and NOT 34.520002.
The conversion from decimal to binary and vice versa is inexact -- but they're
the
On Thu, Aug 12, 2010 at 1:43 PM, Bradley Hintze
wrote:
> Hi all.
>
> Is there a way I can keep my floating point number as I typed it? For
> example, I want 34.52 to be 34.52 and NOT 34.520002.
See also:
http://en.wikipedia.org/wiki/Floating_point#Representable_numbers.2C_conversion_and_ro
On 2010-08-12, Grant Edwards wrote:
>> Here are the nitty-gritty details:
>>
>> http://docs.sun.com/source/806-3568/ncg_goldberg.html
>
> Here is a gentler intro:
>
> http://pyfaq.infogami.com/why-are-floating-point-calculations-so-inaccurate
And another good page:
http://docs.python.org/t
1 - 100 of 135 matches
Mail list logo