richieking 44 Master Poster

I will replace C# with C++ and java with python.

C++ and python are taking the PL. Expecialy Java is sucking nowadays since it take you too much typing for a simple stuff in python.

well thats my take ;)

richieking 44 Master Poster

Meaning random_str() inside the method generate_salt() is not defined

just write

return random()
richieking 44 Master Poster

You can checkup mysql multiple selct query from mysql website.
1.left join
2. inner join
3.right join

richieking 44 Master Poster

You need to set the option value.

example

<select name="foo">
<option value="bar">Bar</option>
<option value="thegecho">Thegecho</option>
</select>

That is it buddy ;)

richieking 44 Master Poster

you need a regular expression to take what you need. The next thing is how you get the file to do so. I really dont know how php can do screen scrapping. cgi's is very simple. Thus python or perl .

try php curl functions ok.?
;)

richieking 44 Master Poster

You need a pagination script.

Your style will not work since mysql does not know the next record to show.

;)

richieking 44 Master Poster

You are welcome.

just make 2 panels.
say pan1 and pan2

pan1=wx.Panel(self,-1)
pan2=wx.panel(pan1,-1)

That is it
;)

richieking 44 Master Poster

having a while loop besides the main loop in a GUI is not advisable as it can cause a freeze.

Why not simply have use to menu event tool to update the casscading menu and increase by foo += 1 or foo -=1. Push the newly created into list/dict or even a conf file and update from the list/dic/file inside the menu event method....
That is my take

;)

richieking 44 Master Poster

bizare

richieking 44 Master Poster

Associate you guesture with the top/main panel. Example.

pan1=wx.panel(self,-1)
pan2=wx.panel(self,-1)

#Now the buttons and other stuffs on pan2.
#make pan2  inherit pan1 as the parent.
#Associate the gusture on the pan1

That will fix it buddy ;)
richieking 44 Master Poster

home works home works

richieking 44 Master Poster

easy tonyjv easy tonyjv .

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

You must also have locales for chinese install on your system
;)

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

Try and have a good around in the other threads. This has been done myriad times.

richieking 44 Master Poster

Post your code please ;)

richieking 44 Master Poster

Start reading python ftp lib.

Connect via ftp then you get access to the remote system.
bingo ;)

richieking 44 Master Poster

Why upgrade if 2x does the job fine.

good things come to those who wait. ;)

richieking 44 Master Poster

There a re several ways.

I think the most easy and accurate is the wx.Timer() method.
Very simple and handy.

eg:

timer=wx.Timer(parent,-1)

# Then you use the 

timer.Stop()
#or 
timer.Start()

## In your events method.

check it out ;)

richieking 44 Master Poster

Wooo Slate and tonyjv are really complex

Infact the pseudo of slate is flawless but will a newbie understand the algos.?

I just wrote this as a step by step to the solution. I real life, i advice you to use Slate's example.

labyrinth = \
[[0,0,0,0,0,0,1,0],
[0,1,0,1,1,1,1,0],
[0,1,1,1,0,1,0,0],
[0,1,0,0,0,0,0,0],
[0,1,1,0,1,1,1,0],
[0,0,1,1,1,0,0,0],
[0,1,1,0,1,1,1,0],
[0,1,0,0,0,0,0,0]]

de=0
for x in labyrinth:
	for y in x:
		de=de+1
		if y == 0:
			print '##',
		else:
			print ".",
		if de == 8:
			print '\n'
			de=0

for fun ;)

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

Also, I need help with one thing. When you do anything (add, modify, delete), the changes do not show up untill the user restarts the program. Could someone tell me how to change the code so that the changes show up immediately? If you do not know what I mean, basically when you add a new contact, and then try searching for it, it will not find it untill the user restarts the program.

You need to commit the changes to your file. Writting to file does not write to file instanly until the file is closed. You must close the open files after reading or writting to them. Like that the info added will show straight away.

;)

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

Ask for the sites API for login protocols.
;)

richieking 44 Master Poster

Your def__init__ constructor take args that are no refered anywhere in your code.

Fix that. Use that for basic initializing of your variables.
;)

richieking 44 Master Poster

haha,

tonyjv

Cant you see that it was just a mistake with naming?
Take it easy ok?

richieking 44 Master Poster

try this
gives you the idea. no checkups anyway

#Find odd numbers

def odd_find(fr, to):
    if fr > to:
        trans = fr
        fr = to
        to = trans
    odd = []
    noOdd = []
    
    for x in range(fr, to):
        if x % 2 == 0:
            odd.append(x)
        else:
            noOdd.append(x)

    print  'Odd Stuff', odd
    print 'Not odd', noOdd

odd_find(5,40 )

print out:
Odd Stuff [6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38]
Not odd [5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39]

