Sponsored Content
Top Forums Programming Python program faster than C++ program. Post 302465814 by Corona688 on Sunday 24th of October 2010 12:32:29 PM
Old 10-24-2010
It's entirely possible to write slow C++ code by picking a poor algorithm or convoluted implementation. It's also possible to write fast Python code by picking a good algorithm and keeping most of the computational work inside Python builtins, being builtins execute at almost native speed.

Without seeing your code I cannot guess, for I left my crystal ball at home.
 

10 More Discussions You Might Find Interesting

1. Programming

How to write to stdin of another program (program A -> [stdin]program B)

Hi, Program A: uses pipe() I am able to read the stdout of PROGAM B (stdout got through system() command) into PROGRAM A using: * child -> dup2(fd, STDOUT_FILENO); -> execl("/path/PROGRAM B", "PROGRAM B", NULL); * parent -> char line; -> read(fd, line, 100); Question: ---------... (1 Reply)
Discussion started by: vvaidyan
1 Replies

2. Programming

A program to trace execution of another program

Hi, I wanted to know if i can write a program using switches and signals, etc to trace execution of other unix program which calls c program internally. If yes how? If not with signals and switches then are there any other methods apart from debugging with gdb/dbx. (3 Replies)
Discussion started by: jiten_hegde
3 Replies

3. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

4. Shell Programming and Scripting

Shell script to run a python program on multiple entries in a file

Hello I am trying to run a python program using shell script, which takes a single argument from a file. This file has one entry per line : 1aaa 2bbb 3ccc 4ddd 5eee ... ... ... My shell script runs the program, only for the last entry : #!/bin/sh IFS=$'\n' for line in $(cat... (2 Replies)
Discussion started by: ad23
2 Replies

5. Homework & Coursework Questions

Calling compiled C program with Perl program

Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Discussion started by: jdkirby
1 Replies

6. AIX

Strange problem running python program from within ant

Hello, I'm currently trying to port an ant based build to AIX 6.1. The build queries the underlying version control system (Mercurial) for some data, which works fine on other platforms (Linux, Solaris). However, on AIX the hg command fails to load python's md5 module when used in the build,... (1 Reply)
Discussion started by: dhs
1 Replies

7. Programming

Regarding Python Program with Shell Script

Hi All, I have written a shell script which is using the expect method, it is working fine in terminal window, and then I have executed via python script its also working fine in command prompt functioning properly, I used subprocess.Popen method to execute the shell script file, its working... (0 Replies)
Discussion started by: janaefx
0 Replies

8. Programming

Python program

Can someone help me please to write a Python program that support a processing of arithmetic expressions in postfix notation. Expressions in postfix notation contain the operands on which the operation is performed followed by an operator. For example, 3 4 + is equal to 3 + 4 in the infix... (2 Replies)
Discussion started by: Jim-266
2 Replies

9. Shell Programming and Scripting

Tweak python program to give result in json

Hi , Below is the script which prints result in json but when i validate it has some tab or extra space issues. JSON result { "data": } This is the line I tweaked. Please advise. print "\t{", "\"{#NAME}\":\""+container+hn+"\"}" #!/usr/bin/env python # (2 Replies)
Discussion started by: ashokvpp
2 Replies

10. Shell Programming and Scripting

Perl program get a response before the program quits

I created a program, so a kid can practice there math on it. It dispenses varies math problems and the kid must input an answer. I also want it to grade the work they have done, but I can't find the best place for it to print out the grade. I have: if ( $response =~ m/^/ ) { $user_wants_to_quit... (1 Reply)
Discussion started by: germany1517
1 Replies
kball(6)							       Games								  kball(6)

NAME
kball - a game of skill and reflexes for all the family SYNOPSIS
kball [-w] [-bppXX] [-mapeditor] [-trace] DESCRIPTION
KBall is a game of skill and reflexes, non violent, suitable for all ages. The idea is to move a ball around the map, without falling, without running out of time, and getting the prizes, in order to reach the exit. The map has different traps, such as slides, pushers, jumps, falls, walls, etc. Maps are viewed from top view, and the walls and player's ball are real-time rendered in beautiful 3D. It is 100% non-violent FUN - Suitable for ALL ages. Also, a easy to use, full map editor is included, so you can do your OWN maps! USAGE
You must guide your crystal ball in the labyrinth, without falling from it, without running out of time, and picking up the ying-yang power ups, in order to exit the labyrinth reaching the floor marked with the ying-yang mark. Besides the ying-yang power ups, there are other prizes that will have different effects on the score. KEYS
Some keys that you can use during the game: Key Effect ESC Ends the game P PAUSE Pause the game F12 Save a screen-shoot TIPS
You don't need to pick up all the prizes to exit, only the ying-yang, but you may desire to get all the prizes to get a better score. Always keep and eye on remaining time. There are secret zones in some labyrinths. Look for them. In some levels, there are secret shortcuts. In some places, there are fake walls, you can go thought them and reach secret places. You can move your ball in the middle of the air, use this to do cool jumps. Is better to do multiple jumps at once, using your ability to move the ball in the air to perfect the multi-jump. You can use a combination of controllers to move the ball (like mouse + keyboard for example). When you be ready to exit the level, you will see the word "EXIT" flashing at upper right. Don't try to exit the level if you don't see that word. Use the map editor to do your own custom maps. The new levels must be saved inside the "levels" folder inside the installation folder of Kball. Pressing <F1> in the map editor you will see a list with all the available commands. OPTIONS
These command line options are available: -w Runs the game in a window. -f Runs the game in a full screen. -nosound Disables music and sound system. -bpp16 Selects a 16 bits color depth. -bpp15 Selects a 15 bits color depth. -bpp32 Selects a 32 bits color depth. -bpp24 Selects a 24 bits color depth. -mapeditor Starts only the map editor. -trace Enables the debugging tracer, only useful for the developers of the game, or to report bugs. AUTHOR
The original program was written by Kronoman. This manual page was written for the Debian GNU/Linux system by Miriam Ruiz <little_miry@yahoo.es> (but may be used by others, of course) Miriam Ruiz 06.04.2005 kball(6)
All times are GMT -4. The time now is 07:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy