Re: new to python, help please !!

2015-11-12 Thread Denis McMahon
On Wed, 11 Nov 2015 08:34:30 -0800, Anas Belemlih wrote: > i am a beginning programmer, i am trying to write a simple code to > compare two character sets in 2 seperate files. ( 2 hash value files > basically) Why? If you simply wish to compare two files, most operating systems provide executa

Re: new to python, help please !!

2015-11-12 Thread Denis McMahon
On Thu, 12 Nov 2015 17:55:33 +, Quivis wrote: > On Thu, 12 Nov 2015 13:58:35 +1100, Steven D'Aprano wrote: > >> horribly inefficient > > Assuming it was md5 values, who cares? Those are small. A file of 160 million md5 hashes as 32 character hex strings is a huge file. Your method calculat

Re: new to python, help please !!

2015-11-12 Thread Peter Otten
Tim Chase wrote: > On 2015-11-12 15:56, Peter Otten wrote: >> Tim Chase wrote: >> >> > with open("file1.md5") as a, open("file2.md5") as b: >> > for s1, s2 in zip(a, b): >> > if s1 != s2: >> > print("Files differ") >> >> Note that this will not detect extra lines in one of th

Re: new to python, help please !!

2015-11-12 Thread Tim Chase
On 2015-11-12 15:56, Peter Otten wrote: > Tim Chase wrote: > > > with open("file1.md5") as a, open("file2.md5") as b: > > for s1, s2 in zip(a, b): > > if s1 != s2: > > print("Files differ") > > Note that this will not detect extra lines in one of the files. > I recommend that

Re: new to python, help please !!

2015-11-12 Thread Peter Otten
Tim Chase wrote: > with open("file1.md5") as a, open("file2.md5") as b: > for s1, s2 in zip(a, b): > if s1 != s2: > print("Files differ") Note that this will not detect extra lines in one of the files. I recommend that you use itertools.zip_longest (izip_longest in Python 2)

Re: new to python, help please !!

