Re: os.system()

2012-04-20 Thread Yigit Turgut
On Apr 19, 11:02 pm, Steve n...@spam.com wrote: Yigit Turgut  wrote in message news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com... When I use os.system() function, script waits for termination of the windows that is opened by os.system() to continue thus throwing errors

Splitting a file from specific column content

2012-01-22 Thread Yigit Turgut
Hi all, I have a text file approximately 20mb in size and contains about one million lines. I was doing some processing on the data but then the data rate increased and it takes very long time to process. I import using numpy.loadtxt, here is a fragment of the data ; 0.06 -0.0004

Re: Splitting a file from specific column content

2012-01-22 Thread Yigit Turgut
On Jan 22, 4:45 pm, Roy Smith r...@panix.com wrote: In article e1f0636a-195c-4fbb-931a-4d619d5f0...@g27g2000yqa.googlegroups.com, Yigit Turgut y.tur...@gmail.com wrote: Hi all, I have a text file approximately 20mb in size and contains about one million lines. I was doing some

Re: Splitting a file from specific column content

2012-01-22 Thread Yigit Turgut
On Jan 22, 6:56 pm, MRAB pyt...@mrabarnett.plus.com wrote: On 22/01/2012 16:17, Yigit Turgut wrote: [snip] On Jan 22, 5:39 pm, Arnaud Delobellearno...@gmail.com  wrote: [snip]  Or more succintly (but not tested):  sections = [      (3, section_1)      (5, section_2

Re: Splitting a file from specific column content

2012-01-22 Thread Yigit Turgut
On Jan 22, 9:37 pm, Roy Smith r...@panix.com wrote: On Jan 22, 2012, at 2:34 PM, Tim Chase wrote: On 01/22/12 13:26, Roy Smith wrote: If you wanted to do it in one pass using standard unix tools, you can use: sed -n -e'/^[0-2]/w first-three.txt' -e'/^[34]/w next-two.txt' -e'/^[5-7]/w

Weird Loop Behaviour

2012-01-20 Thread Yigit Turgut
Hi, In the following code, I am trying to run black screen for 3 seconds and respectively 2 seconds white screen. Black routine takes 3 seconds and white 2 seconds, 2 x black + white = 8 seconds which should be the expected value but when I run it I get black-white-black- white instead of

Plot square wave

2012-01-18 Thread Yigit Turgut
Hi all, I am trying to generate a pseudo pwm signal, low-high transition will take place when screen goes from black to white and high-low transition when white to black. As a result I am trying to plot the signal. Here is my code; import time, pylab, numpy, scipy, pygame def _func1():

Parallel Processing

2012-01-08 Thread Yigit Turgut
Hi all, I am trying to run two functions at the same time with Parallel Processing (pp) as following ; import pygame import sys import time import math import pp screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) timer = pygame.time.Clock() white = True start = time.time() end =

Re: Parallel Processing

2012-01-08 Thread Yigit Turgut
On Jan 8, 4:34 pm, Dave Angel d...@davea.name wrote: On 01/08/2012 08:23 AM, Yigit Turgut wrote: Hi all, I am trying to run two functions at the same time with Parallel Processing (pp) as following ; import pygame import sys import time import math import pp screen

Re: Parallel Processing

2012-01-08 Thread Yigit Turgut
On Jan 8, 6:00 pm, Chris Angelico ros...@gmail.com wrote: On Mon, Jan 9, 2012 at 2:45 AM, Yigit Turgut y.tur...@gmail.com wrote: job1 = job_server.submit(test1,()) job2 = job_server.submit(test2()) The first of these passes test1 and an empty tuple as arguments to submit(). The second

Re: Parallel Processing

2012-01-08 Thread Yigit Turgut
On Jan 9, 12:02 am, Dave Angel d...@davea.name wrote: On 01/08/2012 11:39 AM, Yigit Turgut wrote: screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) timer = pygame.time.Clock() white = True start = time.time() end = time.time() - start end2= time.time() - start

Calling a variable inside a function of another class

2012-01-07 Thread Yigit Turgut
class test(test1): def __init__(self, device): . . . def _something(self, x=1) self.dt = data if __name__ == __main__: test.something.dt ??? I am trying to call a variable located in a function of a class from main but couldn't succeed.Any ideas? --

