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 executable tools at the OS level which are more efficient than 
anything you will write in a scripting language.

Lesson 1 of computing. Use the right tool for the job. Writing a new 
program is not always the right tool.
-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


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 calculates the hash over both files to test whether the 
contents are different. If the input files are both lists of 160 million 
md5 hashes, you're calculating the hash of two 5 gigabyte files.

In your method the size of the lines of data is irrelevant to the 
execution time, the execution time varies with the size of the datafiles.
-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


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 the files.
>> I recommend that you use itertools.zip_longest (izip_longest in
>> Python 2) instead of the built-in zip().
> 
> Yeah, I noticed that after pushing  but then posted a later
> version that just read chunks of the file which should catch that
> file-size difference.  Or, as in that other message, prefix it with
> an fstat() check to compare file-sizes so that you don't even have to
> open the files if the sizes differ.
> 
> -tkc

>>> os.path.getsize("file1.md5")
10
>>> os.path.getsize("file2.md5")
10
>>> with open("file1.md5") as a, open("file2.md5") as b:
... for s, t in zip(a, b):
... if s != t: print("different")
... 
>>> from itertools import zip_longest
>>> with open("file1.md5") as a, open("file2.md5") as b:
... for s, t in zip_longest(a, b):
... if s != t: print("different")
... 
different

I admit I cheated and used Python 3 ;)


-- 
https://mail.python.org/mailman/listinfo/python-list


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 you use itertools.zip_longest (izip_longest in
> Python 2) instead of the built-in zip().

Yeah, I noticed that after pushing  but then posted a later
version that just read chunks of the file which should catch that
file-size difference.  Or, as in that other message, prefix it with
an fstat() check to compare file-sizes so that you don't even have to
open the files if the sizes differ.

-tkc


-- 
https://mail.python.org/mailman/listinfo/python-list


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) 
instead of the built-in zip().

-- 
https://mail.python.org/mailman/listinfo/python-list


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.md5') as f1, open('f2.md5') as f2:
> >if f1.read() == f2.read():
> >...
> >else:
> >...
>
> Though that suffers if the files are large.  Might try
>
>   CHUNK_SIZE = 4 * 1024 # read 4k chunks
>   # chunk_offset = 0
>   with open('f1.md5') as f1, open('f2.md5') as f2:
> while True:
>   c1 = f1.read(CHUNK_SIZE)
>   c2 = f2.read(CHUNK_SIZE)
>   if c1 or c2:
> # chunk_offset += 1
> if c1 != c2:
>   not_the_same(c1, c2)
>   # not_the_same(chunk_offset * CHUNK_SIZE, c1, c2)
>   break
>   else: # EOF
> the_same()
> break
>
> which should perform better if the files are huge
>
> -tkc
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


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

Though that suffers if the files are large.  Might try

  CHUNK_SIZE = 4 * 1024 # read 4k chunks
  # chunk_offset = 0
  with open('f1.md5') as f1, open('f2.md5') as f2:
while True:
  c1 = f1.read(CHUNK_SIZE)
  c2 = f2.read(CHUNK_SIZE)
  if c1 or c2:
# chunk_offset += 1
if c1 != c2:
  not_the_same(c1, c2)
  # not_the_same(chunk_offset * CHUNK_SIZE, c1, c2)
  break
  else: # EOF
the_same()
break

which should perform better if the files are huge

-tkc



-- 
https://mail.python.org/mailman/listinfo/python-list


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').read()).hexdigest()
>> m2 = hashlib.sha224(open('f2').read()).hexdigest()
>
> I presume that the purpose of the exercise is to learn basic Python
> skills like looping.

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


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


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 = hashlib.sha224(open('f2').read()).hexdigest()

I presume that the purpose of the exercise is to learn basic Python skills 
like looping.

Also, using sha224 when all you want is a simple "different"/"equal" is 
horribly inefficient. Sha224 needs to read the entire file, every single 
byte, *and* perform a bunch of expensive cryptographic operations. Consider 
reading two five GB files, the first starting with byte \x30 and the second 
starting with byte \x60. The two bytes are different, so we know the files 
differ, but sha224 still needs to do a massive amount of work.



-- 
Steve

-- 
https://mail.python.org/mailman/listinfo/python-list


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 from joining the ‘tutor’
forum https://mail.python.org/mailman/listinfo/tutor>, which is
much better suited to collaborative teaching of newcomers.

