Stefano Mtangoo 455 Senior Poster

In wxpython you can have two different classes of windows interacting with one another. I know less of threading may be it can solve your problem but not sure!

Stefano Mtangoo 455 Senior Poster

try to build sources for yourself
http://www.pygame.org/ftp/pygame-1.8.1release.zip
I guess there will be setup.py, Just add python path to enviroment variable and run from commandline "setup.py install" without quotes

Stefano Mtangoo 455 Senior Poster

+1 for wxpython for some reasons:
1. I have developed some apps in Python, and it is very easy and fast once you get used to it
2. No licence problems if I decide to sell my apps
3. You can use wxglade (I'm always happy with hard coding)
4. A lot of help out there (I learned without any book), though poor official docs but there is wxpython demo showing how to use widgets

Here are some apps development arguments (caution: some might be very old posts):
http://www.pythonthreads.com/articles/interviews/wxpython-is-a-good-answer-for-almost-any-kind-of-desktop-application..html
http://discuss.joelonsoftware.com/default.asp?biz.5.286090.10
http://wiki.wxpython.org/wxPythonPit%20Apps

Stefano Mtangoo 455 Senior Poster

why not go for Python 2.5 ?

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

thanks but I want serious audio library that is at least independent of system browser and something like that

Stefano Mtangoo 455 Senior Poster

yeah, I have written that kind of program(using wxpy) and is great, but I want something independent like bass.dll and bass video libraries, instead of relying on system. Is there any other known dll rather than

Stefano Mtangoo 455 Senior Poster

dont worry I don't judge you because you are a year 8!
heeeeh

Stefano Mtangoo 455 Senior Poster

Instead of PMing you, why not post here. Unless for private things (which PM stands for), you should be displaying things here.

No critic/hurt inteded, but just correction, if you don't mind

Stefano Mtangoo 455 Senior Poster

I have been working with bass.dll from www.un4seen.com as audio library and I can say that it is great. But I have reached a place where I hitted the wall and it will take time for me to move. Can anyone suggest for me a dll library for playing audio files (.wav, .mp3, .wma, .ogg etc) ? Or any module that I can give a go! ::)

Stefano Mtangoo 455 Senior Poster

This is my Idea, that unless the sites you want is html (static), you will need to code small web browser; which is big pain but good Gain anyway

Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster
import wx
class MainFrame(wx.Frame):
	def __init__(self):
		#wx.ID_ANY means wxpython should assign any unique identity you can write wx.ID_ANY or use -1
		wx.Frame.__init__(self,None,wx.ID_ANY, title='Hello wolrd')
		#here we define self.buthello as wxButton
		self.buthello = wx.Button(self, wx.ID_ANY, label ='helo')
		#here we bind the button to Left click event. Normal button event is wx.EVT_BUTTON
		self.buthello.Bind(wx.EVT_LEFT_DOWN, self.helloevent)
		#show self, which is now wxFrame
		self.Show()
	#You bound left click with this helloevent remember? Here is where you define it(try to remove it and see what happens)
	def helloevent(self, event):
		msg = 'hello'
		msgbox = wx.MessageDialog (self, message = msg, style = wx.OK)
		if msgbox.ShowModal() == wx.ID_OK:
			msgbox.Destroy()
	
app = wx.App(redirect = False )
frame = MainFrame()
app.MainLoop()

