A tuple in order to pass returned values ?

2011-10-05 Thread faucheuse
Hi, (new to python and first message here \o/)

I was wondering something :
when you do : return value1, value2, value3
It returns a tuple.

So if I want to pass these value to a function, the function have to
look like :
def function(self,(value1, value2, value3)) #self because i'm working
with classes

I tried it, and it works perfectly, but I was wondering if it's a good
choice to do so, if there is a problem by coding like that.

So my question is : Is there a problem doig so ?
-- 
http://mail.python.org/mailman/listinfo/python-list


A tuple in order to pass returned values ?

2011-10-05 Thread faucheuse
Hi, (new to python and first message here \o/)

I was wondering something :
when you do : return value1, value2, value3
It returns a tuple.

So if I want to pass these value to a function, the function have to
look like :
def function(self,(value1, value2, value3)) #self because i'm working
with classes

I tried it, and it works perfectly, but I was wondering if it's a good
choice to do so, if there is a problem by coding like that.

So my question is : Is there a problem doig so ?
-- 
http://mail.python.org/mailman/listinfo/python-list


Problem with a wx notebook

2011-10-17 Thread faucheuse
Hi there,

I've created a wx NoteBook in wich I set multiples panels in wich I
set one or more sizers. But nothing displays in the notebook,
everything is outside. I've been searching an answer for 2 days ><.
Can you help me plz ? Here is my code(with only one panel, to sum up
the code) :

class StreamingActivationDialog(wx.Dialog):
def __init__(self, *args, **kwds):
# begin wxGlade: StreamingActivationDialog.__init__
kwds["style"] = wx.DEFAULT_DIALOG_STYLE
wx.Dialog.__init__(self, *args, **kwds)
self.bitmap_1_copy = wx.StaticBitmap(self, -1, wx.Bitmap("img\
\logo.png", wx.BITMAP_TYPE_ANY))
self.labelDnD = wx.StaticText(self, -1, "Si vous avez déjà un
fichier d'activation, faite le glisser dans cette fenetre")
self.keyBitmap = wx.StaticBitmap(self, -1, wx.Bitmap("img\
\key.bmp", wx.BITMAP_TYPE_ANY))
self.conclude = wx.StaticText(self, -1, _("test"),
style=wx.ALIGN_CENTRE)

### Panel ###
self.intro3_label = wx.StaticText(self, -1, "Envoyez un mail à
\[email protected]\ncontenant le code :",style=wx.ALIGN_CENTRE)
self.activationCode_label= wx.StaticText(self, -1,
"123456789", style=wx.TE_READONLY)
self.copy2_Button = wx.Button(self, -1, "Copier dans le presse-
papier")
self.copy2_Button.Bind(wx.EVT_BUTTON, PanelMail.onCopy)
##

self.note = wx.Notebook(self, wx.ID_ANY, style=wx.BK_LEFT,
size=wx.Size(100, 341))
self.page3 = wx.Panel(self.note)

imagelist = wx.ImageList(94, 94)
bitmap1 = wx.Bitmap("img\\a.bmp", wx.BITMAP_TYPE_BMP )
imagelist.Add(bitmap1)
self.note.AssignImageList(imagelist)

self.__set_properties()
self.__do_layout()
# end wxGlade

def __set_properties(self):
# begin wxGlade: StreamingActivationDialog.__set_properties
self.SetTitle(_("Activation de FlashProcess"))
self.SetBackgroundColour(wx.Colour(255, 255, 255))
#self.linkProblem.SetForegroundColour(wx.Colour(0, 0, 0))
# end wxGlade

def __do_layout(self):
# begin wxGlade: StreamingActivationDialog.__do_layout
self.grid_sizer_1 = wx.FlexGridSizer(6, 1, 0, 0)
self.grid_sizer_2 = wx.FlexGridSizer(1, 2, 0, 30)
self.grid_sizer_1.Add(self.bitmap_1_copy, 0, wx.TOP|wx.BOTTOM|
wx.EXPAND, 10)


### Page 3 ###
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.intro3_label, 0, wx.BOTTOM|wx.ALIGN_CENTER, 5)
sizer.Add(self.activationCode_label, 0, wx.BOTTOM|
wx.ALIGN_CENTER, 20)
sizer.Add(self.copy2_Button, 0, wx.ALIGN_CENTER, 20)

self.page3.SetSizer(sizer)
sizer.Fit(self.page3)
##

self.note.AddPage(self.page3, "", False, 0)

self.Bind(wx.EVT_TOOLBOOK_PAGE_CHANGED, self.OnPageChanged)
self.Bind(wx.EVT_TOOLBOOK_PAGE_CHANGING, self.OnPageChanging)

self.grid_sizer_1.Add(self.note, 0, wx.EXPAND, 20)
self.grid_sizer_1.Add(self.labelDnD, 0, wx.TOP|
wx.ALIGN_CENTER_HORIZONTAL, 20)
self.grid_sizer_2.Add(self.keyBitmap, 0, wx.LEFT, 10)
self.grid_sizer_2.Add(self.labelDnD, 0, wx.LEFT, 20)
self.grid_sizer_1.Add(self.grid_sizer_2, 0, wx.EXPAND, 20)
self.grid_sizer_1.Add(self.conclude, 0, wx.TOP|
wx.ALIGN_CENTER_HORIZONTAL, 20)

self.SetSizer(self.grid_sizer_1)
self.grid_sizer_1.Fit(self)
self.Layout()
# end wxGlade

def OnPageChanged(self, event):
event.Skip()

def OnPageChanging(self, event):
event.Skip()
-- 
http://mail.python.org/mailman/listinfo/python-list


Problem using execvp

2011-10-27 Thread faucheuse
Hi,

I'm trying to launch my python program with another process name than
"python.exe".
In order to do that I'm trying to use the os.execvp function :

os.execvp("./Launch.py", ["ProcessName"])

Launch.py is the file that Launch the program and ProcessName is
the ... Process Name ^^

I get this error : OSError : [Errno 8] Exec format error.

I searched and found many solutions like : os.execvp("./Launch.py",
["./Launch.py","ProcessName"]), but nothing worked so far.

Can you help me plz ?
-- 
http://mail.python.org/mailman/listinfo/python-list