473,804 Members | 3,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

futue feature division not found (embedded)

I've got a program with Python 2.3 embedded. When I try to run a script
containing "from __future__ import division", I get an exception:

File "main2.py", line 3
from __future__ import divison
SyntaxError: future feature divison is not defined

Anyone know how to fix that? BTW, when I run the program with
CO_FUTURE_DIVIS ION set in PyCompilerFlags , division works the new way, as it
should.
Jul 18 '05 #1
5 2260
On Sat, 27 Nov 2004 22:51:24 GMT, "Jive" <so*****@micros oft.com> wrote:
I've got a program with Python 2.3 embedded. When I try to run a script
containing "from __future__ import division", I get an exception:

File "main2.py", line 3
from __future__ import divison
SyntaxError: future feature divison is not defined ^^ s/divison/division/ ;-)
Anyone know how to fix that? BTW, when I run the program with
CO_FUTURE_DIVI SION set in PyCompilerFlags , division works the new way, as it ^^^should.

HTH. On to the next bug ;-)

Regards,
Bengt Richter
Jul 18 '05 #2

"Bengt Richter" <bo**@oz.net> wrote in message > HTH. On to the next bug ;-)

The proper expression is, "On to the *last* bug." :-)

I worked around it. I'm building an argv by hand and using Py_main. That's
probably a better way to crank it up anyhow.

Jive
Jul 18 '05 #3
Oh I see now. I misspelled. But I think it failed when I spelled it right
too. Either that or I misspelled it every time I tried it. Oh well. Since
there are no programs written for my application yet, I've decided just to
make future division the default. Sorry for the bother.

J.
Jul 18 '05 #4

"Bengt Richter" <bo**@oz.net> wrote in message
news:41******** *********@news. oz.net...
On Sat, 27 Nov 2004 22:51:24 GMT, "Jive" <so*****@micros oft.com> wrote:
I've got a program with Python 2.3 embedded. When I try to run a script
containing "from __future__ import division", I get an exception:

File "main2.py", line 3
from __future__ import divison
SyntaxError: future feature divison is not defined ^^ s/divison/division/ ;-)

Anyone know how to fix that? BTW, when I run the program with
CO_FUTURE_DIVI SION set in PyCompilerFlags , division works the new way, as

it ^^^
should.

HTH. On to the next bug ;-)


What's HTH?

It does fail though. Here's the message when I type it right:

File "main2.py", line 3, in ?
from __future__ import division
ImportError: No module named __future__

I didn't misspell __future__ did I?
Jul 18 '05 #5
Jive wrote:
"Bengt Richter" <bo**@oz.net> wrote in message
HTH. On to the next bug ;-)


What's HTH?


http://www.google.ca/search?q=acronym+hth

-Peter
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
1733
by: Stephan Diehl | last post by:
I was playing around with defining new types and have seen the following behaviour: Python 2.3.1 ============ >>> class Int(int):pass .... >>> a = Int(7) >>> b = Int(8)
17
3169
by: Chris Travers | last post by:
Hi all; I just made an interesting discovery. Not sure if it is a good thing or not, and using it certainly breakes first normal form.... Not even sure if it really works. However, as I am able to CRASH the backend, there is a bug here somewhere... test=# select version(); version
5
977
by: silentlights | last post by:
Hi, Is there a possibiliy to improve division or Modulo operations in the following, tmp1 = 123; tmp2 = 123; frame = ((char)((tmp1/100)+48)); // Division tmp1 = (tmp2 % 100); // Mod frame = ((char)((tmp1/10)+48)); tmp1 = (tmp2 % 10);
40
2523
by: fordge | last post by:
we usually use <<n as a cheaper option to multiplication when its factor of 2^n right, even for non 2^n say ix24 ==> ix(16+8) ==> (i<<4)+(i<<3) similarly divison 2^n is >>n
8
2528
by: nineteen | last post by:
for example: 16/5: 3 -------- 5)16 15 -------- 1 the user input the dividend and divisor,the program should display the upright formula like the example. and , the program must use recursive arithmetic.
17
2435
by: seb.haase | last post by:
Hi, Is it true that that "Python 3000" is dead ? Honestly I think that e.g. changing 5/2 to be 2.5 (instead of 2) would just break to much code :-( On the otherhand I'm using Python as "Matlab replacement" and would generally like 5/2 ==2.5 So, I was contemplating to default all my modules/scripts to start with "from __future__ import division" but if it is never coming (in this decade, that is) then it would be a
94
11527
by: krypto.wizard | last post by:
Last month I appeared for an interview with EA sports and they asked me this question. How would you divide a number by 7 without using division operator ? I did by doing a subtraction and keeping a counter that kept a tab on how many times I subtracted. Later, the EA sport guy told me that of course there are can be better technique by using bit operator.
1
3723
by: youjay | last post by:
I've been out of perl for a while, so I am starting from scratch. I have a small applet which scans a set of directories, getting information from some files in each one, and displaying selected data. The script works good, but I need to set in some tabbing on the terminal, and that is where the problem comes in. as soon as I attempt a division, the applet blows up, and it is not a divide by 0 error. I have tested the particular line of...
4
2152
by: oldnewbie | last post by:
EXAMPLE Please load a movie (with the buttons) to see the iframe's content... Given the above example, where I used an iframe (within it's own division...) over an embedded Flash movie, how can I restrict the iframe from moving out of the position where it's seems to be within the Flash movie on IE, when the user resizes the browser window's width to less than the Flash movie's width? I've managed to get it working fine on FF & Safari...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10578
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9152
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.