On Mar 8, 6:32 pm, Muddy Coder cosmo_gene...@yahoo.com wrote:
Hi Folks,
I just downloaded and installed pysqlite, and I can import sqlite3
smoothly. Then, I need to connect sqlite by syntax:
conn = sqlite3.connect('adirectory/db')
I wish the data will be stored into directory ---
Grant Edwards gra...isi.com wrote:
There you go: a 30-second psychological diagnosis by an
electrical engineer based entirely on Usenet postings. It
doesn't get much more worthless than that...
Oh it is not entirely worthless - as a working hypothesis,
it seems to cover and explain the
Regarding minidom, you might be happier with the xml.etree package that
comes with Python2.5 and later (it's also avalable for older versions).
It's a lot easier to use, more memory friendly and also much faster.
OTOH, choice of XML library is completely irrelevant for the issue at
hand. If
On Mar 6, 6:52 pm, Mike Driscoll kyoso...@gmail.com wrote:
...
Can you post a sample application so we can try to figure out what's
wrong? You might also cross-post this to thewxPythonmailing list.
They might know.
Mike- Hide quoted text -
- Show quoted text -
Hi, thanks for your reply
per wrote:
i have a program that essentially loops through a textfile file thats
about 800 MB in size containing tab separated data... my program
parses this file and stores its fields in a dictionary of lists.
for line in file:
split_values = line.strip().split('\t')
# do stuff with
On Mar 7, 9:56 pm, bruce bedoug...@earthlink.net wrote:
and this solution will somehow allow a user to create a web parsing/scraping
app for parising links, and javascript from a web page?
not just parsing the links and the static javascript, but:
* actually executing the javascript,
Martin v. Löwis wrote:
Regarding minidom, you might be happier with the xml.etree package that
comes with Python2.5 and later (it's also avalable for older versions).
It's a lot easier to use, more memory friendly and also much faster.
OTOH, choice of XML library is completely irrelevant for
Xah Lee xah...@gmail.com writes:
Of interest:
• Why Can't You Be Normal?
http://xahlee.org/Netiquette_dir/why_cant_you_be_normal.html
• Ban Xah Lee
http://xahlee.org/Netiquette_dir/ban_Xah_Lee.html
I consider this post relevant because i've been perennially gossiped
about in
Hi,
I've got a program here that prints out a percentage of it's
completion. Currently with my implimentation it prints like this:
0%
1%
2%
3%
4%
etc taking up lots and lots of lines of output... So, how can I make it
write the percentage on the same line eg.
while working:
print percent
For the described problem, maybe. But certainly not for the application.
The background was parsing the XML dump of an entire web site, which I
would expect to be larger than what minidom is designed to handle
gracefully. Switching to cElementTree before major code gets written is
almost
On Sun, Mar 8, 2009 at 1:37 AM, Daniel Dalton d.dal...@iinet.net.au wrote:
Hi,
I've got a program here that prints out a percentage of it's
completion. Currently with my implimentation it prints like this:
0%
1%
2%
3%
4%
etc taking up lots and lots of lines of output... So, how can I
Martin v. Löwis wrote:
The background was parsing the XML dump of an entire web site, which I
would expect to be larger than what minidom is designed to handle
gracefully. Switching to cElementTree before major code gets written is
almost certainly a good idea here.
I think minidom is
On Mar 7, 3:06 pm, per perfr...@gmail.com wrote:
hi all,
i have a program that essentially loops through a textfile file thats
about 800 MB in size containing tab separated data... my program
parses this file and stores its fields in a dictionary of lists.
When building a very large
On Mar 8, 1:52 am, iu2 isra...@elbit.co.il wrote:
On Mar 6, 6:52 pm, Mike Driscoll kyoso...@gmail.com wrote:
...
Can you post a sample application so we can try to figure out what's
wrong? You might also cross-post this to thewxPythonmailing list.
They might know.
Mike- Hide quoted
odeits wrote:
On Mar 7, 1:07 pm, Scott David Daniels scott.dani...@acm.org wrote:
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries. the query returns up
andrew cooke wrote:
odeits wrote:
On Mar 7, 1:07 pm, Scott David Daniels scott.dani...@acm.org wrote:
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
The result is a stack of dictionaries.
If that's the problem, the solution is: get more memory.
Or maybe think about algorithm, which needs less memory... My
experience tells me, that each time when you want to store a lot of
data into dict (or other structure) to analyze it then, you can find a
way not to store so much amount of
Mel wrote:
wrote:
Steven D'Aprano st...@pearwood.info writes:
It is never
correct to avoid using is when you need to compare for identity.
When is it ever necessary to compare for identity?
Ho-hum. MUDD game.
def broadcast (sender, message):
for p in all_players:
if p is not
Robert Kern wrote:
On 2009-03-07 08:14, Christian Heimes wrote:
Steven D'Aprano wrote:
Yes. Floating point NANs are required to compare unequal to all floats,
including themselves. It's part of the IEEE standard.
As far as I remember that's not correct. It's just the way C has
interpreted
On Sun, 8 Mar 2009 01:59:03 -0800
Chris Rebert c...@rebertia.com wrote:
etc taking up lots and lots of lines of output... So, how can I make it
write the percentage on the same line eg.
Use the carriage return character to overwrite the line (you'll need
to forego `print`):
Why do you say
Daniel Dalton d.dal...@iinet.net.au wrote:
I've got a program here that prints out a percentage of it's
completion. Currently with my implimentation it prints like this:
0%
1%
2%
3%
4%
etc taking up lots and lots of lines of output... So, how can I make it
write the percentage on the
Chris Rebert wrote:
On Sun, Mar 8, 2009 at 1:37 AM, Daniel Dalton d.dal...@iinet.net.au wrote:
Hi,
I've got a program here that prints out a percentage of it's
completion. Currently with my implimentation it prints like this:
0%
1%
2%
3%
4%
etc taking up lots and lots of lines of output...
On Sun, 08 Mar 2009 18:38:24 +0900
Byung-Hee HWANG b...@izb.knu.ac.kr wrote:
Xah Lee xah...@gmail.com writes:
[snip]
Don't worry, Xah. At least, my minds is running on your rails. Please do
not stop. BTW, what do you think about using Gnus instead of G2/1.0?
So you are going to repeat his
Steven D'Aprano wrote:
per wrote:
currently, this is very slow in python, even if all i do is break up
each line using split()
**
and store its values in a dictionary,
**
indexing by one of the tab separated values in the file.
If that's the problem, the
def move_panel(self, evt):
def gen():
for x in range(200):
yield x
for x in range(200, 0, -1):
yield x
for x in gen():
self.square.SetPosition((x, 30))
time.sleep(0.005)
I can't help
On Mar 8, 3:52 am, iu2 isra...@elbit.co.il wrote:
On Mar 6, 6:52 pm, Mike Driscoll kyoso...@gmail.com wrote:
...
Can you post a sample application so we can try to figure out what's
wrong? You might also cross-post this to thewxPythonmailing list.
They might know.
Mike- Hide quoted
Hi,
I am going to develop a c library binding with ctypes. That c library
will call callback from worker threads it created. Here comes the
problem : Will the GIL be acquired before it goes into Python
function?
I got a little try..
DSPPROC = WINFUNCTYPE(None, DWORD, DWORD, c_void_p, DWORD,
En Sat, 07 Mar 2009 21:18:22 -0200, BigHand hewei...@gmail.com escribió:
On 3月7日, 下午11时21分, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
En Sat, 07 Mar 2009 11:46:08 -0200, BigHand hewei...@gmail.com
escribió:
I want the exception printted like this:
File pyshell#14, line 2, in
Victor Lin schrieb:
Hi,
I am going to develop a c library binding with ctypes. That c library
will call callback from worker threads it created. Here comes the
problem : Will the GIL be acquired before it goes into Python
function?
I got a little try..
DSPPROC = WINFUNCTYPE(None, DWORD,
Benjamin Peterson wrote:
On behalf of the Python development team and the Python community, I'm
happy to announce the first alpha release of Python 3.1.
Python 3.1 focuses on the stabilization and optimization of features and changes
Python 3.0 introduced. The new I/O system has been rewritten
Victor Lin wrote:
Hi,
I am going to develop a c library binding with ctypes. That c library
will call callback from worker threads it created. Here comes the
problem : Will the GIL be acquired before it goes into Python
function?
I got a little try..
DSPPROC = WINFUNCTYPE(None, DWORD,
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
4 / 5.0
0.84 0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
Pure curiosity prompted me to try the following:
40 / 5.0
8.0
Strange...
--
http://mail.python.org/mailman/listinfo/python-list
On 3月8日, 下午9時56分, Diez B. Roggisch de...@nospam.web.de wrote:
Victor Lin schrieb:
Hi,
I am going to develop a c library binding with ctypes. That c library
will call callback from worker threads it created. Here comes the
problem : Will the GIL be acquired before it goes into Python
On 3月8日, 下午10時20分, Christian Heimes li...@cheimes.de wrote:
Victor Lin wrote:
Hi,
I am going to develop a c library binding with ctypes. That c library
will call callback from worker threads it created. Here comes the
problem : Will the GIL be acquired before it goes into Python
En Sun, 08 Mar 2009 12:22:50 -0200, farsi...@gmail.com escribió:
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
4 / 5.0
0.84
0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
Pure curiosity prompted me to try the following:
40 / 5.0
8.0
Strange...
See
Victor Lin wrote
I know I have to call PyEval_InitThreads if my module create threads
that will contact python stuff, for example, call a python callback
function from threads. But however, it is ctypes. I have no idea
should I do that for the imported dll? If it is, how?
You have to
farsi...@gmail.com wrote:
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
4 / 5.0
0.84
This one is a common FAQ. Basically floating point is never to be
trusted. This issue is quite language agnostic, however some language
decided to hide the issue, python does not. For more
Victor Lin wrote:
On 3月8日, 下午9時56分, Diez B. Roggisch de...@nospam.web.de wrote:
Victor Lin schrieb:
Hi,
I am going to develop a c library binding with ctypes. That c library
will call callback from worker threads it created. Here comes the
problem : Will the GIL be acquired before it goes
On Mar 8, 7:22 pm, farsi...@gmail.com wrote:
On Mar 8, 2:16 pm, farsi...@gmail.com wrote:
4 / 5.0
0.84 0.8 * 5
4.0
python 2.6.1 on mac. What the hell is going on here?
Pure curiosity prompted me to try the following: 40 / 5.0
8.0
Strange...
Please see
Scott David Daniels wrote:
Lie Ryan wrote:
Fencer wrote:
The literal translation of that would be:
if n is not None and n != []:
b = True
else:
b = False
it is a bit verbose, so one might want to find something shorter
b = True if n is not None and n != [] else False
I always feel if
Thanks all, that's very helpful, sorry to waste your time with a
common question. I have tried the decimal module and will definitely
keep using it if I need to do this kind of calculation again.
I have 1 more question that the floating point article that was linked
didn't really answer:
x =
RT wrote:
cut
Can you recommend any books or articles that you have found offer
useful advice on program structure, design and use of classes or any
other features or best practices that you feel are important for
professional Python development.
cut
In my opinion, 'professional development'
farsi...@gmail.com wrote:
Thanks all, that's very helpful, sorry to waste your time with a
common question. I have tried the decimal module and will definitely
keep using it if I need to do this kind of calculation again.
Try to remember though that the decimal module simply replaces one
Thanks duncan, thats very helpful. I'll be more careful with floating
point numbers in future.
--
http://mail.python.org/mailman/listinfo/python-list
Xah Lee wrote:
For those of you imperative programers who kept on hearing about lisp
and is tempted to learn, then, ...
You:
* consider yourself unfairly treated by various communities
* post a long drivel about various Lisp flavors to newsgroups
that are not in any way Lisp related
?
There
Colin J. Williams cjw at ncf.ca writes:
Do you have any schedule for a Windows
binary release?
They should materialize on Monday.
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 8, 7:50 am, D'Arcy J.M. Cain da...@druid.net wrote:
So you are going to repeat his postings in their entirety so that those
that block him will see them anyway, right? Wrong. We'll just block
your posts too.
*plonk*
This is to all usenet readers who think they own c.l.py!
On Mar 7, 5:52 pm, Xah Lee xah...@gmail.com wrote:
HARASSMENT BY JOHN BOKMA
I was harassed by a newsgroup poster John Bokma (a regular of
comp.lang.perl.misc) to have my web hosting service provider kick me
off. This happened in 2006.
I know the feeling. I have this super geek with nothing
On Mar 7, 2:14 pm, Christian Heimes li...@cheimes.de wrote:
Steven D'Aprano wrote:
Yes. Floating point NANs are required to compare unequal to all floats,
including themselves. It's part of the IEEE standard.
As far as I remember that's not correct. It's just the way C has
interpreted the
Gabriel Genellina wrote:
En Fri, 06 Mar 2009 06:52:00 -0200, dan.erik.peter...@gmail.com escribió:
I have succeeded in building Python 2.6.1 from source under Windows XP
by running Visual C++ 2008 Express on the PCbuild/pcbuild.sln file
both from the Visual C++ application as well as from the
Could you help me ?
How could I take an elemment from a set or a frozenset .-) ?
From a string (unicode? Python3), or from a tuple,or
from a list: Element by index or slice.
From a dict: by key.
But what concerning a set or
On Mar 7, 6:59 pm, Carl Banks pavlovevide...@gmail.com wrote:
I see that Brett Canon's importlib has finally made it into Python
standard library. Congrats there (if you still read this list), I am
struggling with Python's arcane import semantics (for something
ridiculously silly) now and I
On Mar 8, 4:48 am, andrew cooke and...@acooke.org wrote:
odeits wrote:
On Mar 7, 1:07 pm, Scott David Daniels scott.dani...@acm.org wrote:
odeits wrote:
I am looking to clean up this code... any help is much appreciated.
Note: It works just fine, I just think it could be done cleaner.
Hans Larsen schrieb:
Could you help me ?
How could I take an elemment from a set or a frozenset .-) ?
From a string (unicode? Python3), or from a tuple,or
from a list: Element by index or slice.
From a dict: by key.
But
BigHand wrote:
I know that there is no PyString_AsString in Python3.0,
could you guys give me instruction about how can I do with the
following ?
PyObject *exc_type = NULL, *exc_value = NULL, *exc_tb = NULL;
PyErr_Fetch(exc_type, exc_value, exc_tb);
how do I transfer the exc_type in a
BigHand wrote:
Finally I got the results now. This did take me 10 hours to solve
this. the docs of 3.0..
You will have to get used to Unicode. The code you used against the C-API
mimics almost exactly the steps you'd use at the Python level.
Stefan
--
r wrote:
This is to all usenet readers who think they own c.l.py!
[snip abusive, anti-social rant]
Well, after kill-filing this kiddie for a few months, I thought I'd give him
a chance. By pure luck I chose this post to read.
Good news r, you've earned yourself a permanent kill-filing. I'll be
Diez B. Roggisch wrote:
Hans Larsen schrieb:
Could you help me ?
How could I take an elemment from a set or a frozenset
.-) ?
From a string (unicode? Python3), or from a
tuple,or from a list: Element by index or slice.
From a dict: by
Tim Golden wrote:
Diez B. Roggisch wrote:
Hans Larsen schrieb:
Could you help me ?
How could I take an elemment from a set or a frozenset
.-) ?
From a string (unicode? Python3), or from a
tuple,or from a list: Element by index or slice.
I have been using the 'threading' library and decided to try swapping it
out for 'processing'... while it's awesome that processing so closely
mirrors the threading interface, I've been having trouble getting my
processes to share an object in a similar way.
Using the 'with' keyword didn't work,
ET wrote:
Using the 'with' keyword didn't work...
Just an aside here for any multiprocessing maintainers
watching ;) . I expect that the didn't work here
refers to this bug:
http://bugs.python.org/issue5261
Altho' if the OP cares to clarify, it might be something
else.
TJG
--
On Mar 8, 1:36 pm, ET p...@2drpg.org wrote:
I have been using the 'threading' library and decided to try swapping it
out for 'processing'... while it's awesome that processing so closely
mirrors the threading interface, I've been having trouble getting my
processes to share an object in a
On Sat, 2009-03-07 at 22:05 +, Ville M. Vainio wrote:
Alan G Isaac wrote:
3. Chandler is not really an email client. So specifically,
which of its functionalities is it slow, and what evidence
if any is there that Python is causing this?
I remember reading somewhere that the cause
On Mar 8, 1:42 pm, Carl Banks pavlovevide...@gmail.com wrote:
On Mar 8, 1:52 am, iu2 isra...@elbit.co.il wrote:
On Mar 6, 6:52 pm, Mike Driscoll kyoso...@gmail.com wrote:
...
Can you post a sample application so we can try to figure out what's
wrong? You might also cross-post this
Ville M. Vainio wrote:
Alan G Isaac wrote:
3. Chandler is not really an email client. So specifically,
which of its functionalities is it slow, and what evidence
if any is there that Python is causing this?
I remember reading somewhere that the cause of slowness is/was
architectural -
Tim Golden wrote:
... Anyhow, at the end I have a working Python 2.7a0 running
under Windows.
Do you mean 3.1a0? As far as I know, 2.7a0 requires the use
of the time machine, as it is expected to be 3 months out.
If you do get an installer built, even having a semi-official copy
around for
In addition, the CVS version of pywin32 which I built in
order to run the msi.py script has a small bug in genpy
which prevents it from generating COM support in the way
in which msi.py does it.
I'm using Python 2.4 to run msi.py; that has always worked
fine for me.
Regards,
Martin
P.S.
Do you mean 3.1a0? As far as I know, 2.7a0 requires the use
of the time machine, as it is expected to be 3 months out.
The current trunk calls itself 2.7a0. I think you might be referring
to 3.0a1.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
Martin v. Löwis wrote:
In addition, the CVS version of pywin32 which I built in
order to run the msi.py script has a small bug in genpy
which prevents it from generating COM support in the way
in which msi.py does it.
I'm using Python 2.4 to run msi.py; that has always worked
fine for me.
Scott David Daniels wrote:
Tim Golden wrote:
... Anyhow, at the end I have a working Python 2.7a0 running
under Windows.
Do you mean 3.1a0? As far as I know, 2.7a0 requires the use
of the time machine, as it is expected to be 3 months out.
No; 2.7a0 is the version number of the svn HEAD.
Thanks. I noticed that when I was on my windows box at work and I
would check it and click apply then ok and when I go back to those
prefs and it isn't checked. I did that a few times. I will try it on
my Linux box tomorrow at home and see if I have the same results.
If it doesn't work for
What does the merge do? I can't find mention of it
in the docs.
It merges the msvcrt merge module into the installer (and then
monkey patches it, to revert the msm decision of setting
ALLUSERS). I tried to integrate it originally as a step
after creating the msi. Unfortunately, the merge object
On Mar 8, 1:24 pm, Steven D'Aprano st...@pearwood.info wrote:
r wrote:
This is to all usenet readers who think they own c.l.py!
[snip abusive, anti-social rant]
Well, after kill-filing this kiddie for a few months, I thought I'd give him
a chance. By pure luck I chose this post to read.
Martin v. Löwis wrote:
What does the merge do? I can't find mention of it
in the docs.
It merges the msvcrt merge module into the installer (and then
monkey patches it, to revert the msm decision of setting
ALLUSERS). I tried to integrate it originally as a step
after creating the msi.
En Sun, 08 Mar 2009 18:08:50 -0200, Martin v. Löwis mar...@v.loewis.de
escribió:
What does the merge do? I can't find mention of it
in the docs.
It merges the msvcrt merge module into the installer (and then
monkey patches it, to revert the msm decision of setting
ALLUSERS). I tried to
Python Nutter wrote:
Looks like we finally get tkinter GUI based programs according to
Issue# 2983 in Python 3.1a so our programs don't look like something
out of early 1980's
Please don't confuse History gratuitously. Make that mid 90's.
Cheers, BB
--
hello all, Sorry for the frustrated mail.
This is my last attempt to search for a nice python library for creating
open document spreadsheet.
I tryed python-ooolib but did not find a few features like merging cells
(may be I am missing out some thing stupid ).
I have asked for some help before
seconded.
--
http://mail.python.org/mailman/listinfo/python-list
merge.py attempts to import config.py but I can't find it...
Just create an empty one.
Martin
--
http://mail.python.org/mailman/listinfo/python-list
First, it relies on config.py whose existence msi.py
optionally ignores.
Feel free to create a patch for that.
File COMObject Msm.Merge2.1, line 2, in OpenDatabase
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None,
None, None, 0, -2147024786), None)
This is 0x8007006e;
On Mar 8, 12:42 am, Stefan Behnel stefan...@behnel.de wrote:
rpar...@gmail.com wrote:
I am trying to process an xml file that contains unicode characters
(seehttp://vyakarnam.wordpress.com/). Wordpress allows exporting the
entire content of the website into an xml file. Using
Krishnakant wrote:
This is my last attempt to search for a nice python library for creating
open document spreadsheet.
I tryed python-ooolib but did not find a few features like merging cells
(may be I am missing out some thing stupid ).
You could add that feature to python-ooolib.
I have
Hello,
I am creating a container. I have some types which are built to be
members of the container. The members need to know which container
they are in, as they call methods on it, such as finding other
members. I want help with the syntax to create the members.
Currently, the container has
Martin v. Löwis wrote:
merge.py attempts to import config.py but I can't find it...
Just create an empty one.
Won't quite work: merge tries to find full_current_version
which is determined (if None) in msi.py from the rather
involved current version stuff.
I'm going to give up on this for
I'm at a loss to figure out how to extract some text from a string.
Here is a string:
setTimeout(location.href='http://youtube.example.com/login.aspx',
5000);
and I want to only retrieve the URL from above i.e I only want this
http://youtube.example.com/login.aspx from the above string. Any
On Sun, Mar 8, 2009 at 2:18 PM, Oltmans rolf.oltm...@gmail.com wrote:
I'm at a loss to figure out how to extract some text from a string.
Here is a string:
setTimeout(location.href='http://youtube.example.com/login.aspx',
5000);
and I want to only retrieve the URL from above i.e I only want
Just create an empty one.
Won't quite work: merge tries to find full_current_version
which is determined (if None) in msi.py from the rather
involved current version stuff.
Only if you don't pass an msi file on the command line. So
I recommend that you do that.
I'm going to give up on
On Sun, Mar 8, 2009 at 5:18 PM, Oltmans rolf.oltm...@gmail.com wrote:
I'm at a loss to figure out how to extract some text from a string.
Here is a string:
setTimeout(location.href='http://youtube.example.com/login.aspx',
5000);
and I want to only retrieve the URL from above i.e I only want
iu2 wrote:
Here is the timer version. It works even more slowly, even with
PyScripter active: ...
I actually tried this one first. Due to the slow speed I changed to
looping inside the event.
I don't understand why it takes so long to move that square with
wx.Timer set to 1 ms interval. Perhaps
Aaron Brady wrote:
Hello,
I am creating a container. I have some types which are built to be
members of the container. The members need to know which container
they are in, as they call methods on it, such as finding other
members. I want help with the syntax to create the members.
andrew cooke wrote:
above is with 3.0. for some odd reason i thing the order of teh args to
MethodType may have changed recently, so be careful.
sorry, no, had 2.6 running there... andrew
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 9, 3:37 am, Chris Rebert c...@rebertia.com wrote:
Learn about the methods of the string class
(str):http://docs.python.org/library/stdtypes.html#id4
You'll probably be most interested in .split()
OK, thanks I got it. I was trying to use Regex but .split() just
worked like a charm.
I just tried python first time.
2/3
the result is zero
I want the result to be .333...
How do I get this?
Thanks a lot
L
--
http://mail.python.org/mailman/listinfo/python-list
Lo schrieb:
I just tried python first time.
2/3
the result is zero
I want the result to be .333...
Well, that's not going to happen - 2/3 is .666 if not done with integers...
How do I get this?
Use floating points.
2.0 / 3.0
0.3
Diez
--
On 2009-03-08, Lo gr...@congstar.de wrote:
I just tried python first time.
2/3
the result is zero
I want the result to be .333...
How odd.
How do I get this?
1./3
--
Grant
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Mar 8, 2009 at 3:08 PM, Lo gr...@congstar.de wrote:
I just tried python first time.
2/3
the result is zero
I want the result to be .333...
How do I get this?
Add the following to the top of your program:
from __future__ import division
That tells Python to use the proper kind
Lo pisze:
I just tried python first time.
2/3
the result is zero
Float type must be specified explicitly:
2/3.0 or 2.0/3
In Python 3.x operators behave differently and '2/3' would give float
number as a result.
I want the result to be .333...
Than try: 1/3.0 because 2/3.0 will never
Lo wrote:
I just tried python first time.
2/3
the result is zero
I want the result to be .333...
How do I get this?
That's integer division (integer divided by integer is integer).
If you want the result to be floating point then make one of them
floating point:
2.0 / 3
or do this
RT wrote:
I have been doing Python development at work for several years. I
started with the official documentation and tutorial, by
necessity, the examples tend to be rather simple and none of them
really explain the process of developing complete, industrial
strength Python applications.
On Sat, 07 Mar 2009 05:03:08 -, Grant Edwards gra...@visi.com wrote:
On 2009-03-07, Rhodri James rho...@wildebst.demon.co.uk wrote:
On Fri, 06 Mar 2009 15:34:08 -, Grant Edwards inva...@invalid
wrote:
On 2009-03-06, Fencer no.s...@plz.ok wrote:
Hi, I need a boolean b to be true
1 - 100 of 187 matches
Mail list logo