Re: [Tutor] most useful ide

2014-02-02 Thread scurvy scott
Hi Are there any recommendations for python ide's currently I am using idle, which seems pretty decent but am open to any suggestions cheers I personally prefer the Linux interpreter. Since you're asking. Scott On Sun, Feb 2, 2014 at 10:43 AM, Asokan Pichai wrote: > > > > On Sun, Feb 2, 2

Re: [Tutor] Code runs in interpreter but won't output to stdout

2014-02-01 Thread scurvy scott
is it? There is no explanation as to what it does or what I'd do with it! --dogehouse.org is a dogecoin mining pool that allows users to pool CPU/GPU resources to make mining cryptocurrency more efficient. Scurvy Scott: There's nothing really special about printing stuff, so there'

[Tutor] Code runs in interpreter but won't output to stdout

2014-01-29 Thread scurvy scott
Hi guys, I'm trying to figure out why my code won't output to terminal, but will run just fine in interpreter. I'm using python 2.7.3 on Debian Linux/Crunchbang. Here is my code. import requests from bs4 import BeautifulSoup as beautiful import sys def dogeScrape(username, password): payload

[Tutor] Can't figure out why I'm getting no output??

2014-01-28 Thread scurvy scott
Hey all.. First of all here is my code: import requests from bs4 import BeautifulSoup as beautiful payload = {'username': 'X', 'password': 'XX'} r = requests.post("http://dogehouse.org/index.php?page=login";, data=payload) soup = beautiful(r.text) confirmed = str(soup.findAll('span',{'cl

[Tutor] Generate word list from specified letters

2013-06-30 Thread Scurvy Scott
Hello all. I'm trying to create a program right now that will pull a dictionary from urban dictionary, then use that dictionary as the basis for generating words with specified letters. Maybe I'm not articulating that well enough.. I'm not at all sure where to start and any guidance would be hel

[Tutor] Guidance if possible

2013-04-11 Thread Scurvy Scott
Hello again wonderful python tutor mailing list. I've got I guess more of a broad question than is usually asked on this list and perhaps some of you might find it annoying, that's fine, if it's inappropriate feel free to say so. I want to start work on a new python project that would visit a spe

Re: [Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
argv[1] infile = sys.argv[2] outfile = sys.argv[3] main(mystring, infile, outfile) Look right to you? Looks okay to me, except maybe the three ORs in the information line, is there a more pythonic way to accomplish that task? Scott On Fri, Feb 1, 2013 at 8:31 PM, Scurvy Scott wrote: &g

Re: [Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
> Best practice is to check if your program is being run as a script before > doing anything. That way you can still import the module for testing or > similar: > > > def main(mystring, infile, outfile): ># do stuff here > > > if __name__ == '__main__': ># Running as a script. >import s

Re: [Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
One last question on this topic.. I'd like to call the files and the string form the command line like Python whatever.py STRINGTOSEARCH NEWFILE FILETOOPEN My understanding is that it would be accomplished as such import sys myString = sys.argv[1] filetoopen = sys.argv[2] newfile = sys.argv[3]

Re: [Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
> > Why not just use grep ? > Honestly this seemed like a good excuse to write some code and learn some stuff, secondly, it honestly just didn't dawn on me. Also, the code y'all both showed me was exactly what I was looking for and I'm planning on using Nicks code as a template to improve upon. A

[Tutor] Read from large text file, parse, find string, print string + line number to second text file.

2013-02-01 Thread Scurvy Scott
Hey all how're things? I'm hoping for some guidance on a problem I'm trying to work through. I know this has been previously covered on this list but I'm hoping it won't bother you guys to run through it again. My basic program I'm attempting to create is like this.. I want to read from a large,

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-19 Thread Scurvy Scott
[SNIP] Thank you guys so much, sorry for the delayed response. It's awesome being able to learn a thing or two from people who know so much about their craft. I've got the code working the way I envisioned it now and probably couldn't without y'alls help. I'm so glad this mailing list exists, tha

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
>> So here I extract out of your code (untested!) a generator which produces >> an infinite series of Fibonacci numbers, one at a time: >> >> def fib(): >> >> a, b = 0, 1 >> while True: >> yield b >> >> a, b = b, a+b >> >> >> This is untested, I may have got it wrong. >> >>

Re: [Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
On Tue, Jan 15, 2013 at 4:01 PM, Steven D'Aprano wrote: > On 16/01/13 10:40, Scurvy Scott wrote: > [...] > >> Anyways, the problem I'm having is I'm not really sure how to search a >> list >> for multiple elements and remove just those elements. Below i

[Tutor] Question regarding lists and manipulating items in lists.

2013-01-15 Thread Scurvy Scott
Hello guys, I'm using Ubuntu 12.10 and Python 2.7 right now. I'm working on code using the Mingus module but this question isn't specific to this module, per se. What I'm trying to do is to generate the fibonacci numbers up to a given N and then do modulo 12 on each number in order to create a lis

Re: [Tutor] How to run this block of code dozens of times

2012-09-16 Thread Scurvy Scott
Wow, thanks Dave, et al., for explaining things the way they did. I'm not trying to and apologize for top posting, gmail wasn't giving me the option of replying to all. I definitely understand what was going on and why when you all were explaining the code portions to me. _

Re: [Tutor] How to run this block of code dozens of times

2012-09-16 Thread Scurvy Scott
On Sun, Sep 16, 2012 at 5:23 PM, Dave Angel wrote: > On 09/16/2012 07:56 PM, Scurvy Scott wrote: > > scratch that, new code is below for your perusal: > > > > from Crypto.PublicKey import RSA > > import hashlib > > > > def repeat_a_lot(): > > co

Re: [Tutor] How to run this block of code dozens of times

2012-09-16 Thread Scurvy Scott
scratch that, new code is below for your perusal: from Crypto.PublicKey import RSA import hashlib def repeat_a_lot(): count = 0 while count < 20: m = RSA.generate(1024) b = hashlib.sha1() b.update(str(m)) a = b.hexdigest() print a[:16] + '.onion'

[Tutor] How to run this block of code dozens of times

2012-09-16 Thread Scurvy Scott
Hello all, I'm just wondering how to run this block of code X amount of times (a lot) and then store the ouput to a .txt file. The code I've written is below. from Crypto.PublicKey import RSA import hashlib m = RSA.generate(1024) b = hashlib.sha1() b.update(str(m)) a = b.hexdigest() print a[:16]

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Scurvy Scott
possible = "234567abcdefghijklmnopqrstuvwxyz" word_length = 16 print 'Running "every.py"' word_list = [] def add_word(word): if len(word)==word_length: word_list.append(word) print word else: for c in possible: new_word = word + c add_word(new

Re: [Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Scurvy Scott
> > That list would fill all the PC's on the planet a few billions times. > The number of items in the list has 25 digits in it. print 32**16 > > I actually should've specified that the list I'm trying to create would not start at say "0001". I'm attempting to generate all possible .on

[Tutor] All possible 16 character alphanumeric strings?

2012-09-15 Thread Scurvy Scott
Hello again python tutor list. I have what I see as a somewhat complicated problem which I have no idea where to begin. I'm hoping you fine folks can help me. I'm trying to generate a list of every possible 16 character string containing only 2-7 and a-z lowercase. I've seen some examples using re

[Tutor] List all possible 10digit number

2012-08-31 Thread Scurvy Scott
First of all thank you guys for all your help. The manual is really no substitute for having things explained in laymans terms as opposed to a technical manual. My question is this- I've been trying for a month to generate a list of all possible 10 digit numbers. I've googled, looked on stackov

[Tutor] Lambda?? Whaaaaat?

2012-08-30 Thread Scurvy Scott
I'm fairly new to python having recently completed LPTHW. While randomly reading stack overflow I've run into "lambda" but haven't seen an explanation of what that is, how it works, etc. Would anyone care to point me in the right direction? Thanks in advance Scott __

[Tutor] Resource question?

2012-08-14 Thread Scurvy Scott
Hello, I'm totally new to this list. I've been learning python through codecademy.com which has een helping a lot with it's step by step approach. I'm wondering if there are any others like it? I've been looking at some other places that attempt to teach python (google python course, code kata or