Re: Calling a variable inside a function of another class

2012-01-07 Thread Yigit Turgut
On Jan 7, 6:01 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Sat, 07 Jan 2012 07:00:57 -0800, Yigit Turgut wrote: I am trying to call a variable located in a function of a class from main but couldn't succeed.Any ideas? You cannot access local variables from outside

Re: Plot seems weird

2011-12-26 Thread Yigit Turgut
On Dec 26, 11:28 am, Lie Ryan lie.1...@gmail.com wrote: On 12/26/2011 05:27 AM, Yigit Turgut wrote: On Dec 25, 7:06 pm, Rick Johnsonrantingrickjohn...@gmail.com  wrote: On Dec 25, 9:33 am, Yigit Turguty.tur...@gmail.com  wrote: Hi all, I have a text file as following

Multithreading

2011-12-26 Thread Yigit Turgut
I have a loop as following ; start = time.time() end = time.time() - start while(endN): data1 = self.chan1.getWaveform() end = time.time() - start timer.tick(10) #FPS screen.fill((255,255,255) if white else(0,0,0)) white = not white

Re: Plot seems weird

2011-12-26 Thread Yigit Turgut
On Dec 26, 8:58 pm, Lie Ryan lie.1...@gmail.com wrote: On 12/27/2011 04:08 AM, Yigit Turgut wrote: On Dec 26, 11:28 am, Lie Ryanlie.1...@gmail.com  wrote: On 12/26/2011 05:27 AM, Yigit Turgut wrote: On Dec 25, 7:06 pm, Rick Johnsonrantingrickjohn...@gmail.com    wrote: On Dec 25

Re: Multithreading

2011-12-26 Thread Yigit Turgut
On Dec 26, 10:03 pm, Ian Kelly ian.g.ke...@gmail.com wrote: On Mon, Dec 26, 2011 at 1:01 PM, Ian Kelly ian.g.ke...@gmail.com wrote: You essentially have two completely independent loops that need to run simultaneously with different timings.  Sounds like a good case for multiple threads (or

Re: Multithreading

2011-12-26 Thread Yigit Turgut
On Dec 26, 10:01 pm, Ian Kelly ian.g.ke...@gmail.com wrote: On Mon, Dec 26, 2011 at 11:31 AM, Yigit Turgut y.tur...@gmail.com wrote: I have a loop as following ; start = time.time() end = time.time() - start  while(endN):          data1 = self.chan1.getWaveform()          end

Plot seems weird

2011-12-25 Thread Yigit Turgut
Hi all, I have a text file as following; 0.2000470.00 0.2000530.16 0.2000590.00 0.2000650.08 0.2000720.00 0.2000780.16 And I am trying to plot it with ; filenames = sys.argv[1:] if len(filenames) == 0: filenames =

Re: Plot seems weird

2011-12-25 Thread Yigit Turgut
On Dec 25, 7:06 pm, Rick Johnson rantingrickjohn...@gmail.com wrote: On Dec 25, 9:33 am, Yigit Turgut y.tur...@gmail.com wrote: Hi all, I have a text file as following; 0.200047        0.00 0.200053        0.16 0.200059        0.00 0.200065        0.08 0.200072

Re: Text Processing

2011-12-22 Thread Yigit Turgut
On Dec 21, 2:01 am, Alexander Kapps alex.ka...@web.de wrote: On 20.12.2011 22:04, Nick Dokos wrote: I have a text file containing such data ;          A                B                C --- -2.0100e-01    8.000e-02    

Text Processing

2011-12-20 Thread Yigit Turgut
Hi all, I have a text file containing such data ; ABC --- -2.0100e-018.000e-028.000e-05 -2.e-010.000e+00 4.800e-04 -1.9900e-014.000e-021.600e-04 But I only need Section B, and I

Re: Screen Control Fullscreen ON/OFF

2011-12-15 Thread Yigit Turgut
On Dec 15, 4:19 pm, Ulrich Eckhardt ulrich.eckha...@dominolaser.com wrote: Am 15.12.2011 12:12, schrieb yeet: My LCD has 2ms respond time thus it can handle a maximum of 50Hz ON/ OFF (white/black) thus seems to fit my 1-40Hz range. You might want to ask Santa for a new calculator, as in my