"""
Q1. in the line 'wx.Frame.__init__', what is wx.ID_ANY, what is the purpose of it?.
--- Assign any available ID to the widget

Q2. Also self.buthello isnt defined anywhere? (confused here)
--- It is define, see my comments above

Q3. Also...
	def helloevent(self, event)
	how does 'event' work in here. Shouldnt it work without 'event'?
---You cannot bind widget to nothing! You MUST bind to some methods. Here you define a method bound to widget (Here Just a hello messagebox)
	
Q4. How can ShowModal be used in other cases?
--- ShowModal is Dialogs attributes, you can use it wherever dialog boxes are used  

Q5. This is another tutorial i was looking at and on this it has used '-1' instead of wx.ID_ANY. whys that?
--- See my comments, its different way of saying same thing (Like True and …
Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster
Stefano Mtangoo 455 Senior Poster

check urllib2 for reading source codes (HTML) and wxpython's html stuffs, for simple HTML browser like before going for something complex

http://www.wxpython.org/docs/api/wx.html-module.html
http://www.python.org/doc/2.5.2/lib/module-urllib2.html

Stefano Mtangoo 455 Senior Poster

I prefer wxpython.
Honestly I will never move to Python 3 until wxpython comes out!

Stefano Mtangoo 455 Senior Poster

I don't know if The formula is right (check and change it), but my aim is to show you how to do it rather than accurate answer. So try to poke around :)

import math

def main():
     value = float(raw_input("Please enter the Number: \n "))
     freq = float(raw_input("Please the number of times to loop: \n"))
     # I assume the formula is formula is ((freq + value/freq) / (2))
     container = freq
     t = True
     while t:
          final = (freq + value/freq) /2
          print final         
          container = container - 1
          print container
          if container == 0:
               t = False
     math_value = math.sqrt(value)     
     print "final guess answer is: %f Compared to %f from math.sqrt()" %(final, math_value)

main()
Stefano Mtangoo 455 Senior Poster

Hello all,
I'm starting PHP and setting up my server on Stick.
I'm fond of WAMP and find XAMPP interesting, and want to give it a go :D

However, if you have ever worked with WAMP it have a behaviour of displaying all folders in www directory, and I don't find how to do it in XAMPP. It redirects to xampp dir

Somebody to help! :(

Stefano Mtangoo 455 Senior Poster

Thanks alot all of you guys!
I have learned alot

Stefano Mtangoo 455 Senior Poster

So not possible?
How difficult and effective is pyOpenGL compared to Vpython?
Can anyone give a simple comparison?

Stefano Mtangoo 455 Senior Poster

Thanks Perica,
Python 2.6 is boring and I love 2.5
I'll visit it :)

Stefano Mtangoo 455 Senior Poster

Hello all,
I'm starting C++ and wan't to learn for loop. I want the Loop to count down the rotate and print its value until when it equals to value where it terminates. Here is code

int value;
    int rotate = 4;
    for (value = 0; rotate>value; rotate--; ){
        cout<<"Now rotate value is:"<<rotate<<endl;
Stefano Mtangoo 455 Senior Poster

does anyone know how to shutdown a computer on windows XP (using python of course ;) given the IP address and the computer name (probably don't need it, though)? I don't want to use os commands like os.system("shutdown -i"). Thanks in advanced!

use os.system

import os
#run os based command like opening notepad
os.system("notepad")
Stefano Mtangoo 455 Senior Poster

Nothing Bad!
Adv.
More security, more features, many company now days have their drivers for vista....etc

Dis-adv.
Resource hunger (Memory & CPU speed)
Annoying UAC (I dont like to turn it off anyway)

So you get to choose. If it was a vote, +1 for Vista :)

Stefano Mtangoo 455 Senior Poster

Try Exercising with this :)

def MakeDict(dict_name):
    dict_name = dict()
    return dict_name


def AddName(Name, key_name, dict_name):
    dict_name[key_name] = Name
    print "Added " + str(Name)+ "at " +str(key_name)
    
#now we will use our dictionary
#create dictionary
mydict = MakeDict("evstevemd")
print mydict

#Add some stuffs in dictionary
AddName("Boo! Boo!", "calf", mydict)
print mydict
Stefano Mtangoo 455 Senior Poster

Just a curious Question,
Is there a way of putting Vpython in wxpython as we do in case of wx.MediaCtrl and other stuffs?

Stefano Mtangoo 455 Senior Poster

Logfile of Trend Micro HijackThis v2.0.2
Scan saved at 07:11:03, on 1/25/2009
Platform: Windows XP SP2 (WinNT 5.01.2600)
MSIE: Internet Explorer v6.00 SP2 (6.00.2900.2180)
Boot mode: Normal

Running processes:
C:\WINDOWS\System32\smss.exe
C:\WINDOWS\system32\winlogon.exe
C:\WINDOWS\system32\services.exe
C:\WINDOWS\system32\lsass.exe
C:\WINDOWS\system32\svchost.exe
C:\WINDOWS\System32\svchost.exe
C:\WINDOWS\system32\spoolsv.exe
C:\WINDOWS\SYSTEM32\DWRCS.EXE
C:\Program Files\McAfee\Common Framework\FrameworkService.exe
C:\Program Files\McAfee\VirusScan Enterprise\Mcshield.exe
C:\Program Files\McAfee\VirusScan Enterprise\VsTskMgr.exe
C:\WINDOWS\system32\CCM\CcmExec.exe
C:\Program Files\PC Connectivity Solution\ServiceLayer.exe
C:\Program Files\PC Connectivity Solution\Transports\NclUSBSrv.exe
C:\WINDOWS\system32\svchost.exe
C:\Downloads\Software\HiJackThis.exe

R1 - HKLM\Software\Microsoft\Internet Explorer\Main,Default_Page_URL = http://intranet.vodacom.co.tz
O2 - BHO: AcroIEHlprObj Class - {06849E9F-C8D7-4D59-B87D-784B7D6BE0B3} - C:\Program Files\Adobe\Acrobat 7.0\ActiveX\AcroIEHelper.dll
O2 - BHO: WormRadar.com IESiteBlocker.NavFilter - {3CA2F312-6F6E-4B53-A66E-4E65E497C8C0} - C:\Program Files\AVG\AVG8\avgssie.dll (file missing)
O2 - BHO: scriptproxy - {7DB2D5A0-7241-4E79-B68D-6309F01C5231} - C:\Program Files\McAfee\VirusScan Enterprise\scriptcl.dll
O2 - BHO: FDMIECookiesBHO Class - {CC59E0F9-7E43-44FA-9FAA-8377850BF205} - C:\PROGRA~1\FREEDO~1\iefdm2.dll
O4 - HKLM\..\Run: [IgfxTray] C:\WINDOWS\system32\igfxtray.exe
O4 - HKLM\..\Run: [HotKeysCmds] C:\WINDOWS\system32\hkcmd.exe
O4 - HKLM\..\Run: [Persistence] C:\WINDOWS\system32\igfxpers.exe
O4 - HKLM\..\Run: [SunJavaUpdateSched] C:\Program Files\Java\j2re1.4.2_06\bin\jusched.exe
O4 - HKLM\..\Run: [UserFaultCheck] %systemroot%\system32\dumprep 0 -u
O4 - HKLM\..\Run: [McAfeeUpdaterUI] "C:\Program Files\McAfee\Common Framework\UdaterUI.exe" /StartedFromRunKey
O4 - HKLM\..\Run: [gcasServ] "C:\Program Files\Microsoft AntiSpyware\gcasServ.exe"
O4 - HKLM\..\Run: [RemoteControl] "C:\Program Files\CyberLink\PowerDVD\PDVDServ.exe"
O4 - HKLM\..\Run: [ShStatEXE] "C:\Program Files\McAfee\VirusScan Enterprise\SHSTAT.EXE" /STANDALONE
O4 - HKUS\S-1-5-21-613696747-971654793-1845911597-7488\..\Run: [NokiaPCInternetAccess] "C:\Program Files\Nokia\PC Internet Access\NPCIA.exe" /b (User 'imwakilembe')
O4 - HKUS\S-1-5-21-613696747-971654793-1845911597-7488\..\Run: [MicroseX] C:\Recycle\X-5-4-27-2345678318-4567890223-4234567884-2341\RisinG.exe (User 'imwakilembe')
O4 - HKUS\S-1-5-21-613696747-971654793-1845911597-7488\..\Run: [Windows Security Service] C:\CONFIG\S-1-5-21-1482476501-1644491937-682003330-1013\Cfg.exe (User 'imwakilembe')
O4 - HKUS\S-1-5-21-613696747-971654793-1845911597-7488\..\Run: [Windows Video Drivers] C:\RECYCLER\S-1-5-21-7568411530-1006273648-251811096-0363\winlogon.exe (User 'imwakilembe')
O4 - HKUS\S-1-5-21-613696747-971654793-1845911597-7702\..\Run: [NokiaPCInternetAccess] "C:\Program Files\Nokia\PC Internet Access\NPCIA.exe" …

Stefano Mtangoo 455 Senior Poster

hello again, Ive got the basics under my belt and ready to start making things happen:D.
I want to experiment with different things so could you show me to some good tutorials on some of the following things.

1. sending and receive messages through the internet-what library/Mod should i use? [sockets/urllib2/smtp modules]
2. Which would you recommend for a beginner wxWidgets, Tkinter or QT?
3. making a search script that returns results.. [what are you searching? strings, files...??]
4. Databases? [SQLite comes with python -- good start also mySQLdb()not sure if version 3.0 is out]
5. Making a mini notepad...[That is GUI, wxpython does that and more than that]
6. Returning information from a webpage...[already mentioned urllib2]

If you have any other helpful tips do let me know:).
(I'm using Python 3.0)
-thanks

Haven't looked at python 3.0, but I will answer according to what I know from python 2.5
Good start is python global module index at python documentation

Stefano Mtangoo 455 Senior Poster

I posted on PHP and I feel may be I post on wrong place

I have been using WAMP to setup my forum (PHPBB3) and and a site. For some reason I don't know, PHP installation of WAMP was crashing with message can't find logger.dll. I removed my www directory and uninstalled WAMP and re installed, that is when I knew that I forgot to bakup my databases. I used system restore and cannot access the database

Any help or suggestion? It is painful to start setting up forum again, due to limitation in time! Pse help

Stefano Mtangoo 455 Senior Poster

the best debugging technique is putting print statement/function after few lines to see whether it passes a given statement

Stefano Mtangoo 455 Senior Poster

I have been using WAMP to setup my forum (PHPbb3) and and a site. For some reason I don't know, PHP installation of WAMP was crashing with message can't find logger.dll. I removed my www directory and uninstalled WAMP and re installed, that is when I knew that I forgot to bakup my databases. I used system restore and cannot access the database

Any help or suggestion? It is painful to start setting up forum again, due to limitation in time! Pse help :(

Stefano Mtangoo 455 Senior Poster

Enjoy!

Stefano Mtangoo 455 Senior Poster

There is this virus/malware that is not detected by McAfee, Avast, etc. It is very sturbborn. I have tried to scan with prevx but need licence to remove it. Malwarebyte cannot do anything....help please.

Here are some Links of people with same problem:
http://answers.yahoo.com/question/index?qid=20090121011856AAGzwNo

I have attached the report
Thanks alot

Stefano Mtangoo 455 Senior Poster

Try Code blocks. It is another good C++ compiler.
http://www.codeblocks.org/

Also I heard somewhere that this is the updated version of non-updated devC++
http://wxdsgn.sourceforge.net/

Stefano Mtangoo 455 Senior Poster

Here are some helpful function (All are working)

#Create Stream
    def onStream(self, path): 
        #Initialize device by calling init methods
        self.onInitLib()   
        #arg definitions
        #HSTREAM BASS_StreamCreateFile(BOOL mem, void *file, QWORD offset, QWORD length, DWORD flags);
        bass.BASS_StreamCreateFile.argtypes = [BOOL, ct.c_char_p, ct.c_int64 , ct.c_int64, ct.c_uint]
        #defining restypes
        bass.BASS_StreamCreateFile.restype = ct.c_uint        
        print path
        stream = bass.BASS_StreamCreateFile(False, path, 0, 0, 0)
        self.stream = stream
        #check if the loop option is checked       
        return self.stream
    
    #Play File
    def onPlayStream(self, stream):
        #define args
        #BASS_ChannelPlay(stream, FALSE); // play the stream
        bass.BASS_ChannelPlay.argtypes = [ct.c_uint, BOOL]
        #call function
        bass.BASS_ChannelPlay(stream, False)
    
    #free the stream    
    def onFreeStream(self, stream):
        bass.BASS_StreamFree(stream) 

    def onInitLib(self):        
        #define arg types
        #BOOL BASS_Init(int device, DWORD freq, DWORD flags, HWND win, GUID *clsid );
        bass.BASS_Init.argtypes = [ct.c_int, ct.c_uint, ct.c_uint, ct.c_uint, ct.c_uint]
        #define result types
        bass.BASS_Init.restype = ct.c_int
        #call function with args
        c= bass.BASS_Init(-1, 44100, 0,0, 0)
Stefano Mtangoo 455 Senior Poster

I use bass.dll to play music files from http://www.un4seen.com/
I try to use function called BASS_ChannelSetPosition. I use ctypes to access the Library. Below is the part of documentation (comes with bass as help file)

I need somebody to tell me whether the mode (BASS_POS_BYTE, BASS_MUSIC_POSRESET...etc) is a function or constant, and how do I set it as a flag in function. Below is the actual erroronous code

def onSetPosition(self, handle, position, mode):        
        #QWORD BASS_ChannelSetPosition(DWORD handle, QWORD pos DWORD mode, ); - older version
        bass.BASS_ChannelSetPosition.argtypes = [ct.c_uint, ct.c_int64, ct.c_char_p]  
        bass.BASS_ChannelSetPosition.restype = BOOL
        successful2 = bass.BASS_ChannelSetPosition(handle, position, mode)
        error = bass.BASS_ErrorGetCode()# don't worry, this is for debugging purposes only
        successful = (successful2, error)# don't worry, this is for debugging purposes only
        return successful # don't worry, this is for debugging purposes only

Sets the playback position of a sample, MOD music, or stream.

BOOL BASS_ChannelSetPosition(
DWORD handle,
QWORD pos,
DWORD mode
);


Parameters
handle The channel handle... a HCHANNEL, HSTREAM or HMUSIC.
pos The position, in units determined by the mode.
mode How to set the position. One of the following, with optional flags.
BASS_POS_BYTE The position is in bytes, which will be rounded down to the nearest sample boundary.
BASS_POS_MUSIC_ORDER The position is in orders and rows... use MAKELONG(order,row). (HMUSIC only)
BASS_MUSIC_POSRESET Flag: Stop all notes. This flag is applied automatically if it has been set on the channel, eg. via …

Stefano Mtangoo 455 Senior Poster

Using an SQLite database is the simpliest and best. It comes with Python and a tutorial is here http://www.devshed.com/c/a/Python/Using-SQLite-in-Python/

Yeah, SQLite is Ideal for that work. I advice you to take a leap. It is very simple and need no server (Zero config). Try it and you will enjoy. Here is a paper from www.python.org :
http://docs.python.org/library/sqlite3.html

Here google results
http://www.google.co.tz/search?q=python+sqlite&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

Stefano Mtangoo 455 Senior Poster

My test criteria for a good editor is how it handles the input() function in its output window.

How do you do that? :)

Stefano Mtangoo 455 Senior Poster

but msvcr71.dll is there!
Could it be something obsolete to be used with python2.6?

Stefano Mtangoo 455 Senior Poster

Thanks all.
I will try tomorrow and will give feedback

Stefano Mtangoo 455 Senior Poster

I will check when at home and feedback (which may be some hours)
But worry not daniweb have many developers :lol:

Stefano Mtangoo 455 Senior Poster

So my question goes like this, where in wxpython site packages, or in python do I need to include those dll and which of them do I need to include for me to run it anywhere without error??

Stefano Mtangoo 455 Senior Poster

which version of python do you use? I have to test it for myself later

Stefano Mtangoo 455 Senior Poster

have you tried with Gmail settings instead of your server? That should give you idea if the problem is the script or your server

Stefano Mtangoo 455 Senior Poster

I have my WAMP server on Vista but need it too on KUBUNTU so as I can use it even under linux. Can Anyone help me how to do it. I accept even how to separately install Apache, PHP and MYSQL. Pse help

Stefano Mtangoo 455 Senior Poster

For lightweight editors you can go for scite
Heavy weight ones are vimand Emacs
I would tell you go for vim because of nice book by swaroop c.h
www.swaroopch.com

Stefano Mtangoo 455 Senior Poster

I would reccomend using Wind IDE 101. Its free and great, i recently upgraded to the Personal version (about $50 AUS) and that is exellent, it has a great debugger as well as having so many customisable features.

+1

I used for long Wing IDE 101 and Upgraded to Personal. I will then Upgrade to Pro. some times later. Also Netbeans have their Early Access version of python with code completion and debugger. Also drpython and pydev + eclipse
anyway is a matter of choice

Stefano Mtangoo 455 Senior Poster

I have python 2.6 portable and would pop error when I import wx.
After some search, I found The prementioned package missing in the XP system. I downloaded and Installed and went fine. My Question is : Is there any way to add vcredist_x86.exe's missing DLL direct to wxpython directory so that I don't have to reinstall in every machine (which erases the meaning of portable)?

Here is the error that poped before I installed it:


Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import wx
File "C:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\__init__.py", line 45, in <module>
from wx._core import *
File "C:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 4, in <module>
import _core_
ImportError: DLL load failed: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
>>>

Thanks!

Stefano Mtangoo 455 Senior Poster

http://portableapps.com/node/15756
It have IDLE, I'm downloading right now and will see