Re: Need help in python program

2016-10-29 Thread Veek M
id_1, clk, val = foo_function() id_2, key, units, delay = bar_function() if id_1 == id_2: print id_1, clk, val, key, units, delay -- https://mail.python.org/mailman/listinfo/python-list

Re: Need help in python program

2016-07-01 Thread Christian Gollwitzer
Am 01.07.16 um 12:26 schrieb Archana Sonavane: Hello Everyone, I am doing python code by using API. My first API giving fields - Itemid, clock and value second API giving fields - Itemid, key, units and delay using for loops for both API. Could you please tell me how to compare both id by

Re: Need help in python program

2016-07-01 Thread Bob Gailer
On Jul 1, 2016 6:30 AM, "Archana Sonavane" wrote: > > Hello Everyone, > > I am doing python code by using API. > > My first API giving fields - Itemid, clock and value > second API giving fields - Itemid, key, units and delay > > using for loops for both API. > > Could

Need help in python program

2016-07-01 Thread Archana Sonavane
Hello Everyone, I am doing python code by using API. My first API giving fields - Itemid, clock and value second API giving fields - Itemid, key, units and delay using for loops for both API. Could you please tell me how to compare both id by using equal operator. My output should be :

Re: Need help with a program

2010-02-03 Thread Nobody
On Tue, 02 Feb 2010 15:07:05 -0800, Aahz wrote: If you have a problem and you think that regular expressions are the solution then now you have two problems. Regex is really overkill for the OP's problem and it certainly doesn't improve readability. If you're going to use a quote, it works

Re: Need help with a program

2010-02-02 Thread Aahz
In article mailman.1551.1264701475.28905.python-l...@python.org, D'Arcy J.M. Cain da...@druid.net wrote: If you have a problem and you think that regular expressions are the solution then now you have two problems. Regex is really overkill for the OP's problem and it certainly doesn't improve

Re: Need help with a program

2010-01-29 Thread Johann Spies
On Thu, Jan 28, 2010 at 07:07:04AM -0800, evilweasel wrote: Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I have a huge text file similar to the format below: AGACTCGAGTGCGCGGA 0 AGATAAGCTAATTAAGCTACTGG

Re: Need help with a program

2010-01-29 Thread Steven D'Aprano
On Fri, 29 Jan 2010 11:23:54 +0200, Johann Spies wrote: On Thu, Jan 28, 2010 at 07:07:04AM -0800, evilweasel wrote: Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I have a huge text file similar to the format

Re: Need help with a program

2010-01-29 Thread Johann Spies
On Fri, Jan 29, 2010 at 10:04:33AM +, Steven D'Aprano wrote: I know this is a python list but if you really want to get the job done quickly this is one method without writing python code: $ cat /tmp/y AGACTCGAGTGCGCGGA 0 AGATAAGCTAATTAAGCTACTGG 0

Re: Need help with a program

2010-01-29 Thread D'Arcy J.M. Cain
On Fri, 29 Jan 2010 11:23:54 +0200 Johann Spies jsp...@sun.ac.za wrote: I know this is a python list but if you really want to get the job done quickly this is one method without writing python code: [...] $ grep -v 0 /tmp/y tmp/z There's plenty of ways to do it without writing Python. C,

Re: Need help with a program

2010-01-29 Thread nn
Johann Spies wrote: On Thu, Jan 28, 2010 at 07:07:04AM -0800, evilweasel wrote: Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I have a huge text file similar to the format below: AGACTCGAGTGCGCGGA

Need help with a program

2010-01-28 Thread evilweasel
Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I have a huge text file similar to the format below: AGACTCGAGTGCGCGGA 0 AGATAAGCTAATTAAGCTACTGG 0 AGATAAGCTAATTAAGCTACTGGGTT 1

Re: Need help with a program

2010-01-28 Thread Alf P. Steinbach
* evilweasel: Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I have a huge text file similar to the format below: AGACTCGAGTGCGCGGA 0 AGATAAGCTAATTAAGCTACTGG 0 AGATAAGCTAATTAAGCTACTGGGTT 1

Re: Need help with a program

2010-01-28 Thread Mark Dickinson
On Jan 28, 3:07 pm, evilweasel karthikramaswam...@gmail.com wrote: Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. snip for j in range(0, b):     if lister[j] == 0: At a guess, this line should be: if lister[j] == '0':

Re: Need help with a program

