Re: [Tutor] Running scripts at login

2012-04-06 Thread Michael Lewis
Hi everyone, I am researching how to automatically run some of my scripts after I log into my Windows machine. I don't want to have to manually run the script or setup a windows task. The same way you run any Windows program on startup: Add the script to your startup programme

[Tutor] Is socket.socket() a func or a class

2012-04-06 Thread Khalid Al-Ghamdi
hi all, I'm reading this book that says when creating a socket you have to use the socket.socket() *function *as in : ss=socket.socket() but whey i check they type it says it's a class which makes sense cause you're creating a socket object. type(ss) class 'socket.socket' so, which is it? or

Re: [Tutor] regex question

2012-04-06 Thread Peter Otten
Khalid Al-Ghamdi wrote: I'm trying to extract the domain in the following string. Why doesn't my pattern (patt) work: redata 'Tue Jan 14 00:43:21 2020::eax...@gstwyysnbd.gov::1578951801-6-10 Sat Jul 31 15:17:39 1993::rz...@wgxvhx.com::744121059-5-6 Mon Sep 21 20:22:37

Re: [Tutor] Running scripts at login

2012-04-06 Thread Alan Gauld
On 06/04/12 03:07, Michael Lewis wrote: What if I want to send the executable to someone and have their machine run the script at startup? Assume I don't have access to their machine to add the script to the startup program group. How can I make that happen? When you say executable in

Re: [Tutor] Is socket.socket() a func or a class

2012-04-06 Thread Alan Gauld
On 06/04/12 07:10, Khalid Al-Ghamdi wrote: I'm reading this book that says when creating a socket you have to use the socket.socket() _function _as in : ... type(ss) class 'socket.socket' so, which is it? or do authors loosely use these terms interchangeably in this context? It just

[Tutor] How to have the name of a function inside the code of this function?

2012-04-06 Thread Karim
Hello all, I have : def foo(): print( getattr(foo, 'func_name')) Where I get the name of the function but I add to give the name of this function. Indeed it is not very helpful... I checked the globals() but how I can do to get globals()['toto'].func_name. This is not more

Re: [Tutor] How to have the name of a function inside the code of this function?

2012-04-06 Thread Steven D'Aprano
Karim wrote: Hello all, I have : def foo(): print( getattr(foo, 'func_name')) Why not this? def foo(): print 'foo' You already know the name of the function. There is no portable way of retrieving the name of the current function from within that function. --

Re: [Tutor] Is socket.socket() a func or a class

2012-04-06 Thread Steven D'Aprano
Khalid Al-Ghamdi wrote: hi all, I'm reading this book that says when creating a socket you have to use the socket.socket() *function *as in : ss=socket.socket() but whey i check they type it says it's a class which makes sense cause you're creating a socket object. type(ss) class

Re: [Tutor] How to have the name of a function inside the code of this function?

2012-04-06 Thread Modulok
On 4/6/12, Karim kliat...@gmail.com wrote: Hello all, I have : def foo(): print( getattr(foo, 'func_name')) Where I get the name of the function but I add to give the name of this function. Indeed it is not very helpful... I checked the globals() but how I can do to

[Tutor] a problem with a server and client

