Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~45.4K People Reached
Favorite Tags
Member Avatar for Godflesh

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 …

Member Avatar for Godflesh
0
109
Member Avatar for Godflesh

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 …

Member Avatar for Stefano Mtangoo
0
247
Member Avatar for Godflesh

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() …

Member Avatar for jcao219
0
378
Member Avatar for Godflesh

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]

Member Avatar for Godflesh
0
308
Member Avatar for Godflesh

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.

0
104
Member Avatar for Godflesh

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 …

Member Avatar for Gribouillis
0
94
Member Avatar for Godflesh

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.

Member Avatar for Godflesh
0
16K
Member Avatar for Godflesh

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 == …

Member Avatar for Godflesh
0
2K
Member Avatar for Godflesh

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?

0
74
Member Avatar for Godflesh

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?

0
82
Member Avatar for Godflesh

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..

Member Avatar for Godflesh
0
97
Member Avatar for Godflesh

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, …

Member Avatar for Godflesh
0
82
Member Avatar for Cornholio

Hi, I have jest started learning Python. I would like to get some help on writing a script that would delete a set number of lines from a text file which looks like this : 1846440556 1846440521 1846440491 1846440505 1846441137 1846441102 1846441080 1846441331 1846441323 1846441315 ... ... Thanks in advance …

Member Avatar for Godflesh
0
26K
Member Avatar for Godflesh

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 …

0
86