2015-11-12 Thread paul.hermeneutic
Would some form of subprocess.Popen() on cmp or fc /b be easier? On Nov 12, 2015 7:13 AM, "Tim Chase" wrote: > On 2015-11-12 08:21, Marko Rauhamaa wrote: > > And if you really wanted to compare two files that are known to > > contain MD5 checksums, the simplest way is: > > > >with open('f1.md

Re: new to python, help please !!

2015-11-12 Thread Tim Chase
On 2015-11-12 08:21, Marko Rauhamaa wrote: > And if you really wanted to compare two files that are known to > contain MD5 checksums, the simplest way is: > >with open('f1.md5') as f1, open('f2.md5') as f2: >if f1.read() == f2.read(): >... >else: >... T

Re: new to python, help please !!

2015-11-11 Thread Marko Rauhamaa
Steven D'Aprano : > On Thursday 12 November 2015 04:48, Quivis wrote: > >> On Wed, 11 Nov 2015 08:34:30 -0800, Anas Belemlih wrote: >> >>> md5 >> >> If those are md5 values stored inside files, wouldn't it be easier to >> just hash them? >> >> import hashlib >> >> m1 = hashlib.sha224(open('f1'

Re: new to python, help please !!

2015-11-11 Thread Steven D'Aprano
On Thursday 12 November 2015 04:48, Quivis wrote: > On Wed, 11 Nov 2015 08:34:30 -0800, Anas Belemlih wrote: > >> md5 > > If those are md5 values stored inside files, wouldn't it be easier to > just hash them? > > import hashlib > > m1 = hashlib.sha224(open('f1').read()).hexdigest() > m2 = has

Re: new to python, help please !!

2015-11-11 Thread Ben Finney
Anas Belemlih writes: > i am a beginning programmer, i am trying to write a simple code to > compare two character sets in 2 seperate files. ( 2 hash value files > basically) Welcome, and congratulations on arriving at Python for your programming! As a beginning programmer, you will benefit f

Re: new to python, help please !!

2015-11-11 Thread Tim Chase
On 2015-11-11 08:34, Anas Belemlih wrote: > i am a beginning programmer, i am trying to write a simple code > to compare two character sets in 2 seperate files. ( 2 hash value > files basically) idea is: open both files, measure the length of > the loop on. > > if the length doesn't match, ==

Re: new to python, help please !!

2015-11-11 Thread John Gordon
In <93aef8e5-3d6f-41f4-a625-cd3c20076...@googlegroups.com> Anas Belemlih writes: > i=0 > s1=line1[i] > s2=line2[i] > count = 0 > if number1 != number2: > print " hash table not the same size" > else: > while count < number1: > if s1 == s2: > print " character", lin

Re: New to Python, Help to get script working?

2013-12-18 Thread Mark
Actually i live stream nearly everyday for 2 years, the problem with twitch is that the more "popular" people get first dibs and get treated better, have better perks, and all of that... Its all based on your initial viewer count, 90% of viewers just click the top video. All my views and numbers

Re: New to Python, Help to get script working?

2013-12-17 Thread Joel Goldstick
On Tue, Dec 17, 2013 at 12:33 PM, Rick Johnson wrote: > On Monday, December 16, 2013 1:09:38 AM UTC-6, Mark wrote: > > On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > > > I went and looked at the post linked to, and it has > > > buggy indentation. (Quite possibly indicates

Re: New to Python, Help to get script working?

2013-12-17 Thread Rick Johnson
On Monday, December 16, 2013 1:09:38 AM UTC-6, Mark wrote: > On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > > I went and looked at the post linked to, and it has > > buggy indentation. (Quite possibly indicates that the > > author has two-space tabs, and didn't notice a bug

Re: New to Python, Help to get script working?

2013-12-17 Thread rusi
On Tuesday, December 17, 2013 4:35:31 PM UTC+5:30, Mark wrote: > I am sorry, using google groups i cant tell what you see... > Anyways, I guess i will just make lots of lines instead of long sentences? > How about this, the first person that can get this to work for me... > I will paypal them 20 d

Re: New to Python, Help to get script working?

2013-12-17 Thread Mark
I am sorry, using google groups i cant tell what you see... Anyways, I guess i will just make lots of lines instead of long sentences? How about this, the first person that can get this to work for me... I will paypal them 20 dollars for helping me. I just want to get this thing up and going. Ive

Re: New to Python, Help to get script working?

2013-12-16 Thread rusi
On Tuesday, December 17, 2013 1:55:57 AM UTC+5:30, Mark wrote: > I am sorry if the way I posted messages was incorrect. Like I said, I am new > to google groups and python quite a bit but i am trying to do things > correctly by you guys. The errors that I am getting were not necessarily > postin

Re: New to Python, Help to get script working?

2013-12-16 Thread Mark
I am sorry if the way I posted messages was incorrect. Like I said, I am new to google groups and python quite a bit but i am trying to do things correctly by you guys. The errors that I am getting were not necessarily posting traceback messages. In those messages I posted my last bit of confus

Re: New to Python, Help to get script working?

2013-12-16 Thread Ned Batchelder
On 12/16/13 3:02 AM, Mark wrote: If i just try to double click the script, i get an index error, i can barely see the window it disappears so fast, but thats what I see. If you're going to participate in this forum, you'll get better help from people if you use the medium well. 1) Sending

Re: New to Python, Help to get script working?

2013-12-16 Thread Mark Lawrence
On 16/12/2013 08:02, Mark wrote: The record for double spaced google crap, congratulations. Mind you, it's a great new game this, Spot the Text, much better than I Spy!!! On Monday, December 16, 2013 2:55:23 AM UTC-5, Mark wrote: On Monday, December 16, 2013 2:52:05 AM UTC-5, Mark wrote:

Re: New to Python, Help to get script working?

2013-12-16 Thread Frank Millman
"Mark" wrote in message news:4c2822b4-d95c-4735-af12-55ac5ff2f...@googlegroups.com... > On Monday, December 16, 2013 2:55:23 AM UTC-5, Mark wrote: > > If i just try to double click the script, i get an index error, i can > barely see the window it disappears so fast, but thats what I see. I ha

Re: New to Python, Help to get script working?

2013-12-16 Thread Mark
On Monday, December 16, 2013 2:55:23 AM UTC-5, Mark wrote: > On Monday, December 16, 2013 2:52:05 AM UTC-5, Mark wrote: > > > On Monday, December 16, 2013 2:48:56 AM UTC-5, Mark wrote: > > > > > > > On Monday, December 16, 2013 2:43:45 AM UTC-5, Mark wrote: > > > > > > > > > > > > > > >

Re: New to Python, Help to get script working?

2013-12-16 Thread Mark
On Monday, December 16, 2013 2:52:05 AM UTC-5, Mark wrote: > On Monday, December 16, 2013 2:48:56 AM UTC-5, Mark wrote: > > > On Monday, December 16, 2013 2:43:45 AM UTC-5, Mark wrote: > > > > > > > On Monday, December 16, 2013 2:09:38 AM UTC-5, Mark wrote: > > > > > > > > > > > > > > >

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Monday, December 16, 2013 2:48:56 AM UTC-5, Mark wrote: > On Monday, December 16, 2013 2:43:45 AM UTC-5, Mark wrote: > > > On Monday, December 16, 2013 2:09:38 AM UTC-5, Mark wrote: > > > > > > > On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > > > > > > > > > > >

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Monday, December 16, 2013 2:43:45 AM UTC-5, Mark wrote: > On Monday, December 16, 2013 2:09:38 AM UTC-5, Mark wrote: > > > On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > > > > > > > On Mon, Dec 16, 2013 at 12:37 PM, Steven D'Aprano > > > > > > > > > > > > > >

Re: New to Python, Help to get script working?

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 6:43 PM, Mark wrote: > Syntax Error: invalid syntax python twitch.py 10 10 >File " line 1 > python twitch.py 10 10 You're trying to run that from the interactive Python prompt. Run it from the system - exit Python and run just this script. ChrisA -- https://

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Monday, December 16, 2013 2:09:38 AM UTC-5, Mark wrote: > On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > > > On Mon, Dec 16, 2013 at 12:37 PM, Steven D'Aprano > > > > > > wrote: > > > > > > > Step 1: replace the modified version of the script with a known good cop

Re: New to Python, Help to get script working?

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 6:09 PM, Mark wrote: > Traceback (most recent call last): > File "C:\Python27\Scripts\Twitch.py", line 9, in > numberOfViewers = int(sys.argv[1]) > IndexError: list index out of range > > Is this where i would plug in the variables to make it work? I'm not quite > s

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Sunday, December 15, 2013 9:33:17 PM UTC-5, Chris Angelico wrote: > On Mon, Dec 16, 2013 at 12:37 PM, Steven D'Aprano > > wrote: > > > Step 1: replace the modified version of the script with a known good copy. > > > > > > > Actually, this might be where the problem is, unfortunately. Not

Re: New to Python, Help to get script working?

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 12:37 PM, Steven D'Aprano wrote: > Step 1: replace the modified version of the script with a known good copy. > Actually, this might be where the problem is, unfortunately. Not the OP's fault at all. I went and looked at the post linked to, and it has buggy indentation. (Q

Re: New to Python, Help to get script working?

2013-12-15 Thread Steven D'Aprano
On Sun, 15 Dec 2013 13:31:10 -0800, Mark wrote: > I originally get an indent error on line 19, i delete the indent and i > get > > ***'return outside function (Twitch.py, line 19) > > Thats where i am at. This is on version 2.7 Remember the bit where we asked you to copy and paste the entire e

Re: New to Python, Help to get script working?

2013-12-15 Thread Chris Angelico
On Mon, Dec 16, 2013 at 8:31 AM, Mark wrote: > I originally get an indent error on line 19, i delete the indent and i get > > ***'return outside function (Twitch.py, line 19) Good point, someone's made a mistake in that file. What you need to do is match the "output = ..." line and the "return ..

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
On Sunday, December 15, 2013 4:19:47 PM UTC-5, Mark wrote: > Thanks for the replies, I was hoping that one of you guys could actually try > it for me, as it might be easier to correct? In the meantime i will install > 2.7 instead of 3.3 and give it a try. > > > > Once again, i have very little

Re: New to Python, Help to get script working?

2013-12-15 Thread Mark
Thanks for the replies, I was hoping that one of you guys could actually try it for me, as it might be easier to correct? In the meantime i will install 2.7 instead of 3.3 and give it a try. Once again, i have very little experience in this, which is why i am looking for help :) I am more worri

Re: New to Python, Help to get script working?

2013-12-15 Thread Denis McMahon
On Sat, 14 Dec 2013 20:51:59 -0800, Mark wrote: > I have successfully installed python 3.3 for windows, pip and > livestreamer that is needed for it to work. They are in my scripts > folder. I either do not understand the script or it no longer works. It > is more than likely my error. I get error

Re: New to Python, Help to get script working?

2013-12-14 Thread Chris Angelico
On Sun, Dec 15, 2013 at 3:51 PM, Mark wrote: > I have successfully installed python 3.3 for windows, pip and livestreamer > that is needed for it to work. What I'm seeing in that script suggests that it actually needs Python 2.7, not 3.3. The best approach would be to make it work with Python 3,

Re: New to Python, Help to get script working?

2013-12-14 Thread Steven D'Aprano
On Sat, 14 Dec 2013 20:51:59 -0800, Mark wrote: > Hey guys, I found this website that has a script in order to increase > numbers to a live viewing stream. Being new to python, I keep running > into problems trying to get it to work. > > The original site is here, as he talks about how it works.

Re: New to Python-- Help

2006-08-08 Thread Ravi Teja
Philippe Martin wrote: > John & Mary Cook wrote: > > > I just installed Python on Windows XP Pro. When I enter 'python' at the > > >>> prompt in Pythonwin IDE I get the following: > > > > Traceback (most recent call last): > >File "", line 1, in ? > > Name Error: name 'python' is not defined

Re: New to Python-- Help

2006-08-08 Thread [EMAIL PROTECTED]
Are you refering to IDLE? or simply running python at the command line? In either case - python is just the language's name. It is not a defined name within the language. If you describe what you are trying to do, perhaps some more specific help could be had. What is happening: There currently

Re: New to Python-- Help

2006-08-08 Thread Jason
John & Mary Cook wrote: > I just installed Python on Windows XP Pro. When I enter 'python' at the >>> > prompt in Pythonwin IDE I get the following: > > Traceback (most recent call last): >File "", line 1, in ? > Name Error: name 'python' is not defined > > Can anyone help? > > Thank you, > >

Re: New to Python-- Help

2006-08-08 Thread Philippe Martin
John & Mary Cook wrote: > I just installed Python on Windows XP Pro. When I enter 'python' at the > >>> prompt in Pythonwin IDE I get the following: > > Traceback (most recent call last): >File "", line 1, in ? > Name Error: name 'python' is not defined > > Can anyone help? > > Thank you,