User Profile

Collapse

Profile Sidebar

Collapse
Dave Elfers
Dave Elfers
Last Activity: Sep 21 '11, 02:52 AM
Joined: Aug 14 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Yes, that is exactly what I was looking for. Thank you much!!
    See more | Go to post

    Leave a comment:


  • Create variable for each iteration of a for loop

    Hello, I am using a for loop to iterate through an array and need to assign each iteration to a new variable, such as

    Code:
    arr = ['bread', 'milk', 'cheese']
    for i in arr:
        print i
    but instead of printing i, I want the for lopp to assign each iteration to a unique variable, so that when the for loop completes

    Code:
    var1 = 'bread' 
    var2 = 'milk'
    var3 = 'cheese'
    ...
    See more | Go to post

  • Dave Elfers
    started a topic How to listen to serial port

    How to listen to serial port

    Hello,

    I need to write a script to listen to a serial port basically forever. The python script will be launched by another program and the input to the com port passed to the other program. As long as this other program is running, I need the python script to run and handle the com port traffic.

    I have this working (thats about it),

    Code:
    import serial
    from scala5 import sharedvars
    import
    ...
    See more | Go to post

  • Dave Elfers
    replied to Extracting XML Tag Names
    Thanks for pointing me this way, I am very new to this and never would have thought of it. Had to to change to
    Code:
    print child.toxml
    to get the tag name completely out of the dom element. Thanks again!
    See more | Go to post

    Leave a comment:


  • Dave Elfers
    started a topic Extracting XML Tag Names

    Extracting XML Tag Names

    Hello, I need to get the tag name from an XML file. I know where it is going to be everytime, but I do not know what the name will be. This is a snippet of my xml data.

    Code:
     
    <Forecast>
     <Config/>
     <Date>THU SEP 9 2010</Date>
     <Time>4:53 PM CDT</Time>
    <Thursday>
     <Conditions>Partly Cloudy</Conditions>
     <Description>Partly cloudy</Description>
    ...
    See more | Go to post

  • Dave Elfers
    replied to How can time be compared
    thank you sir. That did the trick!
    See more | Go to post

    Leave a comment:


  • Dave Elfers
    started a topic How can time be compared

    How can time be compared

    Hello,

    I am writing a script that is going to download and read XML data from a server. The server updates the xml data every 4 hours. Instead of downloading a new copy of the xml everytime the script runs, I want to look at the timestamp of the local file to see if it is less than 4 hours old. If it is, I will read the local copy, but if not I will download a new copy and read it. I can't seem to find any good way of doing this....
    See more | Go to post

  • Dave Elfers
    replied to cancellable timed loop
    Thank you sir, that did the trick!
    See more | Go to post

    Leave a comment:


  • Dave Elfers
    started a topic cancellable timed loop

    cancellable timed loop

    I am very new to python and programming in general and am trying to build a loop that can be cancelled when the timer ends or cancelled by a variable that will be set externally. I am testing with my code below and it doesn't want to cancel, like it never re-reads the variable to realize that it is no longer a 1. It seems like I am either really close or way off.

    Code:
    import threading
    scalavar = 1
    enable = 1
    def disable():
    ...
    See more | Go to post
No activity results to display
Show More
Working...