Hi Asrarahmed,
There's a few questions in there, and unfortunately I don't have a copy
of your book. But I'll try to answer them, and I'll change the order so
that they build on each other.
>I am not sure of using time function in python..
Depending on what you're trying to do, the simplest w
Asrarahmed Kadri wrote:
> Folks,
>
> I am trying to enter names in a file; each on a new line with this
> code, but not working:
>
> done = 0
> *while not done:
> str = raw_input("Enter login name:\t to quit type 'q': ")
> if str == 'q':
> done = 1
> else: *
> * str
Hi Alan,
I think I might be trying to walk before I can crawl; for benefits of
other newbies, I'll summarise lessons learned so far.
Firstly, I spent ages trying to find out why the Python documentation
syntax for Popen, using stdin=PIPE, didn't work:
Traceback (most recent call last):
File ""
There is a good interview on Python 411 last week with the authors of
the book.
http://www.awaretek.com/python/index.html
You can also find a few other shows about gui toolkits in Python. This
is a great resource if you want to learn about Python while you commute.
--Dennis
- Original Mes
>
> while not done:
>str = raw_input("Enter login name:\t to quit type 'q': ")
>if str == 'q':
> done = 1
>else:
> str = str + '\n'
> fd.write(str)
Hi Asrarahmed,
What's 'fd'? Where is it defined?
(I have a guess, but I'd rather that you show where fd is being defi
> a login page that takes a username and password, checks it against a
> database, and then sets a cookie of (hash(secret,user, time),user,time).
Hi Anil,
Ok, separate the concerns about where the inputs are coming from. It will
seem weird, but just for the moment, forget completely about the
Folks,
I am trying to enter names in a file; each on a new line with this code, but not working:
done = 0
while not done: str = raw_input("Enter login name:\t to quit type 'q': ")if str == 'q': done = 1 else:
str = str + '\n'
fd.write(str)
The traceback is as un
On Thu, 12 Oct 2006, Amadeo Bellotti wrote:
> I am currently interseted in learning tkinter and what beeter way then
> with a project so im making a python IDE and i was wondering if there
> were any good tutorials that are out there for tkinter and a book or 2
> would be nice thank you
Joh
I am currently interseted in learning tkinter and what beeter way then with a project so im making a python IDE and i was wondering if there were any good tutorials that are out there for tkinter and a book or 2 would be nice thank you
___
Tutor maillist
Thanks a lot.
It was quick.
I will send the traceback from now on.
-Asrar
On 10/13/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote:
Asrarahmed Kadri wrote:>>> I have created two buttons. The code for button2 is not working as I
> want it to be. When I click button2, the application should exit,
On Thu, 2006-10-12 at 14:46 -0700, johnf wrote:
> On Thursday 12 October 2006 07:14, Jason Massey wrote:
> > On 10/12/06, johnf <[EMAIL PROTECTED]> wrote:
> > > On Thursday 12 October 2006 00:31, Alan Gauld wrote:
> > > > > query = "SELECT * FROM DB WHERE NAME = %s" % (name)
> > > > > cursor.execut
Asrarahmed Kadri wrote:
>
>
> I have created two buttons. The code for button2 is not working as I
> want it to be. When I click button2, the application should exit, but
> it isnt.
> Can someone fix it??
>
> from Tkinter import *
> from tkMessageBox import *
>
> def callback():
> showinf
I have created two buttons. The code for button2 is not working as I want it to be. When I click button2, the application should exit, but it isnt.
Can someone fix it??
from Tkinter import *from tkMessageBox import *
def callback(): showinfo('message','I am here...')
def QUIT(): ans = as
Thanks Wes,
After posting it dawned on me that the US site might have more (any!)
reviews, and sure enough there is one mega review and several shorter
ones, none negative. I think I'll be buying...
The wxWidgets book I'll pass on, I have an old one from about 10
years ago (from when I was active
I'm using Python 2.3.4After reading this in the docs
getrefcount(
object)
Return the reference count of the object. The count returned is
generally one higher than you might expect, because it includes the (temporary)
reference as an argument to getrefcount().I decided to try some experiments c
> WxPython in Action (Paperback)
> by Noel Rappin, Robin Dunn
i'll probably be picking up a copy of it myself. i've seen positive
comments about the book. more reviews available at Amazon US:
http://www.amazon.com/exec/obidos/ASIN/1932394621
there's also a wxWidgets book if you need to know the
> Python program instead of hard-coded values. The configuration data
> currently is in the form of a couple of lists and some triple-quoted
> strings.
>
> I was looking at the ConfigParser module, but I cannot see how to
> use
> this format to represent lists or triple-quoted strings. Are there
On Thursday 12 October 2006 07:14, Jason Massey wrote:
> On 10/12/06, johnf <[EMAIL PROTECTED]> wrote:
> > On Thursday 12 October 2006 00:31, Alan Gauld wrote:
> > > > query = "SELECT * FROM DB WHERE NAME = %s" % (name)
> > > > cursor.execute(query)
> > >
> > > There can be security issues with thi
I just noticed
WxPython in Action (Paperback)
by Noel Rappin, Robin Dunn
on Amazon.co.uk.
I wondered if anyone has got the book and would like
to comment on it? One of the main reasions I stick with
Tkinter is that I have Grayson's book as a reference.
If this is as useful for wxPython I mi
On 13/10/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote:
> Also if a file exists, and we open it in a write mode, it would be truncated
> to zero length. So what is the way out of this??#
You can open in append mode..
>>> f = open('foo', 'w')
>>> f.write('Hello ')
>>> f.close()
>>> f = open('foo'
William O'Higgins Witteman wrote:
> I am looking for a way to use a plain text configuration file in a
> Python program instead of hard-coded values. The configuration data
> currently is in the form of a couple of lists and some triple-quoted
> strings.
>
> I was looking at the ConfigParser modu
> From: Asrarahmed Kadri <[EMAIL PROTECTED]>
> Date: Oct 12, 2006 9:17 AM
> Subject: Re: [Tutor] Help with basic user-data file
> To: Rob Andrews <[EMAIL PROTECTED]>
>
>
> Thanks.
> Can you please also tell me how to check the existence of a file using
> python builtin functions.
If path is a st
William O'Higgins Witteman wrote:
> I am looking for a way to use a plain text configuration file in a
> Python program instead of hard-coded values. The configuration data
> currently is in the form of a couple of lists and some triple-quoted
> strings.
>
> I was looking at the ConfigParser modul
anil maran wrote:
> Hi guys
> I m trying to maintain Sessions for each user, and a session-id that
> needs to be stored in cookie. I m unable to figure out how to generate
> session-id that can be stored in a cookie and sync with a session.
> The problem is this
> everytime someone logs in check
Hi guysI m trying to maintain Sessions for each user, and a session-id that needs to be stored in cookie. I m unable to figure out how to generate session-id that can be stored in a cookie and sync with a session.The problem is this everytime someone logs in check and see if they have session info
Dear DannyTHanks for your prompt response. THis is not a homework problem, I m trying to learn how to do sessions logins
I m trying to do the following
1) have logins/passwords stored in postgresql, currently this is my
code, python+psycopg2 talking to postgresql running in backend.
if i.email != "
Kristinn Didriksson wrote:
> Hello,
> I an completely new to programming and am trying to teach myself
> Python using Python Programming by John Zelle. Essentially I am an ex-
> tech writer trying to learn how to program.
> My system: Mac OS X 10.4, Python 2.5, TextMate editor
> Here is the prob
> Here is the problem:
>
> I get 'float' object not callable error.
Hi Kristinn,
Ah. Ok. The problem is a notational one. You're reusing notation that
you've learned from your math classes, that is, that:
a b
informally represents the multiplication of numbers 'a' and 'b'.
Furthermor
Hello,
I an completely new to programming and am trying to teach myself
Python using Python Programming by John Zelle. Essentially I am an ex-
tech writer trying to learn how to program.
My system: Mac OS X 10.4, Python 2.5, TextMate editor
Here is the problem:
I get 'float' object not callable
I'm forwarding this to the tutor list, as I'm swamped at work.
-- Forwarded message --
From: Asrarahmed Kadri <[EMAIL PROTECTED]>
Date: Oct 12, 2006 9:17 AM
Subject: Re: [Tutor] Help with basic user-data file
To: Rob Andrews <[EMAIL PROTECTED]>
Thanks.
Can you please also tell me
I am looking for a way to use a plain text configuration file in a
Python program instead of hard-coded values. The configuration data
currently is in the form of a couple of lists and some triple-quoted
strings.
I was looking at the ConfigParser module, but I cannot see how to use
this format to
On 12/10/06, Danny Yoo <[EMAIL PROTECTED]> wrote:
On Thu, 12 Oct 2006, Michael Shulman wrote:> I'd like to make a scrolling background for a game I'm working on. I> was thinking, since it's all in orthographic view, that a horizontal> cylinder which rotates with a texture would simulate this very
On Thu, 12 Oct 2006, Michael Shulman wrote:
> I'd like to make a scrolling background for a game I'm working on. I
> was thinking, since it's all in orthographic view, that a horizontal
> cylinder which rotates with a texture would simulate this very well.
I have to admit I'm clueless about p
>> Date: Thu, 12 Oct 2006 01:46:44 -0700 (PDT)
>> From: anil maran <[EMAIL PROTECTED]>
>> Subject: do you know how to do this
>> To: Alan Gauld <[EMAIL PROTECTED]>
>>
>> The user, password and group are stored in a session on disk using
>> flup.middleware.session. You can change this to fit your n
> 1) More tutors so more chance of one finding an explanation you
> understand
Another advantage that can't be overstated is that of checks-and-balances:
if any one of the tutors here gives erroneous advice, the other tutors
here will provide error-correction. (I've had this happen for mysel
On 10/12/06, Asrarahmed Kadri <[EMAIL PROTECTED]> wrote:
Hello,
Sorry, but this is a very basic questions...
Can you tell me how to check the existence of a file..
to check if a file exists, you can use os.path.exists(path)
or look at http://python.org/doc/current/lib/module-os.path.html
Hello,
Sorry, but this is a very basic questions...
Can you tell me how to check the existence of a file..
Also if a file exists, and we open it in a write mode, it would be truncated to zero length. So what is the way out of this??#
Regards,
Asrar-- To HIM you shall return.
On Thu, 2006-10-12 at 06:19 -0700, johnf wrote:
> On Thursday 12 October 2006 00:31, Alan Gauld wrote:
> > > query = "SELECT * FROM DB WHERE NAME = %s" % (name)
> > > cursor.execute(query)
> >
> > There can be security issues with this style, especially
> > if the parameters can be modified by user
-- Forwarded message --From: shawn bright <[EMAIL PROTECTED]>Date: Oct 12, 2006 9:15 AM
Subject: Re: [Tutor] question about number of threadsTo: Kent Johnson <[EMAIL PROTECTED]>oh, well then i do not have anything to worry about. I was
talking about a move from 6 threads to 10. he
On 10/12/06, johnf <[EMAIL PROTECTED]> wrote:
On Thursday 12 October 2006 00:31, Alan Gauld wrote:> > query = "SELECT * FROM DB WHERE NAME = %s" % (name)> > cursor.execute(query)>> There can be security issues with this style, especially
> if the parameters can be modified by users - for example> y
shawn bright wrote:
> Hey there,
> i have an app that runs several processes as threads.
> using the threading.Thread()
>
> now, i have another app that does the same thing. Now, pretty soon, we
> will be combining all the features of the two packages together into one
> app.
>
> My question is
When a login name is being created, you can pull a list of existing
login names from file, and run a check to see if it is in the list. If
the new name is in the list, have it kick back a message telling the
user to try another name.
Also, your program could suggest a new user name in such a case,
It means there is no need of entering the data in the dictionary,??
How will I then implement the uniqueness of loginnames???
Thanks for the support.
regards,
Asrar
On 10/12/06, Rob Andrews <[EMAIL PROTECTED]> wrote:
To keep the information, the simplest solution is simply to save it ina text
Hey there,
i have an app that runs several processes as threads.
using the threading.Thread()
now, i have another app that does the same thing. Now, pretty soon, we
will be combining all the features of the two packages together into
one app.
My question is, is there a limit on how many threads
To keep the information, the simplest solution is simply to save it in
a text file that the program can load into memory when it starts up
again. For sensitive information like passwords, a little extra fuss
is generally merited.
When someone logs in, you can save a value like
time.strftime(time.c
On Thursday 12 October 2006 00:31, Alan Gauld wrote:
> > query = "SELECT * FROM DB WHERE NAME = %s" % (name)
> > cursor.execute(query)
>
> There can be security issues with this style, especially
> if the parameters can be modified by users - for example
> you read the values from a web page.
>
>
Dick Moores wrote:
> At 04:33 AM 10/12/2006, Kent Johnson wrote:
>> Looking at the code and your numbers, my guess is that the time to make
>> a Python function call on your computer is about 2 microseconds (20 msec
>> / 1). (I mean the entire overhead - looking up the function and
>> actually
Folks,
I am trying to modify the userManagement program given in Core Python Programming. It uses a dictionary to store user-password information. The usernames are the keys and the passwords are the values.
Now I want is to add a third element; last login time.
I want to store this information
At 04:33 AM 10/12/2006, Kent Johnson wrote:
>Looking at the code and your numbers, my guess is that the time to make
>a Python function call on your computer is about 2 microseconds (20 msec
>/ 1). (I mean the entire overhead - looking up the function and
>actually calling it.)
Hm. Does this t
This list does not provide private tutors as such. But you can ask
questions about topics that you don't understand on the web sites
(preferrably with a link to the page in question) and people will try
to clarify what is meant.
The advantages of the list approach are:
1) More tutors so more cha
Forwarding to the group...
--- anil maran <[EMAIL PROTECTED]> wrote:
> Date: Thu, 12 Oct 2006 01:46:44 -0700 (PDT)
> From: anil maran <[EMAIL PROTECTED]>
> Subject: do you know how to do this
> To: Alan Gauld <[EMAIL PROTECTED]>
>
> The user, password and group are stored in a session on disk
>
do you know of any private tutors to tach me python
thank you
Hotmail is evolving - be one of the first to try the Windows Live Mail Beta
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
please can you help me ?
i need a private tutor to learn me python , i know
this may seem strange but im finding it really difficult to learn ,
ive very website there is 'and im just not learning
, i would feel better iff i had someone teaching it me ,.
do you know of anyone who could help me
can any one please help
im looking for a personal tutor that can help me
with learning python .
im finding it alien to me as i am a beginer
ive tried numerous websites and i am still finding
it stranfe to .
can anyone help me ??
many thanks dean dermody
_
Dick Moores wrote:
> Why is random.choice so much slower than random.random()? In fact, by
> a factor of 12! And randint(). Some 25 times slower than random(). Why?
> (I know that random() is the basis for most of the other functions in
> the random module, and a look at random.py, though I don't
Dick Moores wrote:
> Why is random.choice so much slower than random.random()? In fact, by
> a factor of 12! And randint(). Some 25 times slower than random(). Why?
> (I know that random() is the basis for most of the other functions in
> the random module, and a look at random.py, though I don't
Why is random.choice so much slower than random.random()? In fact, by
a factor of 12! And randint(). Some 25 times slower than random(). Why?
(I know that random() is the basis for most of the other functions in
the random module, and a look at random.py, though I don't complete
understand it, g
> query = "SELECT * FROM DB WHERE NAME = %s" % (name)
> cursor.execute(query)
There can be security issues with this style, especially
if the parameters can be modified by users - for example
you read the values from a web page.
The cursor.execute() call has the ability to pass the parameters
Hello,
You guys gave fantastic advice for my last question about point in
polygon testing, thanks.
New question;
I'd like to make a scrolling background for a game I'm working on. I
was thinking, since it's all in orthographic view, that a horizontal
cylinder which rotates with a texture woul
59 matches
Mail list logo