;)

richieking 44 Master Poster

Just incase your last file names are in the third file, use the result to open and read the third file.

thats it :)

richieking 44 Master Poster

meaning????

that file1.txt contains the name of file2.txt and file3.txt and so forth?

make things a bit clearer plz ;)

richieking 44 Master Poster

tonyjv

i admire your python skills
;)

richieking 44 Master Poster

do you have the filenames in another file and want to read those filename one after the other and use the names to open the real files?????

more info needed ;)

richieking 44 Master Poster

Hi, to be precise

1. Your method/function needs 2 arg but you gave only 1.
2. The logic of your function is not complete and will never get you what you want.
The logic flow is not ok.

If you want a fuction to check up words in your dic, its a piece of cake. But untils know... we are going in circles i think.

Put the cards on the table.... what do you really need. We need to solve this once and for all.
;)

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

How do you guys expert a newbie to understand short algorithm like this.????

Are you helping or showing off???
;)

qingmui does not get you guys ;)

richieking 44 Master Poster

import your new class into your main programe . Then there will be a conection with the event.

richieking 44 Master Poster

Try this fancy stuff:

import time # for time

def chec(sa):
    fd=sa
    for x in range(1, 10): #fancy.... You dont really need this but mmmm
        print ".",         #
        time.sleep(1)      #
    print '\n'               # you can try

    data = []; #make a list
    try:
        for x in sa:
            data.append(x.lower()); #pack the result into the list

        d1, d2 = (data[0], data[-1]);
    except:
        print "Values needed"
    else:
        if d1 == d2:     #check up the results
            print 'Check Results'
            print "-"*30
            print d1.upper(), d2.upper(), 'are the same\n';
        else:
            print 'Check Results'
            print "-"*30
            print d1.upper(), d2.upper(), 'are not the same\n'
    print "You entered:",fd ,'\n\n'

while True:  #
    choice = raw_input("Please enter choice [Enter] or  Q[to quit]: ").lower().strip()#get data
    if choice == "q": #check data
        break; #action
    else:
        try: #exception check
            palin = raw_input("Please enter a Phrase: ")
            chec(palin)
        except ValueError: #catch
            print "Enter phrase to check";
print "Check finished" #final line

Look is fun ok ;)

richieking 44 Master Poster

try the improve of hielo.

$f=scandir('/Images/');
foreach($f as $p)
{
  if($p=="." || $p=="."){
}
else{
 echo '<img src="/Images/'.$p.'" />';
}}
richieking 44 Master Poster

Only flash or cgi script can help you my friend ;)

richieking 44 Master Poster

Try this fancy one.

def chec(sa):
    data=[]; #make a list
    for x in sa:
        data.append(x.lower()); #pack the result into the list
   
    d1 ,d2 =(data[0], data[-1]);
    if d1 == d2:     #check up the results
        print d1 ,d2 , "are the same";
    else:
        print d1 , d2 , "are not the same"


chec("racecar")
#============== Reuults=============
r r are the same

will do what you wnat i think ;)

richieking 44 Master Poster

We dont solve problems here my good friend.

we share ideas and give direction.

You are welcome anytime ;)

richieking 44 Master Poster

The dic Dictionary is not declared anywhere in your function toPirate.
Neither is it refferenced to. how do you code.
line #8

for words in dic.split(string) #?????

define your function to either contain the dic. Such as

def toPirate(string, **dic):

here you can pass the dic as the last arg.

Also on line 12
result+=[dic[word]] ## wrong
just code

result+=dic[word]

Hope you get the idea ;)

richieking 44 Master Poster

look i dont ge you. do you have to search the dictionary for the word occurance and print them out + a custom words ???

help is on the way

richieking 44 Master Poster

very neat stuff! ;)

richieking 44 Master Poster

to be precise ????

richieking 44 Master Poster

also if you are taking in list as methos arg.

its better you provide the arg as list.
like....

def foo(file_name, *word_list):
      #bla bla bla

This the wordlist is auto a list container.

;)

richieking 44 Master Poster

Yep woooee

That is it.
Spacemanspiff92 you heard him right.

The wordlist is blank cos the list wordlist got nothing to do with the wordlist in the exportT~ method.

;)

richieking 44 Master Poster

If you wanna use a class, you are definately in for using its member function. Proper encapsulation not when it suites you.

Designing a class is an art.
;)

richieking 44 Master Poster

griswolf,

You are getting into the nitty gritty in O/I stream here which ofcourse is not the point. It was another class operation.
I personally like your illustration about Mr. Number and the flexibility stuff. But does the thread poster?? i dont think so.

No doubt that you got a very fine idea in python and i dont wanna take that from away you.
Maybe you can be my teacher one day. Who knows.? And greetings to Mr. Number ;)