-- 
 \ “As scarce as truth is, the supply has always been in excess of |
  `\   the demand.” —Josh Billings |
_o__)  |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list


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, ==  files do not  match
> 
> if length matchs, loop  while comparing each character from each
> file if they match. please tell me what i am doing wrong ?  i am
> using python 2.7
> 
> **
> hash1= open ("file1.md5", "r")
> line1 =hash1.read()
> hash2 = open("file2.md5","r")
> line2= hash2.read()
> 
> number1 = len(line1)
> number2 = len(line2)
> 
> #**
> 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", line1[i]," matchs"
>   i=i+1
>   count=count+1
>   else
>   print "Hash values corrupt"

Well, the immediate answer is that you don't update s1 or s2 inside
your loop.  Also, the indent on "count=count+1" is wrong.  Finally,
if the hashes don't match, you don't break out of your while loop.
That said, the pythonesque way of writing this would likely look
something much more like

  with open("file1.md5") as a, open("file2.md5") as b:
for s1, s2 in zip(a, b):
  if s1 != s2:
print("Files differ")

You can compare the strings to get the actual offset if you want, or
check the lengths if you really want a more verbatim translation of
your code:

  with open("file1.md5") as a, open("file2.md5") as b:
for s1, s2 in zip(a, b):
  if len(s1) != len(s2):
print("not the same size")
  else:
for i, (c1, c2) in enumerate(zip(s1, s2)):
  if c1 == c2:
print(" character %s matches" %  c1)
  else:
print(" %r and %r differ at position %i" % (s1, s2, i))

-tkc



-- 
https://mail.python.org/mailman/listinfo/python-list


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", line1[i]," matchs"
>   i=i+1
>   count=count+1
>   else
>   print "Hash values corrupt"

It looks like you're expecting s1 and s2 to automatically update their
values when i gets incremented, but it doesn't work like that.  When you
increment i, you also have to reassign s1 and s2.

-- 
John Gordon   A is for Amy, who fell down the stairs
gor...@panix.com  B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

-- 
https://mail.python.org/mailman/listinfo/python-list


new to python, help please !!

2015-11-11 Thread Anas Belemlih
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, ==  files do not  match

if length matchs, loop  while comparing each character from each file if they 
match. 
 please tell me what i am doing wrong ?  i am using python 2.7

**
hash1= open ("file1.md5", "r")
line1 =hash1.read()
hash2 = open("file2.md5","r")
line2= hash2.read()

number1 = len(line1)
number2 = len(line2)

#**
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", line1[i]," matchs"
i=i+1
count=count+1
else
print "Hash values corrupt"
-- 
https://mail.python.org/mailman/listinfo/python-list


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 are based on me streaming for over 2 years.

Anyways, I wasnt trying to cause trouble, 
i did post what happened when i ran the program. 
There was no traceback error,
Here is my post from 2 days ago:

Now in that directory in cmd, i type in python twitch.py 10 10. 
When i do this I get "thread error" posting infinitely down my cmd prompt. 
So it looks like the program is actually running now, just some im possibly 
missing? 
Once again I do have pip and livestreamer installed and the exact py file i 
have is located here:

http://www.mediafire.com/view/3m10s9rwvatxd96/twitch.py

Yes i do want it to work, and i would offer money to somebody who would
actually help me, if it helped me to make it work faster. 
Is there not one person that can help a guy out?

Mark
-- 
https://mail.python.org/mailman/listinfo/python-list


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 that the
> > > author has two-space tabs, and didn't notice a bug
> > > slipping in. I dunno.) Along the way, though, I learned
> > > that the script in question is entirely for generating
> > > fake twitch.tv viewers so as to get your stream
> > > highlighted fraudulently, so I'm rather less inclined to
> > > help. Got a legitimate use for this, or are you just
> > > trying to cheat your way to fame?
> > >
> > Thanks for the reply, the answer is yes and no, i already
> > have about 2400 followers and half mil views, i just
> > wanted to see if i could get it to work.
>
> That's like a serial spammer saying """I already have 2400
> spam bots and half a million victims but i just want to get
> my latest bot working for "academic" purposes only. *wink*"""
>
> Listen Mark, it's obvious you don't have any coding or
> debugging skills and all you want to do is employ this app
> for your own fraudulent purposes, so with that in mind:
>
> NO SOUP FOR YOU!
> --
> https://mail.python.org/mailman/listinfo/python-list
>

I'm kinda with Rick on this thread.  A guy walks along with a name like
markshizzle, offers $20 to make his 'thing' work, and proudly admits he
doesn't want to know how the program works, he just wants it to work.  I
don't think this is the right place for you markshizzle.  This is a place
for people who are interested in improving their python skills, and asking
question after they have done there best to learn on their own first.
$20?  .. as they used to say on "are you being served':   go boil your head

-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


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
> > slipping in. I dunno.) Along the way, though, I learned
> > that the script in question is entirely for generating
> > fake twitch.tv viewers so as to get your stream
> > highlighted fraudulently, so I'm rather less inclined to
> > help. Got a legitimate use for this, or are you just
> > trying to cheat your way to fame?
> > 
> Thanks for the reply, the answer is yes and no, i already
> have about 2400 followers and half mil views, i just
> wanted to see if i could get it to work.

That's like a serial spammer saying """I already have 2400
spam bots and half a million victims but i just want to get
my latest bot working for "academic" purposes only. *wink*"""

Listen Mark, it's obvious you don't have any coding or
debugging skills and all you want to do is employ this app
for your own fraudulent purposes, so with that in mind:

NO SOUP FOR YOU!
-- 
https://mail.python.org/mailman/listinfo/python-list


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 dollars for helping me.
> I just want to get this thing up and going.
> Ive posted where i am having trouble and got 2 replies talking about 
> spacing...
> and not fixing any issues or giving advice.

> Either that or somebody who thinks they might be able to help, can you plz 
> reply?

I believe you were given a suggestion by Steven on posting a traceback
Did you follow that?  (Genuine question!!)
Because if you did and it got lost in the characteristic 'GG-crap' you would
not know that it had been 'crapified' by GG and others would not know that
there was anything to read in the mess.

So... assuming youve understood the following:

1. Read and follow https://wiki.python.org/moin/GoogleGroupsPython
2. Read and follow Steven's advice on how to ask help especially regarding 
errors
3. Try to minimize external links to code especially small snippets

maybe best to just start a new thread???
-- 
https://mail.python.org/mailman/listinfo/python-list


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 posted where i am having trouble and got 2 replies talking about spacing...
and not fixing any issues or giving advice.

Either that or somebody who thinks they might be able to help, can you plz 
reply?

Thanks again

Mark
-- 
https://mail.python.org/mailman/listinfo/python-list


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 
> posting traceback messages.

Thats better -- thanks

You still need to go through
https://wiki.python.org/moin/GoogleGroupsPython

See the length of your "I am sorry..." line above
-- 
https://mail.python.org/mailman/listinfo/python-list


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 confusion, how to properly run the 
program while meeting the arguments. Thanks Frank for giving me a little hint 
at that. 

Now in that directory in cmd, i type in python twitch.py 10 10. When i do this 
I get "thread error" posting infinitely down my stream. So it looks like the 
program is actually running now, just some im possibly missing? Once again I do 
have pip and livestreamer installed and the exact py file i have is located 
here:
http://www.mediafire.com/view/3m10s9rwvatxd96/twitch.py

Once again thanks for help,

Mark
-- 
https://mail.python.org/mailman/listinfo/python-list


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 4 message in a row, within 15 minutes, each replying to the 
other, is not a good way to use a forum like this.  Get your thoughts in 
order and send one message.


2) While I am normally quite tolerant of the double-spacing Google 
Groups insists on, your messages are taking it to absurd extremes.  Take 
a look at your last message: 
https://mail.python.org/pipermail/python-list/2013-December/662678.html 
 True, it's kind of beautiful in an abstract way, and is an interesting 
demonstration of certain binary behaviors, but it is not a good way to 
participate here.


Of course, the messages you post are your choice, but you should 
consider the effect they have on the people you are hoping to get help from.


--
Ned Batchelder, http://nedbatchelder.com

--
https://mail.python.org/mailman/listinfo/python-list


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:


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:































































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. (Quite possibly indicates that the author has































































































































two-space tabs, and didn't notice a bug slipping in. I dunno.)































































































































































































































































Along the way, though, I learned that the script in question is































































































































entirely for generating fake twitch.tv viewers so as to get your































































































































stream highlighted fraudulently, so I'm rather less inclined to help.































































































































Got a legitimate use for this, or are you just trying to cheat your































































































































way to fame?































































































































































































































































ChrisA































































































































Thanks for the reply, the answer is yes and no, i already have about 2400 
followers and half mil views, i just wanted to see if i could get it to work.































































































































So after taking everybody's advice, fixed the indentation as mentioned by the 
expert above. :) After, this is what i came up with































































































































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 sure 
about how you would plug in those numbers































































































































okay so i kinda get it now, running it in cmd, i use the following command -































python twitch.py 10 10. I am running it within the scripts directory.










































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 haven't really been following this thread, but I assume you are on 
Windows.

If so, you can open a Command Prompt from All Programs/Accessories, 'cd' to 
the folder containing your script, and type in the script name.

It will start, crash, and display the error, but the window will stay open, 
so you will be able to read the full traceback.

Normally the traceback provides enough clues that you can figure out for 
yourself what the problem is. But if you still cannot solve it, copy/paste 
the entire traceback and send it here. The chances are that someone can 
help.

BTW, did you notice that I removed the bulk of your original message, and 
left behind just enough to provide a context for your question and for my 
reply? This is good etiquette, and others will appreciate your doing the 
same.

Frank Millman



-- 
https://mail.python.org/mailman/listinfo/python-list


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:
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 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 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. (Quite possibly indicates that the author has
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > > two-space tabs, and didn't notice a bug slipping in. I dunno.)
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > > Along the way, though, I learned that the script in question is
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > > entirely for generating fake twitch.tv viewers so as to get your
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 

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:
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 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 the
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > OP's fault at all. 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 slipping in. I dunno.)
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > Along the way, though, I learned that the script in question is
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > entirely for generating fake twitch.tv viewers so as to get your
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > stream highlighted fraudulently, so I'm rather less inclined to help.
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > Got a legitimate use for this, or are you just trying to cheat your
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > way to fame?
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > > ChrisA
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > Thanks for the reply, the answer is yes and no, i already have about 
> > > > 2400 followers and half mil views, i just wanted to see if i could get 
> > > > it to work.
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > So after taking everybody's advice, fixed the indentation as mentioned 
> > > > by the expert above. :) After, this is what i came up with
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 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 n

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:
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 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. (Quite possibly indicates that the author has
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > two-space tabs, and didn't notice a bug slipping in. I dunno.)
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > Along the way, though, I learned that the script in question is
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > entirely for generating fake twitch.tv viewers so as to get your
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > stream highlighted fraudulently, so I'm rather less inclined to help.
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > Got a legitimate use for this, or are you just trying to cheat your
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > way to fame?
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > > ChrisA
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > Thanks for the reply, the answer is yes and no, i already have about 2400 
> > > followers and half mil views, i just wanted to see if i could get it to 
> > > work.
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > So after taking everybody's advice, fixed the indentation as mentioned by 
> > > the expert above. :) After, this is what i came up with
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 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 sure about how you would plug in those numbers
> 
> > 
> 
> > > 
> 
> > 
> 
> > > >>>
> 
> > 
> 
> > 
> 
> > 
> 
> > okay so i kinda get it now, running it in cmd, i use the following command 
> > - 
> 
> > 
> 
> > python twitch.py 10 10. I am running it within the scripts directory.
> 
> > 
> 
> > 
> 
> > 
> 
> > I get the following error in cmd:
> 
> > 
> 
> > 
> 
> > 
> 
> > Syntax Error: invalid syntax
> 
> > 
> 
> > >>>python twitch.py 10 10
> 
> > 
> 
> >File " line 1
> 
> > 
> 
> >  python twitch.py 10 10
> 
> 
> 
> is there a more effecient way of doing this? I just hold shift and right 
> click to run cmd from the folder, 
> 
> 
> 
> File is located in C:\Python27\Scripts

It was my understanding that you need to meet the arguments by running the in 
cmd with the numbers after? I am sorry to show my true noobyness and really 
appreciate the help.
-- 
https://mail.python.org/mailman/listinfo/python-list


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
> 
> > 
> 
> > > 
> 
> > 
> 
> > >  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. (Quite possibly indicates that the author has
> 
> > 
> 
> > > 
> 
> > 
> 
> > > two-space tabs, and didn't notice a bug slipping in. I dunno.)
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > Along the way, though, I learned that the script in question is
> 
> > 
> 
> > > 
> 
> > 
> 
> > > entirely for generating fake twitch.tv viewers so as to get your
> 
> > 
> 
> > > 
> 
> > 
> 
> > > stream highlighted fraudulently, so I'm rather less inclined to help.
> 
> > 
> 
> > > 
> 
> > 
> 
> > > Got a legitimate use for this, or are you just trying to cheat your
> 
> > 
> 
> > > 
> 
> > 
> 
> > > way to fame?
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > 
> 
> > 
> 
> > > ChrisA
> 
> > 
> 
> > 
> 
> > 
> 
> > Thanks for the reply, the answer is yes and no, i already have about 2400 
> > followers and half mil views, i just wanted to see if i could get it to 
> > work.
> 
> > 
> 
> > 
> 
> > 
> 
> > So after taking everybody's advice, fixed the indentation as mentioned by 
> > the expert above. :) After, this is what i came up with
> 
> > 
> 
> > 
> 
> > 
> 
> > 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 
> > sure about how you would plug in those numbers
> 
> > 
> 
> > >>>
> 
> 
> 
> okay so i kinda get it now, running it in cmd, i use the following command - 
> 
> python twitch.py 10 10. I am running it within the scripts directory.
> 
> 
> 
> I get the following error in cmd:
> 
> 
> 
> Syntax Error: invalid syntax
> 
> >>>python twitch.py 10 10
> 
>File " line 1
> 
>  python twitch.py 10 10

is there a more effecient way of doing this? I just hold shift and right click 
to run cmd from the folder, 

File is located in C:\Python27\Scripts
-- 
https://mail.python.org/mailman/listinfo/python-list


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://mail.python.org/mailman/listinfo/python-list


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 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. (Quite possibly indicates that the author has
> 
> > 
> 
> > two-space tabs, and didn't notice a bug slipping in. I dunno.)
> 
> > 
> 
> > 
> 
> > 
> 
> > Along the way, though, I learned that the script in question is
> 
> > 
> 
> > entirely for generating fake twitch.tv viewers so as to get your
> 
> > 
> 
> > stream highlighted fraudulently, so I'm rather less inclined to help.
> 
> > 
> 
> > Got a legitimate use for this, or are you just trying to cheat your
> 
> > 
> 
> > way to fame?
> 
> > 
> 
> > 
> 
> > 
> 
> > ChrisA
> 
> 
> 
> Thanks for the reply, the answer is yes and no, i already have about 2400 
> followers and half mil views, i just wanted to see if i could get it to work.
> 
> 
> 
> So after taking everybody's advice, fixed the indentation as mentioned by the 
> expert above. :) After, this is what i came up with
> 
> 
> 
> 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 
> sure about how you would plug in those numbers
> 
> >>>

okay so i kinda get it now, running it in cmd, i use the following command - 
python twitch.py 10 10. I am running it within the scripts directory.

I get the following error in cmd:

Syntax Error: invalid syntax
>>>python twitch.py 10 10
   File " line 1
 python twitch.py 10 10
-- 
https://mail.python.org/mailman/listinfo/python-list


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 
> sure about how you would plug in those numbers

In Python, sys.argv is the arguments passed to the script. You need to
pass it some arguments when you run it.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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 the
> 
> OP's fault at all. 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 slipping in. I dunno.)
> 
> 
> 
> Along the way, though, I learned that the script in question is
> 
> entirely for generating fake twitch.tv viewers so as to get your
> 
> stream highlighted fraudulently, so I'm rather less inclined to help.
> 
> Got a legitimate use for this, or are you just trying to cheat your
> 
> way to fame?
> 
> 
> 
> ChrisA

Thanks for the reply, the answer is yes and no, i already have about 2400 
followers and half mil views, i just wanted to see if i could get it to work.

So after taking everybody's advice, fixed the indentation as mentioned by the 
expert above. :) After, this is what i came up with

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 sure 
about how you would plug in those numbers
>>> 
-- 
https://mail.python.org/mailman/listinfo/python-list


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. (Quite possibly indicates that the author has
two-space tabs, and didn't notice a bug slipping in. I dunno.)

Along the way, though, I learned that the script in question is
entirely for generating fake twitch.tv viewers so as to get your
stream highlighted fraudulently, so I'm rather less inclined to help.
Got a legitimate use for this, or are you just trying to cheat your
way to fame?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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 error 
message, starting from the Traceback line? This is *important*, please do 
not ignore it. If you're going to ask for help from experts, pay 
attention to what the experts tell you.

At this point, I recommend you download the script again, since you've 
been making modifications to it and have probably introduced your own 
errors. Better to start again with a fresh copy in a known good state, 
rather than one that you've been making arbitrary changes to:

Step 1: replace the modified version of the script with a known good copy.

Step 2: try running that script using the correct version of Python.

Step 3: if it fails in some way, copy and paste the entire traceback. It 
may be that you're using it wrongly.



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


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 ..." line underneath
it. For consistency with the rest of the file, indent the "output"
line to match the other. That should make it work.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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 experience in this, which is why i am looking 
> for help :) I am more worried about getting it to work then knowing whats 
> wrong, but it could also be helpful haha
> 
> 
> 
> Thanks
> 
> 
> 
> Mark

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

If anybody could correct this for me or provide some incite. i would be very 
grateful. If any of you would be available for some sort of chat to fix it, I 
would also love to do something like that. 

Thanks again

Mark
-- 
https://mail.python.org/mailman/listinfo/python-list


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 worried about getting it to work then knowing whats 
wrong, but it could also be helpful haha

Thanks

Mark
-- 
https://mail.python.org/mailman/listinfo/python-list


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 errors on line 19 and cant get it to
> work at all.

If you're getting the "not enough goats and chickens sacrificed error", 
sacrifice more goats and chickens.

(Hint - it would help if you told us what the error was, and displayed at 
least the line the error occurs on and the preceding 10 lines or so)

-- 
Denis McMahon, denismfmcma...@gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


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, but if you can't do that, try installing Python 2.

But more generally, when you get errors, it helps *hugely* to copy and
paste the error - don't just say "on line 19", and leave us to guess
what error you're getting :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


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. It is the top
> article.
> 
> http://www.ericzhang.me/
> 
> I have successfully installed python 3.3 for windows, 

Great! But what version of Python is that script written for?

[...]
> I get errors on line 19 and cant get it to work at all.

Errors plural? Multiple errors on one line? That's unusual.

Please copy and paste (don't summarise or re-type from memory) the entire 
traceback showing the full error you get. That is, copy and paste 
*everything* from the first line

Traceback (most recent call last)


all the way to the end of the error message.



-- 
Steven
-- 
https://mail.python.org/mailman/listinfo/python-list


New to Python, Help to get script working?

2013-12-14 Thread Mark
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. It is the top 
article.

http://www.ericzhang.me/

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 errors on line 19 and cant get it to work at all.

The included code is located here

https://gist.github.com/Xeroday/6468146/raw/1b7fb468551a4ba5b73ea3c0b7bc47591c3a8c51/Twitch.py


If anybody could provide some incite on how to get it to work, how the 
variables work, and such, I would be so grateful!

Mark
-- 
https://mail.python.org/mailman/listinfo/python-list


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
> >
> > Can anyone help?
> >
> > Thank you,
> >
> > J. T. Cook
>
> Did you install Python, or Pythonwin ?
>
> Cannot use #2 without #1.

He probably used ActivePython. It includes both. Besides PythonWin IDE
won't start without Python :-)

John:
Try this tutorial. It does not assume a programming background.
http://honors.montana.edu/~jjc/easytut/easytut/

You already started Python when you started PythonWin IDE. You won't
need to type python in it again :-)

In the tutorial I linked, PythonWin is analogous to IDLE (another IDE)
mentioned in it. You should also have IDLE installed in your menus.

-- 
http://mail.python.org/mailman/listinfo/python-list


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 is no name in the interpreter called python and it is
telling you that

Try this.
>>> python = "A cool language"
>>> python
'A cool language'
>>> dir()
['__builtins__', '__doc__', '__name__', 'python']
>>>

btw:  dir() is a way of getting the currently defined names
you could also try this - just to get a feel for the names

you can also request the names going down the heirarchy.

enter:
dir(__doc__)
and see what happens.

Happy Pythoning.

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,
> 
> J. T. Cook

-- 
http://mail.python.org/mailman/listinfo/python-list


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,
>
> J. T. Cook

That's because the Pythonwin IDE with the >>> prompt is already running
the Python interpreter.  The Python interpreter allows you to run
python statements and expressions with instant feedback.

Python doesn't define the 'python' name inside of itself.

I recommend that you read through the Python tutorial, and maybe do a
Google search for Python tutorials.

When you next see the >>> prompt, try typing in the following:
import this
print ' '.join( ('Python', 'rocks!') )

-- 
http://mail.python.org/mailman/listinfo/python-list


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,
> 
> J. T. Cook

Did you install Python, or Pythonwin ?

Cannot use #2 without #1.

Philippe

-- 
http://mail.python.org/mailman/listinfo/python-list


New to Python-- Help

2006-08-08 Thread John & Mary Cook
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,

J. T. Cook 


-- 
http://mail.python.org/mailman/listinfo/python-list