473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Ctypes example won't work :(

2
Hi

I currently use python 2.7 and i have a snippet of code that comes out different in two interpreters.
Edit: Would help to post my code ^^
Expand|Select|Wrap|Line Numbers
  1. from ctypes import *
  2. msvcrt = cdll.msvcrt
  3. message_string = "hello world!\n"
  4.  
  5. msvcrt.printf("Testing ctypes printf: {0}".format(message_string))
  6. print ("Python Idle: {0}".format(message_string))              
  7.  


First one is python idle. Win7

>>>
Python Idle: hello world!

>>>

As we can see it completely skips the line with the ctype command.

Now the second interpreter is eclipse. And while using the exact same code I get this:

Python Idle: hello world!

Testing ctypes printf: hello world!


If we compare this to the code it writes the python idle line before it write ctype. But in the code ctype is written before the print command.

This make my head want to explode. I know some python but I really can't wrap my head around this. Please help out, virtual cookies in return! ^^ -o
Feb 7 '12 #1
1 2117
warnet
1
I came across the same problem when using python ver3.2. Then I thought maybe there's something wrong with the python version for it works well with ver2.5. You may try.
Jul 5 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Oliver Spiesshofer | last post by:
Hi, I have a script that calls an fopen() on an external URL. I can run the script from the server as an url fine. When however the script should be run from crontab, it does not work. I get ...
5
by: Catherine | last post by:
I am having a problem viewing asp pages on iis version 5.1 xp pro. HTML pages are viewable on http://localhost but .asp pages are not. I have created a test program called timetest.asp with the...
19
by: Allen Thompson | last post by:
sorry for the simple question, haven't done this in a while. when I use the following script it keeps displaying the value of "x" like a string. for example, if I type the number 7 in the prompt,...
0
by: Sebastian Sosna | last post by:
Hi there! iam trying a code snippet from MSDN heres the link : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/netds/creating_groups.asp ive tried the code but it...
7
by: Christine | last post by:
My code has a split function that should split the text file of numbers. I've run this in previous programs as it is here and it worked, but now it wont work for some reason and returns...
1
by: Gary | last post by:
I have the following in my web.config.... <customErrors mode="RemoteOnly" defaultRedirect="Applicationerror.aspx"/> but, my error page does not display. Instead a 'Runtime Error' page...
14
by: squash | last post by:
The following code works fine in Firefox/Netscape but wont work in IE. I suspect the problem is with one of these two simple functions. If there is no obvious error Ill paste the entire code. ...
4
by: Milsnips | last post by:
Hi there, i have 2 pages: default.aspx and getTime.aspx 1. getTime.aspx has one line: "response.write(datetime.now())" 2. default.aspx has the following html code: "<script...
2
by: jcollins1991 | last post by:
im trying to make a program thats supposed to check whether 2 strings are anagrams of each other (anagram = same letters in both strings, but in different orders... "cool as wet art" , and "cs at...
2
by: Admiral | last post by:
Hi, Anyone knows how this works? I have made a textbox called Editbox1 and 10 buttons. b0, b1, b2 etc. What i want to do is when i press a button, b1 for example, a number 1 appears into...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.