No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
14 Posted Topics
I try again in a new thread, the other went out of hand. I use this code line to create a n value. n = random.randint(0, 99), i use this n value as a lap index to my while loop. The loop is in a function called "def run(self)" in …
How do i reach a class from within another class? I have Class A and Class B How can i activate or run class A from Class B? example, if class A and class B work toward the same resource, one create data the other consume data. How can i …
I have a problem again :) I try to use this code: [code] import time from threading import Thread from threading import Lock def main(): for i in range(3): my_thread = MyThread(i) my_thread.start() class MyThread(Thread): lock = Lock() def __init__(self, i): Thread.__init__(self) self.i = i def run(self): while True: self.lock.acquire() …
How do i make this code to store data in a global variable, it create random number of elements. [code] n = random.randint(0, 99) for i in range(1): print "-"*60 print "Here is some new elements! " while n >= 0: data_list = random.randint(0,99) print data_list, time.sleep(.10) n= n-1[/code]
Hello! I dont know were to put this question so i put it here. I need to know the biggest difference between strict alternation and lock type lock variable, critical section of processes.
Hello! I have more questions :) Is it possibe to create a "threadlock", "lock" if you use a file as a common resource? If you have a class that create data and put the data into a file and you have another class that will take data from the same …
Hello i have a big problem, i want to import queue but i get this message, somehow it dont exist. Traceback (most recent call last): File "D:\Python26\test.py", line 9, in <module> import queue ImportError: No module named queue isnt that strange.
Hello again! I have a new question. I have run a script and wants to run it again with a "keypress" input from the user, how do i code that. Like this: import subprocess drive=input(" If you want to start the script again , press 1: ") if drive == …
Linux scheduler implement what we call "soft realtime system", what is missing in Linux to be called "hard realtime system" ,if you focus on the scheduling part?
How does Linux know what type of category a process belong to? How does the priority system in linux work with "NON" realtime tasks/processes?
How can you check the length of a file / list and then use the value in an "if-loop" in python? I want to create a "if-sats" that must check the amount of elements(numbers) in a textfile, if the amount is less then 5 do this... else do that..
Hello! I have some probs with this code, somehow it dont loop 10 times as it should, just one? How do i make python use a testfil.txt that already exist? I dont want to remove the old data in the file just add new data to it? In this code, …
When i try to use this code i still have the data in the orginial filem how do i remove them from the first file?
Help me please! I have problem with this code, i get the fault mess at <1>, line 11 syntax error near uexpected token 1, what is the problem. #!/bin/bash typeset -i HITTA=0 typeset -i TELENUMMER=0 typeset -i ACTION=0 echo "<<<<TestNinsseĀ“s telefonregister>>>>" until["$ACTION" = x] do case"$action" in "<1>")read HITTA; grep …
The End.
Godflesh