@sa_2, on line 282 you mixed single quotes with double quotes. The syntax highlighting shows it right here:

cout<<'  \t\t¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥\n\n\n";

Next time start a new question, so more people can help you.

ddanbe commented: Nice +15

It's been a while since I messed with VB, but I can't find anything that sticks out as far as the overflow situation. It's hard to read anything the way you're building those queries. I'm pretty sure that they're prone to SQL injection anyway. Have you looked at prepared statements? So the user can't just enter 2016-22-13'); DROP TABLE Employee_Information; into txtDateOfHire?

Can you print some kind of stack trace, showing exactly where the error takes place?

I think it would help if you weren't shadowing the cosa name in your for loop. Classes should use CamelCase, to distinguish them from function names and other stuff. Instantiating a class is like calling a function, so if you are instantiating a Cosa, and not trying to call a Cosa instance (like in the loop), it should work. print(repr(cosa)) should tell you which you are dealing with.

Put the form on your page with an id (let's say 'contactForm') and css set to 'display: none', so it's easily accessible with javascript but initially hidden. Make your "show form" button/link/whatever with an onclick event (there are multiple ways to do this):

<a href='#contactForm' onclick='javascript: show_form();'>
    E-mail me.
</a>

Here is one way to implement show_form(). There are lots though. If you are already using some framework, they probably have a cross-browser way of doing this (such as jQuery's $('#contactForm').toggle() and $('#contactForm').css({'display': 'block'})):

function show_form() {
    var frm = document.getElementById('contactForm');
    frm.style.display = 'block';
}

Your cancel button will also need to be handled, so that clicking the button hides the form.

var cancelbtn = document.getElementById('cancel');
cancelbtn.onclick = function () {
    var frm = document.getElementById('contactForm');
    frm.style.display = 'none';
}

Here is an ugly jsfiddle displaying the behavior. I would suggest studying up on JavaScript if you're not already in the process.

tobyITguy commented: helpful. +3

What is the content and type of cfg.project["samples"][0]["files"]["bam"]? A Tuple/List/Set/Dict? Maybe stepping through a debugger, or even a simple debug-print would help you see what you are getting, or why you're not getting what you think you should.

testdata = cfg.project['samples'][0]['files']
print('Actual files content:')
print('{!r}'.format(testdata))

print('Actual bam content:')
print('{!r}'.format(testdata['bam']))

Also, there are a lot of lists being concatenated here, I guess to build up command-line arguments. Command line args are fickle at times, and could possibly be broken by the concatenation (or concatenating in a certain order). I'm reaching here, but it's possible.

This question is difficult to understand. I don't think the wall of output text helps. Maybe you could word it differently, or provide a little pseudo-code to help us understand what exactly you are trying to do?

What are the comparisons? A file?

What does "takes that to [metadata][phenotype][embryo]" mean? (what does "takes that to" mean in python?)

"samples -> files -> bam which is the input"..input to what?

A lot have people have viewed your question, but I think the wording is making it hard to help.

What is the actual problem? Is there a traceback when you run it? You say:

while p is less than the length of the list...

..which is basically describing what your code does. Can you give me a more general explanation? Like "I want to shift the ordinance of every character in a string."? I see some patterns here that can be shortened:

This:

n = 0
number = []
while n<8:
    random_number = chr(random.randint(33, 126))
    print(random_number)
    n = n + 1
    characters = ord(random_number)
    number.append(characters)

Could be written much cleaner as (untested):

# A list of 8 random character ordinances (numbers)
numbers = [random.randint(33, 126) for _ in range(8)]

Which is also easy to work with when building strings or whatever:

# That same list converted to characters
actualchars = [chr(n) for n in numbers]

# That character list as a string.
actualstring = ''.join(actualchars)

# All in one go (using a generator)
randomstring = ''.join((chr(random.randint(33, 126)) for _ in range(8)))

It's a much shorter version of this for-loop:

numbers = []
for _ in range(8):
    numbers.append(random.randint(33, 126))

This way you don't have to do so much bookkeeping. Also, there is no reason to go from int -> chr -> ord (line #15 and #21), because ord(chr(47)) == 47. Python is good at list comprehensions and generators, so there is no reason to build a simple list like this with a while loop (for more complicated processing, maybe, but …

I can only find python-based "watermark" plugins at the moment. You may have to make one. The PIL or pillow libraries can help you work with images. Outside of GIMP, I see the StegHide application recommended for this.

Small typo in that example, the font name. Should be 'Times New Roman'

I see that your __init__ method is misspelled, but you're gonna want an instance to work with. You have a calculating class, but no object. Instantiate the class:

mycalc = calculating()

...then use the method (mycalc.addition). Also, its good practice in python for classes to start with a capital letter. So calculating should be called Calculating instead.

enumerate() is great for grabbing an index and item at the same time, and f.tell() can tell you the current position in the file:

for i, line in enumerate(file):
    print('{lineno} ({pos}): {line}'.format(
        lineno=i + 1, 
        pos=file.tell(), 
        line=line))

just type it out. Put a blank line before the code, make sure all of the code lines are indented with 4 spaces.

# I did not use the </>Code button.
print('Hello World.')

You can also use the tilde character (`) to do "inline code" such as this: int c = 5; ...for when you don't need a whole block.

Indention level matters in Python. I see you assign s in main(), but the code following that is actually outside of main() because of it's indention level. In other words, this:

#main function
def main(self):

    s = Set([0, 1, 2, 3, 4])
print
"The elements in the set are : ",

# Ask the user to enter the element to be added
n = input('Enter the element to add to the set: ')

#calling method to add the element
valid = s.addElement(n)
# ... All code for main() below this too..

Needs to be this:

#main function
def main(self):
    s = Set([0, 1, 2, 3, 4])
    print "The elements in the set are : ",

    # Ask the user to enter the element to be added
    n = input('Enter the element to add to the set: ')

    #calling method to add the element
    valid = s.addElement(n)
    # ... All code for main() below this too..

So you were accessing s before main() was even called (during definition on file load). Also notice how I put the print statement all on one line. This will print a blank line:

print
"Hello",

This will print "Hello " (a space is added because of the ,):

print "Hello",

When you separate the lines like that, "Hello", is not part of the print statement. It is evaluated and the result is thrown away. print statements should be on the same line, or if you really have …

Sounds like homework. If you post what you have tried so far I'm sure you would receive the help you are looking for.

@vegaseat, from the Python doc page for multiprocessing:

It runs on both Unix and Windows.

It's stdlib stuff so I assumed it was cross-platform, but to be honest I've never tested it on Windows.

I see on the doc page that there are some differences with spawn and fork in the multiprocessing API itself. Windows has spawn and fork, but uses spawn by default. Unix only has fork pre Python 3.4, and it uses fork by default. Support for spawn was added in 3.4. I see no differences in the Process API, which by the way is compatible with the Thread API (awesome).

I would refer to the API documentation for DataResult<fmd>. I'm sure there are methods to help you retrieve the images it captures. I'm not sure which SDK you are using, and the DigitalPersona documentation (which I think you may be using) requires that you purchase support.

DigitalPersona does have a SerializeXml method, which is database-friendly and allows you to recreate the images for verification after saving them.

You could also do this with a Process.

import functools
import multiprocessing
def background(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        p = multiprocessing.Process(target=func, args=args, kwargs=kwargs)
        p.start()
    return wrapper

Also, I wanted to point something out for new people that may be reading this. I think it's a good practice to use the functools.wraps decorator when making things like this.

Example:

def decoratorwithout(f):
    def wrapper():
        return f()
    return wrapper

def decoratorwith(f):
    @functools.wraps(f)
    def wrapper():
        return f()
    return wrapper

@decoratorwithout
def myfuncwithout():
    """ You can't see this with help() or other tools. """
    return None

@decoratorwith
def myfuncwith():
    """ This is correct documentation. """
    return None

Checking the docs:

help(myfuncwith)

Help on function myfuncwith in module __main__:

myfuncwith()
    This is correct documentation.

And the function without functools.wraps:

help(myfuncwithout)

Help on function wrapper in module __main__:

wrapper()

functools.wraps sets the __doc__ and other things to help avoid confusion when wrapping functions.

print(myfuncwithout.__name__)
wrapper

print(myfuncwith.__name__)
myfuncwith

@snippsat, you're right about that JavaScript bit. I don't know what I was thinking. I guess if you were trying to do some validation on the client side, besides what the inputs already check, you might need it.

You could look at making a cgi script, but I don't recommend it. You should look into HTML/JavaScript and AJAX/Forms, and make a Python backend like Flask, Django, or Bottle.

Basically you have a Python app running server-side, that accepts a GET or POST request. A GET request would look like:

http://yoursite.com/?userinput="blah blah"

You need some JavaScript to get the value from your input box. You put the value in some POST data ({userinput: $('#userbox').val()}), or a GET request, send it off from the browser and from there your server app handles it. You'll have to look at the differences between GET and POST. They each have their pros and cons.

In django the view could be as simple as:

def view_helloworld(request):
    userinput = request.REQUEST.get('userinput', None)
    if userinput:
        return HttpResponse('User said: {}'.format(userinput))
    else:
        return HttpResponse('No data!', status=500)

Of course I haven't even mentioned the templating systems available, error handling, or anything else that comes with some of Python's awesome web frameworks.

I use jQuery for AJAX because it simplifies the cross-browser problems. Django has CSRF protection, so you also have to grab the value from the csrftoken cookie and send it along with the data.

I am simplifying things. There is actually a lot more to it. Too much for me to put in a daniweb comment. …

This is an old post, but I didn't see any translation tables in here. So here you go, a less secure encryption method for low-risk data:

rot13 = str.maketrans(
    'ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz',
    'NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm')
encrypted = 'This is encrypted'.translate(rot13)
print(encrypted)
decrypted = encrypted.translate(rot13)
print(decrypted)

You can make the translation tables almost anything you want. I used rot13 as an example. I wouldn't recommend something like this for high-risk data.

Line 28:

if(overnightCheck >= 0 && overnightCheck <= 1)
      {
         if(overnightCheck == 1)
            overnightPrice = 5.00;
      }

That wrapper to make sure overnightCheck is 1 or 0 is pointless. Because you are checking it again just below, and then doing nothing for the false case. What happens if a user enters 2,3, or 5 in this:

if (overnightCheck == 1) {
    overnightPrice = 5.00;
}

Nothing. So, they have to enter 1 for the price to be set. The extra guard is redundant.

If libraries aren't allowed, you could make your own Counter.

words = ['this', 'this', 'that', 'that', 'that', 'and']
wordcount = {}
for word in words:
    existing = wordcount.get(word, 0)
    wordcount[word] = existing + 1

wordcountlist = []
for word, count in wordcount.items():
    wordcountlist.extend((word, count))

print(repr(wordcountlist))
# ['this', 2, 'that', 3, 'and', 1]

Of course, there are libraries that would simplify this too..

from collections import defaultdict
wordcount = defaultdict(int)
for word in words:
    wordcount[word] += 1

Anyway, I think there are some good answers here no matter what the constraints are on the problem. Plenty to choose from. :)

There is also collections.Counter.

from collections import Counter
wordcount = Counter(['this', 'this', 'that', 'that', 'that', 'and'])
print(repr(wordcount))
# Reveals:
# {'this': 3, 'that': 2, 'and': 1}

Not only is it easy, but I'm pretty sure it performs better (coded in C).
If you really wanted it in list format you could do this to it:

wordcountlist = []
for word, count in wordcount.items():
    wordcountlist.extend((word, count))

Or you could combine the two:

words = ['this', 'this', 'that', 'that', 'that', 'and']
wordcountlist = []
for word, count in Counter(words).items():
    wordcountlist.extend((word, count))

The order may be off, because of the Counter converting to dict. Honestly, if you are going to be retrieving the counts in the future, a dict may be better anyway. Retrieving the count would just be: wordcount['this'] or wordcount[myword]. ..instead of having to construct your own for-loop to retrieve/parse the counts.

Ok, thanks Dani and pritaeas.

You have an event loop up at the top (while done==False:) that runs until the user has quit. Because of the indention, your event loop runs until completion and only then draws what you wanted it to. Your indention signifies a 'code block'.Everything in that code block will run until the code block is exited. Right now only a portion of your code is inside of the event loop. The rest of it (the important part) is outside of the code block, and doesn't run until the event loop completes. By indenting all of your logic and draw-events to the same level as the while block I was able to make your game run.

Example:

done = False
while not done:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            print('User has exited!')
            done = True

    print('We are inside of the event loop, press CTRL + C!')

print('We are outside of the event loop.')
print('Now is not a good time to start drawing stuff.')

'Tutorials' and 'Snippets' came later right? So 'Unanswered' used to be exactly what I am talking about. 'Unanswered' does exactly what it's supposed to do and shows all unanswered posts, so with the new additions maybe it's time for a new kind of 'Unanswered'?

I think Snippets and Tutorials should be excluded from 'Unanswered', or a new section should be created called 'Open Questions' that doesn't include snippets and tutorials. Most of the snippets/tutorials don't receive an answer for a long time and they cloud the view when looking for a quick question to answer/solve.

..just my two cents. :)

I like this. I modified it so the function name would be included with frame.f_code.co_name.

There is a possibility that the python executable is not in /usr/bin on other people's systems. It could be in /usr/local/bin, /home/otheruser/.local/bin, or anywhere else. Without the env, you are telling it exactly which executable to use.

env will use the system's $PATH to determine where python is. There is also a possibility the env executable isn't really in /usr/bin, but that's a slim chance.

Long story short, if you are writing for only yourself and your machine, you can use whatever you want. I think it's a good practice to use #!/usr/bin/env python if you are distributing your scripts.

when you write a view function, it must have a request parameter (try writing one without it). This is because Django automatically passes the HttpRequest() to your view so you can use it. You don't have to use it, I have plenty of views that do absolutely nothing with the request (not on my part anyway). Django is instantiating the HttpRequest(), not you.

It lets you do things like this (not tested):

def my_search_view(request):

    # Retrieve GET/POST argument from http request
    GET_arg1 = request.REQUEST.get('search_query', None)

    # Validate arguments
    if GET_arg1 is None:
        # No argument found, tell the user
        response = HttpResponse("No search argument given!")
    else:    
        # Use the argument we found to do something.
        response = HttpResponse("You are searching for: " + GET_arg1)

    return response

The request has alot of useful information in it like request.POST, request.GET, request.REQUEST (GET and POST combined), request.META (useful info about the request). I think Django needs to use the request itself anyway, so passing it to you is just a convenience. Just one of the many "magic" things Django does for you. I hope this helps.

Here, I booted into Windows (windows 8, i'll check windows 7 just to be sure though). This little script writes a simple text file to user directories using both the os.path.expanduser method, and the ALLUSERSPROFILE method. Both seem to work fine for me.

""" testuserdir.py
    Trys two different methods for writing a simple logfile to
    user directories in Windows.
"""

import sys, os, os.path

# short name for the test log.
short_filename = "testlog.txt"

def test_write(homedir):
    """ Trys to write sample text to a file """
    logfile = os.path.join(homedir, short_filename)
    print "Writing " + logfile
    try:
        with open(logfile, 'w') as flog:
            flog.write("Testing log file...\n")
    except (IOError, OSError) as exio:
        print "Unable to write file: " + logfile + '\n' + \
              str(exio)
        return False
    return True


def test_read(homedir):
    """ Trys to read from the sample file """
    logfile = os.path.join(homedir, short_filename)
    # Check the file
    print "Checking the file..."
    if os.path.isfile(logfile):
        print "    File contents:"
        try:
            with open(logfile) as flog:
                print '    ' + flog.read()
                return True
        except (OSError, IOError) as exio:
            print "Unable to read file: " + logfile + '\n' + \
                  str(exio)
    else:
        print "File did not exist!: " + logfile

    return False

def test_remove(homedir):
    """ Try to remove the test file """
    logfile = os.path.join(homedir, short_filename)
    if os.path.isfile(logfile):
        try:
            os.remove(logfile)
            print "Test file removed: " + logfile
            return True
        except (IOError, OSError) as exio:
            print "Unable to remove file:" + logfile + '\n' + \
                  str(exio)
    else:
        print "File doesn't exist!: " + logfile
    return …

I see that you are overwriting the LOG_FILENAME variable. Instead of adding "log.txt" to it, you are replacing it with "log.txt". That would make it write to the desktop I think. Try doing this instead (After getting the user's home directory):

LOG_FILENAME = os.path.join(homedir, "log.txt")
# returns: C:\Users\USERNAME\log.txt
# instead of just "log.txt"

At the very least you would have to "add" or "append" the filename to the users directory like this:

LOG_FILENAME = homedir + "log.txt"

But the os.path.join() method accounts for extra '/' or '\', which is why I use os.path.join where applicable.

It seems you've got your answer at SO.

Just thought I would add my 2 cents. IDLE is my 'goto' for small scripts and quick prototyping/testing. If it's not that then its 'Kate' (kde's text editor for programmers, a gnome equivalent would be gEdit).

But for bigger projects, like my Django site that has like 78 modules (due to the way django works), I use Eclipse or Aptana (Eclipse-fork) with the PyDev installed. It has auto-completion and git-integration.

I'm rarely on Windows anymore, but when I am I use PyScripter.

Sorry man, I guess I don't have enough info. It's easier when its on my machine and I can debug it myself. But anyway, errors like these usually happen when you try to run your Django app outside of Django's 'environment', which is why people are telling you to set the DJANGO_SETTINGS_MODULE variable. I also use aptana to build my website, which is a Django app. I don't really "run" or test my app with Aptana though. I use the command line and a browser.

Go to your terminal, change directory to wherever your manage.py is. When you run manage.py it will 'automagically' set up your sys.path and the DJANGO_SETTINGS_MODULE. If manage.py works then it's definately something to do with the way you are running your app under normal circumstances. Try some of these:

python manage.py validate
# catches easy errors in your models and other stuff

python manage.py syncdb
# this converts your python models to database tables, and also sets up django's
# own tables. Doing this when your model isn't ready may cause you a bit of a headache,
# depending on how good you are with your database, and what kind of database it is.
# (changing an SQLite table's columns was troublesome for me, even trying 'south' to migrate.
#  ...when I switched to PostgreSQL, the headaches went away.)

python manage.py shell
# django-friendly python interpreter, you can test code here
# and access your models by importing them:
# from myappname.models import mymodelname …
TrustyTony commented: Nice to have one Django person here +12

I just wanted to show the basic usage of docopt, a module that makes parsing command-line arguments so much easier. I'm not affiliated with the creators of docopt, but I'm certainly thankful for their work and happy to post this little snippet. I will point you to docopt.org for more information because there is so much more you can do with this module, that I'm not showing you here. Watch the video, it was an eye-opener for me. Also, if you'd like to install docopt you can go to their github repo to download and install it.

Try running this script in different ways to see the results, any invalid arguments will kick the user out to a Usage message (which also happens to be the way docopt recognizes valid or invalid arguments, awesome). The -h and --help flags are automagically recognized and used, so no code for them needs to be written:

./docopt_example.py -h
./docopt_example.py myrequiredargument
./docopt_example.py myrequiredargument -f
./docopt_example.py myrepeatingarg1 myrepeatingarg2 myrepeatingarg3

Some providers allow you to zip it up, although some will see the exe inside the zip. There are other packaging formats that may work (tar, rar, gz, etc.). Some times just changing the file extension works, though you would have to tell your brother to change it back. I guess what I'm getting at is you may have to 'trick' the provider if you really want to use email to get it there.

But honestly, when I run into something like this because of file extensions, or size, I upload the file to my site, or some other site, and just point my friends to the link.

Sorry to clutter this question with even more long code, but this is a script I wrote to check modules/classes for builtin conflicts. It searches the current directory for modules or can be used on other directories by adding to sys.path.

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys

def main(argz):
    addsyspath = argz[1] if len(argz) > 1 else None
    moduleorclass = argz[0][:-3] if argz[0].endswith(".py") else argz[0]

    print "current dir: " + sys.path[0]
    if addsyspath is not None:
        print "adding sys path: " + str(addsyspath)
    shortname = moduleorclass.split('.')[-1]
    print "checking: " + shortname + '\n'

    # retrieve list of conflicts
    try:
        conflicts = runtest(moduleorclass, addsyspath)
        # print results
        if len(conflicts) == 0:
            print "no conflicts found."
        else:
            print "found " + str(len(conflicts)) + " conflicts:"
            print "    " + "\n    ".join(conflicts) + '\n'
    except Exception as ex:
        print "error checking: " + shortname + '\n' + str(ex)
        return 1
    # success
    print "finished.\n"
    return 0

def runtest(module_name, new_syspath=None):
    """ module_name : (string) Full module name or class to import ("mymodule.submodule.classname")
        new_syspath : (string) Path to add to sys.path (/path/to/module)

        Imports a module by string name, inserts syspath if wanted, and does getconflicts() on it.
    """

    # add python path (if it was passed)
    if new_syspath is not None:
        sys.path.insert(0, new_syspath)

    # trim .py extension (if it wasn't already)
    if module_name.endswith(".py"): module_name = module_name[:-3]

    # import module to check builtins.
    exec("import " + module_name)
    imp_ = eval(module_name)
    # test conflicts and return them
    return getconflicts(imp_)


def getconflicts(module_class):
   """ runs …

They are awesome. I have two of them. The pi pins aren't protected as good as the arduino, so I set up my arduino to listen for commands on the serial port, and the pi sends commands to it using a python script and the serial library. I can change the whole behavior of the arduino by loading different python scripts on the pi. The possibilities are endless with the pi anyway, but I felt better testing stuff out through the arduino. (I waited months for my first pi to come, I can pick up an arduino less than a mile from my house.)

i saw a typo in your code. if its just from your post then I understand. typo:

 def stop(self):
        active_queues.remove(self.mialbox) # <-- MIALBOX on stop function instead of MAILBOX
        self.mailbox.put("shutdown")

Not sure exactly what you're going for, but this is one way using xml.etree.ElementTree:

import xml.etree.ElementTree as etree
tree = etree.parse('My_XML_File.xml')
for node in tree.getiterator():
    if 'MessageId' in node.tag or 'ContentTitleText' in node.tag:
        #     (tagname)         (data)
        print node.tag + ': ' + node.text

one thing that i do to trim code down a little is leave out the == or != when i know I will be dealing with small integers, like:

if proc.poll():
    # non-zero return from process equates to true
    print("failure")
else:
    # zero return from process equates to false
    print("success")

i've also been using the 'with' statement when dealing with files, maybe not as important on such a small script, but i like it anyway.

try:
    with open('/var/www/ServerOverview.txt', 'a') as Log:
        Log.write('some stuff')
        # file is closed at the end of 'with'
except IOError as exOS:
    # unable to open file, disk is full, file not found, etc.
    print("Unable to open file.")
TrustyTony commented: try..except good suggestion +12

you said python right?

while (something < otherthing):
    [do this stuff]
    [down here]

and case switches become if, elif, & else.

if (data):
    [do something with data]
elif (timeout):
    [do something if timed out]
else:
    # no data, no timeout, what do we do?
    [do something else]

...no offense, i know not everyone is a python programmer, but this reminds me of that joke about how to get curly braces in python..

if (x): #{
    [do something]
#}
else: #{
    [nevermind]
#}

(they're comments)

no module named DailyExpenses, pretty much means what it says. Something is definately wrong with one of the script names/locations. You have DailyExpenses.py or .pyc in the same folder as DailyExpensessave.py ? Not in a subfolder or anything?

That is a copy/paste copyright/warning that I put into any whole-project I release publicly, I realize that it doesn't do much for me but I do like the warning it gives about damage or harm. Anything I post on DaniWeb is for the cause, for education, entertainment, utility, or other purposes, for everyone. If i want to keep something for myself, or protect the source, I take other measures and I definately would not be posting it in a forum such as this, with code wide-open.

I started using Python a few weeks ago, something finally clicked and I started writing tools for my personal use. I started writing something with a GUI using GTK and the code lines started multiplying rapidly, so I thought to myself "Am I commenting my source to death? How many comments do I have?". Since I'm new to the language I wasn't really sure if I was going about everything the right way. At the time I had never heard of pycount or CLOC, I just found out about those two today after a google search. I think the authors of those tools had the same idea, before me ofcourse. My script counts code lines, blank lines, and comments, but it also counts inline-comments, imports , variables, variable assignments, classes, functions, if / try / & print statements, and reports the count or percentage of each. It also has the ability to list all imports in a script, plus the ability to list all variables in a script in the order of discovery, or alphabetical order. That can be accomplished by passing the -v or -i flag on the command-line. There are a few short comings which are explained on my site and in the comments, like Doc Strings and multiple variable assignments on the same line. But for most projects it's dead on. I don't want to say too much, you can visit my site for more info. Here is what the default basic output looks like …

TrustyTony commented: Reasonable effort +12

I don't know if this will help you or not, but I know Python is possible on the iPhone because I have it. I had to jailbreak my iPhone, and download Python from Cydia. It works well for command-line stuff, but as far as making a program with a GUI I don't know. If it's possible on iPhone then iPad wouldn't be so far fetched I think.

I'm not exactly sure what you meant by this question. But from what I've gathered I wrote this bit of code. I hope it helps you.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'I'm adding these items to the listbox, i don't know what YOUR items are.
        '...but I'm going to use these.
        '...Since you know what your items are, you could skip this whole procedure...
        Dim sListItems As String() = {"Internet Explorer", "Registry Editor", "Notepad"}
        ListBox1.Items.AddRange(sListItems)

    End Sub


    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        'Don't do anything if no items are selected because we will get an error if we do.
        If ListBox1.SelectedIndex < 0 Then Exit Sub

        'Get currently selected item's text
        '...I assume you are not allowing multi-select, so we will just get the first item selected
        Dim sItem As String = ListBox1.Items.Item(ListBox1.SelectedIndex)

        'Which item was selected? we'll see by its text.
        Select Case LCase(sItem)
            Case "internet explorer"
                'You said: "if a list is containing notepad than by clicking on the button it should open the notepad"
                '...so let's "open" it.
                'Internet Explorer Item was selected. Let's open Internet Explorer...
                Shell("C:\Program Files (x86)\Internet Explorer\iexplore.exe", AppWinStyle.NormalFocus)
                'You said: "by a single click on one of the item it should be written on the button"
                '...so let's "write it on the button"?
                Button1.Text = sItem
            Case "registry editor"
                'You said: "if a list is containing notepad than by clicking on the button it should …

Ok, I commented this code to DEATH, and made my Variable Names very long and descriptive. (It's better to keep them short and save typing I think) I'm pretty sure i've made it sound more complicated than it really is, I'm not one to write tutorials. Anyway, if you collapse all the comments the code will be easier to read, and you can read the comments only when you need to. I hope this helps you, I'm afraid I can't explain it any better than this. The main thing is Navigating String Arrays, IO.Directory Object, and Image Object. If you want to know more maybe you could look up those terms using google or something.
1) Get all file names in my Directory
2) Store them in a String Array
3) Update the position in that String Array when the user clicks Button1
4) Store the current position
5) Load image from filename found in String Array at current position
6) Assign our loaded image to PictureBox1.Image property

Public Class Form1
    'This is what directory you want to look for pictures in.. 
    '  ...I set it to the \My Pictures\ directory because most people store pictures there
    '  ...you can set sPictureDirectory to where ever you store your pictures...
    Dim sPictureDirectory As String = My.Computer.FileSystem.SpecialDirectories.MyPictures 
    'This is a String Array containing all files in the My Picture directory (sPictureDirectory)
    '  ...it will be used for initial storing of filenames,and  cycling thru pictures.
    '  It Holds:   sPictureFiles(0) = "c:\myfirstpicture_inthisdirectory.jpg"
    ' …
Unhnd_Exception commented: Great coding and excellent commenting. +9