richieking 44 Master Poster

Well you can try this.

from __future__ import division

my_list=list(raw_input("enter number: ")) # you take the input from the user
avg=sum([int(x) for x in my_list])/len(my_list) 
print(avg)

#out Put
enter number: 1234
     2.5

hope it helps ;)

richieking 44 Master Poster

well you are always welcome buddy. i was once like you ;)

richieking 44 Master Poster

Look at this example. The if was not tested with True

word="The lazy fox jump over the fence"

word=word.split()
for x in word:
    if x:
      print x
print ("X now is finished, X is null or zero")

Just play around stuff you will get it ;)

richieking 44 Master Poster

The if will fail once the object is equal to 0/Null.

The logic is
1. you checked for a condition if it is True.
2. if the condition is not.... then branch.

To check for True condition with if... You do not repeat True as if default condition check is True. So repeating True again does not make any impact.
Hope you get it.
;)

richieking 44 Master Poster

Check your logic well.

Your code will not do waht you expects. Try something that takes real data as you will only have either True or false for the whole bunch .

Doesnt worth it.
Check it up again.
;)

richieking 44 Master Poster

What about if the python script not running???

I think you need a cron job. With cron job you are in win win situation for this operation.

;)

richieking 44 Master Poster

I am proud of you my goodfriend.

glad you made it.

Mark thread as solved and any upvoting is welcome.

richieking 44 Master Poster

You see, Daniweb is not for solving peoples problem. We share ideas. Sometimes people or new coders want solution but fails to learn how it is done.

Yes you got it working but do you undestand why it is working???? If you want to be a programmer, learn to understand why not how to.

mmmm ;)

richieking 44 Master Poster

I like personally the wx.FlexGridSizer than all the sizers.
with FlexGridSizer and the normal wx.BoxSizer you can make layouts that you realy desire.
;)

richieking 44 Master Poster

you can make a class that inherit both tkinter and wx.
with this you can have both world at your disposal.
;)

TrustyTony commented: Interesting idea! +2
richieking 44 Master Poster

Well python comes in handy

very straight forward ;)

richieking 44 Master Poster

No no no You are not doing what i just told you.

That should work 100%;

Please follow carefully.

1.yes you need 3 files for this.

how do you go about this.???

Read this.

1.you have your first form that will do the redirection with the php
header function based on success. This will redirect to redirect.php file.

2. on the redirect.php file, it must contain a full html snippet.
a.put the java script in the head as usual.
b. go to the body tag and on onload <body onload="function popup">
</body>
3. You must have the popup file created and must be referenced inside you javacsript function

This will do what you wanted. :)

richieking 44 Master Poster

Try this login page.

Just scribble some thing just now but should word fine.

myCon();//database connection
				  myDb(); //database selection
	// your work on post variables
	$uName=strip_tags(addslashes(trim($_POST['uName'])));
	$password=strip_tags(addslashes(trim($_POST['password'])));
	$remember=strip_tags(addslashes(trim($_POST['remember'])));
	$logIn=$_POST['logIn'];
	 $password=sha1($password);
	
	if($_GET['logout']==1){ // logout part
		session_unset();  // and unset session
		echo " You just logout";// logout notice
		header("location:/index.php"); //and direct to what ever page
	}
	
	
	        //Check for post array
			
			
	if($_POST){
		$count=0;
		          //DATABASE CONNECTION
				  
				  $query="SELECT * FROM register WHERE(UNAME='$uName' AND PASSWORD='$password' AND CONFIRM=1)";
				  $result=mysql_query($query) or die( mysql_error());
				  $row=mysql_fetch_array($result);
				     $_SESSION['regId']=$row['RED_ID']; // put id for future use
				  //CHECK EMPTY STUFF
		if(empty($uName) || empty($password)){
			echo "<div class='error' style='margin-left:120px;'>";
				echo "<h3>Oops error</h3>";
				echo "Please enter your user name and password.</div><br/><br/>";
			include_once("user-includes/logForm.php"); // form for entering username and password to login.
		}
		
		  
				
		elseif(!mysql_num_rows($result)){
		 // check if the use does not exists
		      	echo "<div class='error'style='margin-left:120px;'>";
				echo "<h3>Oops error</h3>";
				echo "Wrong user name and password.</div><br/><br/>";
				include_once("user-includes/logForm.php");
		      }
			  else{

// if the user exists, do this fo future use.
			  	session_regenerate_id();
				session_register($uName);
				$_SESSION['logIn']=1;
				$_SESSION['password']=$password;
				$_SESSION['uName']=$uName;
				
			  header("location:https://account.getcert.biz/account-login");//
locate to the user page.
			  }
                
		
		   
		   	   			
		
		
		
		
		
		
	}
	
	      else{
	      	include_once("user-includes/logForm.php");// log for should be the login form input where you enter username and password . 
	      }
richieking 44 Master Poster

You are welcome good friend

:)

abstrand commented: Great concise answer +0
richieking 44 Master Poster

Do you see that on line 8 and 9 you have 2 form tags . with a different actions.

psedo:

$query= "select * from foo"; table foo got id, name, 

$select=mysql_query($query) or die (mysql_error());// always do this

//Declare form tag here.

echo "<form action='#' name='form'>"; other form headers bla bla...
echo "<table style='width:60%;'>  "; // Table opening

// do the while loops here
while($row=mysql_fetch_array($select)){

  echo "<tr><td><input type='radio' name='radio[]' value=$row[name]> $row[name]</td><tr>";

}
echo "<input type='submit' name='submit' value='submit'>";
echo "</table></form>";

Pay attention to the input name radio[]; you need to iterate through to get the id for the fields you will need to update.

Hope you get the idea.

Explore :)