2012-04-06 Thread Khalid Al-Ghamdi
hi, i'm trying to implement a server that adds a time stamp to incoming text form a client. the server's code is (but doesn't seem to have the problem as demoed by the error below: from socket import * from time import ctime HOST = '' PORT = 21567 BUFSIZ = 1024 ADDR =(HOST, PORT) tcpSerSock =

Re: [Tutor] a problem with a server and client

2012-04-06 Thread Evert Rol
i'm trying to implement a server that adds a time stamp to incoming text form a client. the server's code is (but doesn't seem to have the problem as demoed by the error below: from socket import * from time import ctime HOST = '' PORT = 21567 BUFSIZ = 1024 ADDR =(HOST, PORT)

[Tutor] which gets called

2012-04-06 Thread John Fabiani
Hi, I want to create a class that inherits two other classes. class NewClass( A,B) But both A and B contain a method with the same name (onKeyDown). If my NewClass does not contain something to override the methods which one would be called if myinstance = NewClass() myinstance.onKeyDown()

Re: [Tutor] a problem with a server and client

2012-04-06 Thread Khalid Al-Ghamdi
yah i did the search, and tried the solution, but it didn't work nice of you to have tried, though... anyhow, i found where the problem is... on the client side it should be connect() instead of bind() in : tcpCliSock.bind(ADDR) thanks On Fri, Apr 6, 2012 at 4:59 PM, Evert Rol

[Tutor] How to use g_timeout_add () function?

2012-04-06 Thread Lion Chen
Hello all, i have a question: when i check gtk_time_out in the gtk+2 reference, it said |gtk_timeout_add|has been deprecated since version 2.4 and should not be used in newly-written code. Use |g_timeout_add()|instead. but i don't know how tu use the g_timout_add() function: my_id =

Re: [Tutor] a problem with a server and client

2012-04-06 Thread Khalid Al-Ghamdi
actually, you are right... in addition to that problem, there was the encodeing/decoding issue you mentioned on both the client and server. thanks On Fri, Apr 6, 2012 at 5:08 PM, Khalid Al-Ghamdi emailkg...@gmail.comwrote: yah i did the search, and tried the solution, but it didn't work

Re: [Tutor] which gets called

2012-04-06 Thread Evert Rol
Hi, I want to create a class that inherits two other classes. class NewClass( A,B) But both A and B contain a method with the same name (onKeyDown). If my NewClass does not contain something to override the methods which one would be called if myinstance = NewClass()

Re: [Tutor] How to use g_timeout_add () function?

2012-04-06 Thread Evert Rol
Hello all, i have a question: when i check gtk_time_out in the gtk+2 reference, it said gtk_timeout_add has been deprecated since version 2.4 and should not be used in newly-written code. Use g_timeout_add() instead. but i don't know how tu use the g_timout_add() function: my_id =

Re: [Tutor] which gets called

2012-04-06 Thread Brian van den Broek
On 6 April 2012 15:54, John Fabiani jo...@jfcomputer.com wrote: Hi, I want to create a class that inherits two other classes. class NewClass( A,B) But both A and B contain a method with the same name (onKeyDown). If my NewClass does not contain something to override the methods which one

Re: [Tutor] How to use g_timeout_add () function?

2012-04-06 Thread Mark Lawrence
On 06/04/2012 15:17, Lion Chen wrote: Hello all, i have a question: when i check gtk_time_out in the gtk+2 reference, it said |gtk_timeout_add|has been deprecated since version 2.4 and should not be used in newly-written code. Use |g_timeout_add()|instead. but i don't know how tu use the

Re: [Tutor] which gets called

2012-04-06 Thread Mark Lawrence
On 06/04/2012 14:54, John Fabiani wrote: Hi, I want to create a class that inherits two other classes. class NewClass( A,B) But both A and B contain a method with the same name (onKeyDown). If my NewClass does not contain something to override the methods which one would be called if

Re: [Tutor] which gets called

2012-04-06 Thread John Fabiani
On Friday, April 06, 2012 06:54:28 AM John Fabiani wrote: Hi, I want to create a class that inherits two other classes. class NewClass( A,B) But both A and B contain a method with the same name (onKeyDown). If my NewClass does not contain something to override the methods which one

[Tutor] Emailing code

2012-04-06 Thread myles broomes
This question isnt so much related to a specific program, just something im curious about. What is the best way to email code? I find that when i copy and paste it into an email, the indentation and spacing gets all messed up. Myles Broomes

Re: [Tutor] How to have the name of a function inside the code of this function?

2012-04-06 Thread Karim
Le 06/04/2012 19:31, Alan Gauld a écrit : On 06/04/12 09:47, Karim wrote: If you have any idea to get the caller name inside the caller. Its not normally very helpful since in Python the same function can have many names: def F(x): return x*x a = F b = F c - lambda y: F(y) print

Re: [Tutor] Emailing code

2012-04-06 Thread Emile van Sebille
On 4/6/2012 12:14 PM myles broomes said... This question isnt so much related to a specific program, just something im curious about. What is the best way to email code? I find that when i copy and paste it into an email, the indentation and spacing gets all messed up. Set your email client

[Tutor] How do you save work in progress in Pyscripter ?

2012-04-06 Thread Thomas Mujica
Please help a newbie Was able to write and successfully run this but I can't seem to be able to save it Luckily I had saved it to Word and then I was able to copy and paste it back into PyScripter. I'm using Python Scripter Version 2.5.3.0 x86 *** Python 2.7.2 (default, Jun 12

Re: [Tutor] Emailing code

2012-04-06 Thread wesley chun
On Fri, Apr 6, 2012 at 12:14 PM, myles broomes mylesbroo...@hotmail.co.uk wrote: This question isnt so much related to a specific program, just something im curious about. What is the best way to email code? I find that when i copy and paste it into an email, the indentation and spacing gets

[Tutor] Tkinter GUI crashing problem

2012-04-06 Thread myles broomes
Im working the Tkinter and I'm having a problem with the GUI I made. It crashes whenever I hit the submit button. Heres my code: #Guess my number 2.0 #The guess my number game but using a GUI import random from tkinter import * class Application(Frame): GUI to hold widgets.

Re: [Tutor] Tkinter GUI crashing problem

2012-04-06 Thread Emile van Sebille
On 4/6/2012 3:07 PM myles broomes said... import random from tkinter import * What version of python on what platform please... Emile ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] How do you save work in progress in Pyscripter ?

2012-04-06 Thread Alan Gauld
On 06/04/12 20:11, Thomas Mujica wrote: *Was able to write and successfully run this but I can’t seem to be able to “save” it* You have written the code at the interactive prompt which is really intended for experimenting. To save the code as a python script you need to create a plain text

Re: [Tutor] Tkinter GUI crashing problem

2012-04-06 Thread Alan Gauld
On 06/04/12 23:07, myles broomes wrote: Im working the Tkinter and I'm having a problem with the GUI I made. It crashes whenever I hit the submit button. Heres my code: What do you mean by crashes? It looks to me like it should lock up rather than crash. Your update_txt method goes into an

Re: [Tutor] Emailing code

2012-04-06 Thread Steven D'Aprano
myles broomes wrote: This question isnt so much related to a specific program, just something im curious about. What is the best way to email code? I find that when i copy and paste it into an email, the indentation and spacing gets all messed up. Don't send HTML, because that is poison to

Re: [Tutor] How to have the name of a function inside the code of this function?

2012-04-06 Thread Dave Angel
On 04/06/2012 03:19 PM, Karim wrote: Le 06/04/2012 19:31, Alan Gauld a écrit : On 06/04/12 09:47, Karim wrote: If you have any idea to get the caller name inside the caller. Its not normally very helpful since in Python the same function can have many names: def F(x): return x*x a

Re: [Tutor] Tkinter GUI crashing problem

2012-04-06 Thread Steven D'Aprano
myles broomes wrote: Im working the Tkinter and I'm having a problem with the GUI I made. It crashes whenever I hit the submit button. Heres my code: Define crashes. Does it: * cause your computer to Blue Screen of Death? * lock up your computer until you Ctrl-Alt-Delete? * cause Windows to

Re: [Tutor] How to have the name of a function inside the code of this function?

2012-04-06 Thread Karim
Le 07/04/2012 04:01, Dave Angel a écrit : On 04/06/2012 03:19 PM, Karim wrote: Le 06/04/2012 19:31, Alan Gauld a écrit : On 06/04/12 09:47, Karim wrote: If you have any idea to get the caller name inside the caller. Its not normally very helpful since in Python the same function can have