2010-01-28 Thread Krister Svanlund
On Thu, Jan 28, 2010 at 4:07 PM, evilweasel karthikramaswam...@gmail.com wrote: Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I have a huge text file similar to the format below: AGACTCGAGTGCGCGGA   0

Re: Need help with a program

2010-01-28 Thread Krister Svanlund
On Thu, Jan 28, 2010 at 4:28 PM, Krister Svanlund krister.svanl...@gmail.com wrote: On Thu, Jan 28, 2010 at 4:07 PM, evilweasel karthikramaswam...@gmail.com wrote: Hi folks, I am a newbie to python, and I would be grateful if someone could point out the mistake in my program. Basically, I

Re: Need help with a program

2010-01-28 Thread D'Arcy J.M. Cain
On Thu, 28 Jan 2010 07:07:04 -0800 (PST) evilweasel karthikramaswam...@gmail.com wrote: I am a newbie to python, and I would be grateful if someone could Welcome. point out the mistake in my program. Basically, I have a huge text file similar to the format below: You don't say how it isn't

Re: Need help with a program

2010-01-28 Thread Krister Svanlund
On Thu, Jan 28, 2010 at 4:31 PM, Krister Svanlund krister.svanl...@gmail.com wrote: On Thu, Jan 28, 2010 at 4:28 PM, Krister Svanlund krister.svanl...@gmail.com wrote: On Thu, Jan 28, 2010 at 4:07 PM, evilweasel karthikramaswam...@gmail.com wrote: Hi folks, I am a newbie to python, and I

Re: Need help with a program

2010-01-28 Thread evilweasel
I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been found in a particular sample). So, I would need to ignore the ones

Re: Need help with a program

2010-01-28 Thread nn
On Jan 28, 10:50 am, evilweasel karthikramaswam...@gmail.com wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been

Re: Need help with a program

2010-01-28 Thread Arnaud Delobelle
nn prueba...@latinmail.com writes: On Jan 28, 10:50 am, evilweasel karthikramaswam...@gmail.com wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the

Re: Need help with a program

2010-01-28 Thread John Posner
On 1/28/2010 10:50 AM, evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been found in a particular sample).

Re: Need help with a program

2010-01-28 Thread D'Arcy J.M. Cain
On Thu, 28 Jan 2010 18:49:02 +0100 Jean-Michel Pichavant jeanmic...@sequans.com wrote: Using regexp may increase readability (if you are familiar with it). If you have a problem and you think that regular expressions are the solution then now you have two problems. Regex is really overkill for

Re: Need help with a program

2010-01-28 Thread Jean-Michel Pichavant
evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been found in a particular sample). So, I would need to

Re: Need help with a program

2010-01-28 Thread Jean-Michel Pichavant
D'Arcy J.M. Cain wrote: On Thu, 28 Jan 2010 18:49:02 +0100 Jean-Michel Pichavant jeanmic...@sequans.com wrote: Using regexp may increase readability (if you are familiar with it). If you have a problem and you think that regular expressions are the solution then now you have two

Re: Need help with a program

2010-01-28 Thread Steven Howe
On 01/28/2010 09:49 AM, Jean-Michel Pichavant wrote: evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times the sequence has been

Re: Need help with a program

2010-01-28 Thread Mensanator
On Jan 28, 12:28 pm, Steven Howe howe.ste...@gmail.com wrote: On 01/28/2010 09:49 AM, Jean-Michel Pichavant wrote: evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to

Re: Need help with a program

