- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
10 Posted Topics
Re: there are ways to find the directory of the script, but if you are in the directory already and start the script then "open" should automatically look there anyway. Are you sure that's the name of the file and the upper and lower case match? Or if you're on windows … | |
Re: [url]http://matthewmarshall.org/projects/rabbyt/[/url] | |
Re: [code=python] for row in rows[1:]: print filter(len, row[1:6])[/code] [icode]rows[1:][/icode] skips row 0. The [icode]filter[/icode] looks at items 1 to 5 and filters out items with 0 length. It does the same thing as [icode][f for f in row[1:6] if f][/icode] but it's much nicer to read... output: ['N400'] ['N401', 'N402'] … | |
Re: [QUOTE=funkyfresh;859167]When I started with PHP, it was as simple as <?php print "Hello world"; ?>[/QUOTE] [code] import cgi print "Content-Type: text/html" print print "Hello world" [/code][url]http://docs.python.org/library/cgi.html[/url] [quote=funkfresh;859167]So my impression so far with Python on the web is that you need to use a pre-built framework in order to actually utilize … | |
Re: This post is sort of confusing, can you show an example? And what do you plan on doing with the list? | |
Re: [QUOTE=lorayyne;855450]Clarification: I can run the function itself successfully, but cannot import the coinflip function into a script and have it work-- it tells me 'random is not defined.[/QUOTE] what if you just do: test1.py [code] import random print random [/code] test2.py [code] import test1 [/code] | |
Re: [quote]Read on one site that using readlines() would make a txt.file a list, which would allow the use of rstrip(), but that doesn't seem to work for me either.[/quote] If you have a file object you can do readlines() to get a list in which item 0 is the first … | |
Re: [QUOTE=gotm;852370]Oh, and apparently my blocked function is not recursive? I thought it was, but it needs to be, so any help I'll take :) If not though that's fine too.[/QUOTE] You have a [i]return[/i] before the call to [i]blocked[/i]. A function always exits immediately when it reaches a return, skipping … | |
Re: [code] print>>f, '<a href="%s">%s</a> (%s)''' % (link.encode('UTF8', 'replace'), title.encode('UTF8','replace'), description.encode('UTF8','replace')) [/code] | |
Re: [QUOTE=daviddoria;848258]perl/python/bash/etc[/QUOTE] of these, I don't think there's any reason not to always choose python, unless you want to save space by not installing it or give scripts to people who don't have it. ![]() |
The End.