Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. kmarris

    For host in range - basic question!

    pinglist = [] for host in range(60,70): ip = "192.168.200."+str(host) pinglist.append(ip)
  2. kmarris

    How to use a loop to draw multiple objects

    You look to have an unmatched parenthesis in your second line of code, is that correct? Anyway, assuming your drawing code works, and the syntax is correct, I would say you are drawing the same circle 4 times. If you want a different circle each time, try to incorporate the variable i in the...
  3. kmarris

    Truncating a string

    var = 'testing(123)(234)' var.split('(')[0]
  4. kmarris

    Changing Path in Python

    import sys sys.path.append("/new/path") file("filename", "r") OR import os os.chdir("/new/path") file("filename", "r") OR file("/new/path/filename", "r")
  5. kmarris

    Using For in Python

    I think he wanted to print '24' rather than 'tmin1tmin2'. Here's one way to do it. for n in range (1,2): tmin1=10 tmin2=14 exec 'tasa = %s + %s' %('tmin' + str(n), 'tmin' + str(n+1)) print tasa
  6. kmarris

    shell script through Python

    Thanks for your reply. However, I was looking for a solution in line with the problem I presented. My requirements are that the Python script needs to execute a shell script to set environment variables. The environment variable list is dynamic, so I cannot simply set the variables on the...
  7. kmarris

    shell script through Python

    I have a LINUX bash shell script that sets environment variables. I need to execute this script through Python. I've tried to use os.system and subprocess.call, but each time, the shell script seems to modify the environment variables in a subshell and exits. How can I run a LINUX shell...
  8. kmarris

    How to use variables in an alias?

    Thanks for the replies everyone, but nothing has worked so far. The equal sign is not valid syntax for defining an alias in tcsh, so that did not help.
  9. kmarris

    How to use variables in an alias?

    Hi, feherke, I thought I mentioned I was using tcsh. I tried the syntax you provided, but I was unable to get it working in tcsh. Do you have a solution for my particular shell? Thanks.
  10. kmarris

    How to use variables in an alias?

    From the command line I can execute the following with success: ps | awk '{print $1}' It prints the first column of a ps listing as expected. However, if I bind this command to an alias, it does not handle the "$1" variable correctly. I've tried escaping the variable with a backslash, single...
  11. kmarris

    How to create hotkeys with Tk?

    Thanks, Feherke. That worked perfectly.
  12. kmarris

    How to create hotkeys with Tk?

    I know Perl, but I don't know Tk. I have a Perl script that someone else wrote. When it runs, there is a GUI with an Exit button. Rather than click the Exit button, I want to assign a keyboard shortcut to exit the GUI. Can someone tell me how to add this functionality to the Perl script?

Part and Inventory Search

Back
Top