2010-01-28 Thread MRAB
Steven Howe wrote: On 01/28/2010 09:49 AM, Jean-Michel Pichavant wrote: evilweasel wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the sequence (this is basically the number of times

Re: Need help with a program

2010-01-28 Thread nn
Arnaud Delobelle wrote: nn prueba...@latinmail.com writes: On Jan 28, 10:50 am, evilweasel karthikramaswam...@gmail.com wrote: I will make my question a little more clearer. I have close to 60,000 lines of the data similar to the one I posted. There are various numbers next to the

Re: Need help with a program

2010-01-28 Thread Arnaud Delobelle
nn prueba...@latinmail.com writes: After posting I was thinking I should have posted a more straightforward version like the one you wrote. Now there is! It probably is more efficient too. I just have a tendency to think in terms of pipes: pipe this junk in here, then in here, get output.

Need help with first program to connect to mysql database via apache and python.

2008-02-06 Thread pythonbrian
I am just learning python and I am trying to create a simple connection to a mysql table via Python and Apache, using a Python program Unfortunately I keep getting an internal server error (50), when I bring it up in my browser ... information attached. Any help would be appreciated ... Thx,

Re: Need help with first program to connect to mysql database via apache and python.

2008-02-06 Thread Steve Holden
pythonbrian wrote: I am just learning python and I am trying to create a simple connection to a mysql table via Python and Apache, using a Python program Unfortunately I keep getting an internal server error (50), when I bring it up in my browser ... information attached. Any help would be

Re: Need help running external program

2005-03-03 Thread Rigga
Thanks to all for your help it is now working, I rant he code through a debugger and found that the input file I was using to create my list of addresses to wget had newlines in them and were therefore breaking my command line. All your advice has been appreciated. RiGGa --

Re: Need help running external program

2005-03-02 Thread Rigga
Brian van den Broek wrote: Rigga said unto the world upon 2005-02-27 15:04: Tim Jarman wrote: SNIP No, the r was the point - it's there to tell Python not to do any escaping on the string. Try it again with the r and see what happens. Brilliant!!! that works a treat thankyou!!, where

Re: Need help running external program

2005-03-02 Thread Tim Jarman
Rigga wrote: Brian van den Broek wrote: Rigga said unto the world upon 2005-02-27 15:04: (snip stuff about raw strings) Thanks for all your help with this it is appreciated, one further question though, how do I pass a variable to the external program while using the r Thanks RiGGa

Re: Need help running external program

2005-03-02 Thread Tim Jarman
Rigga wrote: (snip) This is the command I am trying to run: feed is a list of web addresses output, input = popen2(wget -q %s -O - | tr '\r' '\n' | tr \' \ | sed -n 's/.*url=\([^]*\).*/\1/p' % feed[counter]) But it does not work, if I escape the string using r and hard code in the

Re: Need help running external program

2005-03-02 Thread Steve Holden
Rigga wrote: Tim Jarman wrote: Rigga wrote: Brian van den Broek wrote: Rigga said unto the world upon 2005-02-27 15:04: (snip stuff about raw strings) Thanks for all your help with this it is appreciated, one further question though, how do I pass a variable to the external program while using

Re: Need help running external program

2005-02-27 Thread Pink
Rigga wrote: Hi, I am running the line of code below from a shell script and it works fine, however I am at a total loss on how i can run it from within a Python script as every option I have tried fails and it appears to be down to the escaping of certain characters. wget -q

Re: Need help running external program

2005-02-27 Thread Rigga
Pink wrote: Rigga wrote: Hi, I am running the line of code below from a shell script and it works fine, however I am at a total loss on how i can run it from within a Python script as every option I have tried fails and it appears to be down to the escaping of certain characters.

Re: Need help running external program

2005-02-27 Thread Leif B. Kristensen
I'm using wget from Python to get extactly one line from a reports page. I made this function that works for me: def wgetline(exp): # see Python Cookbook p. 228 print Getting result from server ... command = 'wget -q -O - \ http://www.foobar.com/report.pl\?UserID=xxx\UserPW=xxx \

Re: Need help running external program

2005-02-27 Thread Tim Jarman
Rigga wrote: Pink wrote: Rigga wrote: Hi, I am running the line of code below from a shell script and it works fine, however I am at a total loss on how i can run it from within a Python script as every option I have tried fails and it appears to be down to the escaping of certain

Re: Need help running external program

2005-02-27 Thread Rigga
Tim Jarman wrote: Rigga wrote: Pink wrote: Rigga wrote: Hi, I am running the line of code below from a shell script and it works fine, however I am at a total loss on how i can run it from within a Python script as every option I have tried fails and it appears to be down to the

Re: Need help running external program

2005-02-27 Thread Brian van den Broek
Rigga said unto the world upon 2005-02-27 15:04: Tim Jarman wrote: SNIP No, the r was the point - it's there to tell Python not to do any escaping on the string. Try it again with the r and see what happens. Brilliant!!! that works a treat thankyou!!, where on earth did you find out about the 'r'

Re: Need help running external program

2005-02-27 Thread Pink
Rigga wrote: No, the r was the point - it's there to tell Python not to do any escaping on the string. Try it again with the r and see what happens. Brilliant!!! that works a treat thankyou!!, where on earth did you find out about the 'r' any pointers to documentation appreciated. This is