Programming :: Python Program For Time ?
Jun 24, 2011
I need to write a program for time. like i have 2 tasks both minutes and hours.
like this
1st task=5 hours and 30 minutes
2nd task=2hours and 45 minutes
Together they will take 8 hours and 15 minutes.
I need to write a program thats called ADDTIMES to do something like this.
This is what i have so far.
H1=int(input("enter the number of hours:")) etc..
View 6 Replies
ADVERTISEMENT
Dec 21, 2009
I want to be able to run a program in a python script, and capture it's output in a variable. I figured out that I can execute it with os.system(), but how do I capture it's output and store it in a variable?
View 1 Replies
View Related
Jan 30, 2011
Is it possible to easily get the number of desktops, add/remove desktops, and get window titles, icons, and screenshots from a C++ or Python program?
View 12 Replies
View Related
Aug 28, 2010
I'm trying to figure out how to continue execution of a Python program while a background task is going on.
In bash, it is adding "&" to the end as in:
Code:
#! /bin/bash
find / -iname "*.py" > /tmp/all_pys &
echo "looking for all python scripts and putting them in /tmp/all_pys"
(yes, I know I could just put the echo BEFORE the find but I just use it for example)
Say I do that in python (not necessarily running the shell, but perhaps using scriptutil.ffind or something similar), but want to allow the user to be doing something else while running that search in the background, how would I thread, fork, subprocess (not to be confused with the module and Popen) [or whatever I should call it] that?
View 14 Replies
View Related
Dec 28, 2010
If i have a python file with a function call_me(a,b),how can I call this function from the command line ,after i compile the program?
View 5 Replies
View Related
May 11, 2011
im trying to calculate how much time does my program run, use very simple script
clock_t end, start;
start= clock();
int i;
printf("initial %d
",(int)start);
[Code]....
but it outputs 0 all the time. cant figure out where could be the problem.
View 2 Replies
View Related
Apr 24, 2011
i have the example code below, i want to calculate the time taken for a sample program to run. but i keep getting undefined reference error.
#include <sys/time.h>
#include <iostream>
int main(int argc, char **argv) {
struct timeval startTime;
struct timeval endTime;
[Code]...
View 9 Replies
View Related
Oct 16, 2010
I am making a program to do a breadth first search.The code which I am posting here just makes a que of the nodes visited in a binary tree in inorder fashion,so this implementation is not yet complete.While developing I got a segmentation fault which I was not able to understand why I am getting so I am posting since the tree of same program (without BFS) is working.
Code:
#include<stdio.h>
#include<stdlib.h>
[code]...
View 4 Replies
View Related
Jul 24, 2010
I tried to draw two lines with xlib.h in C. If I start this compiled program it show me in most cases a window with two lines as it should be.
But sometimes the two lines are not drawn.If I insert XFlush() before the second XSync() it worked better but not every time.Why?How can I solve the problem?How works the X-Server buffer in detail?
Code:
View 1 Replies
View Related
May 9, 2011
I am having trouble with encryption/ decryption program. The program goes out and finds the file I want it to, encrypts it into a continuing series of a single repeated negative number, then generally decrypts(or should i say re-encrypts)it into a widely repeated character, different but same results every time.
[Code]....
View 3 Replies
View Related
May 19, 2011
i am graduate student and my X colleague gave me this Fortran 77 program to run my result files with. She is no longer reachable. I compiled the following program with gfortran, it compiled well but, when i run it, gave me end of file error. My output file (which is the input file for this program (DFILE1) ) has about 78,000 lines of velocities of atoms (Vx, Vy, Vz with 1000 steps.. an example of some of the atom's velocities in the 1st step is given at the end of this program). I will be highly obliged if any one can help me with this.I run this program on opensuse linux 11.3 version /32 bit/i586
error message:
Code:
At line 124 of file v.autocorrelation.f (unit = 10, file = 'DFILE1')
Fortran runtime error: End of file
Code:
PROGRAM TCORR
COMMON / BLOCK1 / STORX, STORY, STORZ
COMMON / BLOCK2 / VX, VY, VZ
COMMON / BLOCK3 / VACF, ANORM
C *******************************************************************
code....
View 6 Replies
View Related
Jul 11, 2011
I am just asking how this works in general. I know Python can wrap a C code, but here it seems Python is already integrated with this C program.Would it be correct to say one would have to understand the C code in addition to py programming in order to accomplish anything useful here?I need to control the program, and especially import its output to some algorithm that accomplishes command and control in the way of bash scripts or whatever.
View 2 Replies
View Related
Mar 22, 2009
I want to be able to do
sudo ./program.py
instead of always having to do
sudo python program.py
What do I need to change?
View 5 Replies
View Related
Nov 30, 2009
I've already used line split stuff to transform my data into something like this in a text file:
Code:
['1', '1', '3', '20.7505207']
['2', '1', '3', '23.0488319']
['3', '1', '3', '-1.5768747']
['4', '1', '3', '-26.4772491']
[code]....
How can I get this on a python program so I can manipulate it as an array?
View 3 Replies
View Related
Mar 4, 2010
I have a function definition in a Python 2.x script which take a tuple as one of its arguments, but 2to3 has no answers nor any of my searching on how to represent the same in Python 3.x
Code:
def blah(self, (string1, string2))
View 4 Replies
View Related
Oct 6, 2010
The error is: error while loading shared libraries: libncurses.so.5: cannot open shared object file: Error 24 This occurs after a good time of running, after I added some file stuff to my code. I can't see why this is happening.
Code: Code:
// Get CPU Temperature
char sensorsRaw[128];
system("sensors >& .sensors");
std::ifstream fileIn;
fileIn.open(".sensors");
[Code]...
View 3 Replies
View Related
Apr 15, 2010
I'm just wondering what the limits for time are. I have a program that always takes exactly 20 ms, so I assume this is the lowest it can measure, but I want to see if there's some sort of documentation of this.
View 3 Replies
View Related
Dec 3, 2010
I am wanting to put a print icon into a Python program and will use printing via the command line via calling lp or lpr.
So a simple question: Whats the difference between lp and lpr?
Also when you type man lp or man lpr the man page says Apple Inc?
View 2 Replies
View Related
Dec 16, 2010
I downloaded this programs source and I'm having a hard time figuring out how to install it. I assume it is python source? I tried downloading the debian file but could not figure out how to install it aswell. I downloaded the software from [URL]
View 9 Replies
View Related
Jun 14, 2011
i have ubuntu 10.04 and python 2.6 installed how do i run, stop or restart a .py file from the command line.
btw im using Putty from a windows computer
View 1 Replies
View Related
Apr 7, 2011
How can i embed python script in C program?
View 1 Replies
View Related
Jun 3, 2011
I need to know how to make a program use a version of python older than the newest one. I am trying to run the Traipse fork of OpenRPG. Through their forums, I have learned that one of my problems is that I am running too new a version of python. I have python 2.7.1 installed.
I also have python2.6.6 installed, so I should be able to use that. My first thought was to uninstall 2.7.1 and just use the older version. The problem is that if i uninstall 2.7.1, it wants to also uninstall all the packages dependent on that program. Let's face it, in Natty Narwhal, that is pretty much everything.
Do you know how to force Traipse make it use the 2.6 version?
View 2 Replies
View Related
Jan 14, 2010
I am trying to find a way to execute a python script in regular time intervals? How can I do it?
View 2 Replies
View Related
Apr 18, 2011
I installed a newer version of python in /usr/local/bin/python2.6. Now I want to use that python and only that one. When I type "Which python", I want to see /usr/local/bin/python2.6, NOT /usr/bin/python, which is old one (2.4). Also, I want to see the same even after I reboot. How do I do that?
View 2 Replies
View Related
Feb 9, 2011
I want that I click with the mouse on the video, it paused.I notice that there is "BaconVideoWidget" which I guess is the video rendering widget but it don't have signal named "clicked":
Code:
vd = totem_object.get_video_widget()
vd.connect("clicked", vd.hide)
[code]....
View 3 Replies
View Related
Feb 20, 2011
I'm running xbmc on slackware64-13.1 and it's running great. However a python addon script is giving me trouble. The script contains some utf-8 characters, and by default I get an error because coding isn't declared in the script. I've added
Code: # -*- coding: utf-8 -*- to the scripts and they will work fine, but they are updated very frequently. I've tried messing around with turning on unicode console and such but I'm a bit in the dark on this. Is there a way I can get slack to handle those scripts without having to edit them every time I update?
View 10 Replies
View Related
Apr 16, 2010
I need to write program (preffer Python) to change range for users. Does anyone know some library which can help me to do that? Maybe someone has written program like that?
View 5 Replies
View Related
Mar 2, 2011
I am using Debian linux. I have 100 timers running. If a timer expired which will generate a signal and it was mapped to a same function handler. All the timers are mapped to one function handler. The problem is if the timer expires one at a time, the function handler called at a time. But if the 2 timers expires at a time, the function handler is called one time only instead 2 times. Is it possible to invoke the function handler as many times based on timer expirary happens simultaneoulsy?
View 14 Replies
View Related
May 18, 2010
I want to record an internet radio station starting at 2:00am tomorrow morning. The specific program on the radio station lasts until 6:00am. The command I need to run to record the station is: Code:mplayer http://wjcu.jcu.edu:8001/listen.pls -ao pcm:file=indie_heat_of_the_night.wav -vc dummy -vo nullI'd use cron, but 1. I'm not sure how to and 2. it seems unnecessarily complicated for something that I only want to run once. If cron is the only/easiest solution, I guess I'll just have to resort to that, but I'd rather not.
View 12 Replies
View Related
Feb 15, 2011
I will have to code this. However I am lacking of time since I have too much to do. make a short code bash/dash to prompt the country with Zenity, then, get the PLS or m3u url and prompt with another zenity which radio to play. http://www.listenlive.eu/index.html
My code to get url's radio country.htm is:
Code:
View 2 Replies
View Related