Re: [Tutor] passing form data into a class

2007-07-30 Thread John Fouhy
On 31/07/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > is there a way for me to create a class that accepts a dictionary of > submitted data and uses each key ad value to create a corresponding member > variable ? The current way I do this is with a very long argument list, and > line by line

[Tutor] passing form data into a class

2007-07-30 Thread tpc247
dear fellow Python enthusiasts, let's say I have a dictionary of keys and values obtained from a form submitted by a user. For each submitted form I will create the Application and Candidate classes, and I want to be able to call Application(Candidate(**submitted_data)).display() to create an html

Re: [Tutor] attribute error - quick addition

2007-07-30 Thread Eric Brunson
Sara Johnson wrote: > No luck finding tutors. I don't make enough. Sara, Alan didn't say to find a tutor, he suggested you read a tutorial. You seem to be having problems with very basic python concepts and his suggestion was to take an hour or two and *read* some gentle introductions that w

Re: [Tutor] os.path.exists(path) returns false when the path actually exists!

2007-07-30 Thread Bob Gailer
Iyer wrote: > > > Just to check, try to do away with the backslashes. Windows will > accept > a path with forward slashes just as well: > > os.path.exists("c:/winnt/file_name") > > Nope, even, with the use of forward slashes in the path, it still > returns false > > What am I doing

Re: [Tutor] os.path.exists(path) returns false when the path actually exists!

2007-07-30 Thread John Fouhy
On 31/07/07, Iyer <[EMAIL PROTECTED]> wrote: > os.path.exists("c:/winnt/file_name") > > Nope, even, with the use of forward slashes in the path, it still returns > false > > What am I doing wrong here ? Type 'os.listdir("c:/winnt")' and see what it gives you. I haven't looked at the code, but I

Re: [Tutor] os.path.exists(path) returns false when the pathactually exists!

2007-07-30 Thread Tiger12506
> Just to check, try to do away with the backslashes. Windows will accept > a path with forward slashes just as well: > > os.path.exists("c:/winnt/file_name") > > Nope, even, with the use of forward slashes in the path, it still returns > false > > What am I doing wrong here ? > > This is driving

Re: [Tutor] attribute error - quick addition

2007-07-30 Thread Sara Johnson
No luck finding tutors. I don't make enough. It seems to be this script that's throwing me off. But I understand and I'll take what I've learned to date and something will work eventually. Thanks for your concern and support. Sara - Original Message From: Alan Gauld <[EMAIL PROT

Re: [Tutor] os.path.exists(path) returns false when the path actually exists!

2007-07-30 Thread Iyer
Just to check, try to do away with the backslashes. Windows will accept a path with forward slashes just as well: os.path.exists("c:/winnt/file_name") Nope, even, with the use of forward slashes in the path, it still returns false What am I doing wrong here ? This is driving me nuts!

Re: [Tutor] attribute error - quick addition

2007-07-30 Thread Alan Gauld
"Sara Johnson" <[EMAIL PROTECTED]> wrote > Sorry... I'm still learning about lists, tuples, etc... Sarah, You've been hanging around with this list for a few weeks now. If you just took one day out to go through the official tutorial then you should know enough to answer all of these questions

Re: [Tutor] comparing lists, __lt__ and __gt__

2007-07-30 Thread Tiger12506
> That having been saisd their is another use for >> which is to append > output to a file, as in: > > print 'hello world' >> myfile > > sends the string to myfile instead of to stdout. (Although I couldn't > get this to > work when I tried it!) > > Alan G. >From Dive Into Python Section 10.2

Re: [Tutor] attribute error - quick addition

2007-07-30 Thread Sara Johnson
Sorry... I'm still learning about lists, tuples, etc... Thanks, Sara - Original Message From: Tiger12506 <[EMAIL PROTECTED]> To: tutor@python.org Sent: Monday, July 30, 2007 5:42:47 PM Subject: Re: [Tutor] attribute error - quick addition > Thanks Alan and Kent (for the sorting notes

Re: [Tutor] build a really simple "json" api from a db

2007-07-30 Thread Kent Johnson
Picio wrote: > Hi Kent, ok I've decided to go through Django. Now the clue is to find > some simple guide to > output json from my model and maybe I can benefit also for the url > dispatcher to map in a clean way the request coming from my ajax app. > > This is what I'd like to do: > > ajax app->

Re: [Tutor] attribute error - quick addition

2007-07-30 Thread Tiger12506
> Thanks Alan and Kent (for the sorting notes)! > > Alan...I guess I thought outfile2 had data. { i.e., > outfile2=open('missmeas.dat','w') } Argghh!!! No, no, no! Attribute Error! No matter how much data you have in the file, you will *never* be able to call sort on it, because file objects d

Re: [Tutor] build a really simple "json" api from a db

2007-07-30 Thread Eric Brunson
Picio wrote: > The beginning idea was to build a json API myself. Since I need only > to generate json from a db, maybe Django is too much. I'm a Django > beginner. I don't know Turbogears. > I've not found anything like: "how to build a json api". > Maybe MySqldb+simplejson is the enough? > Or > I

Re: [Tutor] build a really simple "json" api from a db

2007-07-30 Thread Picio
Hi Kent, ok I've decided to go through Django. Now the clue is to find some simple guide to output json from my model and maybe I can benefit also for the url dispatcher to map in a clean way the request coming from my ajax app. This is what I'd like to do: ajax app-> URL -> urls.py -> view.py ->

Re: [Tutor] build a really simple "json" api from a db

2007-07-30 Thread Kent Johnson
Picio wrote: > The beginning idea was to build a json API myself. Since I need only > to generate json from a db, maybe Django is too much. I'm a Django > beginner. I don't know Turbogears. > I've not found anything like: "how to build a json api". > Maybe MySqldb+simplejson is the enough? I guess

Re: [Tutor] attribute error - quick addition

2007-07-30 Thread Sara Johnson
Thanks Alan and Kent (for the sorting notes)! Alan...I guess I thought outfile2 had data. { i.e., outfile2=open('missmeas.dat','w') } My mistake. Thanks, Sara - Original Message From: Alan Gauld <[EMAIL PROTECTED]> To: tutor@python.org Sent: Sunday, July 29, 2007 7:00:12 PM Subject

Re: [Tutor] Sum of Scores

2007-07-30 Thread Tiger12506
> So normally, after the period is up, it would choose a new seed? or does > it repeat after the period whether or not the time has changed? It would repeat whether or not the time has changed, naturally. How would the algorithm know when the period has finished? The mersenne twister is based o

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Kent Johnson
Amit Saxena wrote: > ya i m trying to execute the procedure,these were the contents of that > SQL file which i m trying to execute Then (paraphrasing Greg's earlier response) you need something like query = "SELECT Create_Process_Team(%(org_id)s, %(org_desc)s, %(org_team)s, %(sessioner_id)s)" re

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
ya i m trying to execute the procedure,these were the contents of that SQL file which i m trying to execute On 7/30/07, Kent Johnson <[EMAIL PROTECTED]> wrote: > > Your original query asked how to execute an existing stored procedure. > This is the SQL code to *create* a stored procedure. Are you

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Kent Johnson
Your original query asked how to execute an existing stored procedure. This is the SQL code to *create* a stored procedure. Are you trying to create it or execute it? Kent Amit Saxena wrote: > this is the file content of "metadata.sql" > > set serveroutput on > > CREATE OR REPLACE PROCEDURE C

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Greg Lindstrom
I've never tried anything like that before; others may be of more help at this point. What I would try is reading the contents of the file into a local variable. my_data = file('metadata.sql').readlines() # read the file into a list query = ''.join(my_data) # append th

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
this is the file content of "metadata.sql" set serveroutput on CREATE OR REPLACE PROCEDURE Create_Process_Team (org_id IN VARCHAR2, org_desc IN VARCHAR2, org_team IN VARCHAR2, sessioner_id IN VARCHAR2) IS ptt_id KCM_PROCESS_TEAM_TEMPLATE.ID%TYPE; pt_id KCM_PROCESS_TEAM.ID%TYPE; BEGIN selec

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
It is a complete PL/SQL Cursor which is written in this "metadata.sql" file On 7/30/07, Greg Lindstrom <[EMAIL PROTECTED]> wrote: > > > > On 7/30/07, Amit Saxena <[EMAIL PROTECTED]> wrote: > > > > > > I m still not able to run a Procedure > > > > from cx_Oracle import makedsn > > import adodb > >

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Greg Lindstrom
On 7/30/07, Amit Saxena <[EMAIL PROTECTED]> wrote: > > > I m still not able to run a Procedure > > from cx_Oracle import makedsn > import adodb > > db = adodb.NewADOConnection('oci8') > connection_string = makedsn("10.200.91.27 ", 1521, "scorpio") #<== your > values here, of course > db.Connect(c

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
I m still not able to run a Procedure from cx_Oracle import makedsn import adodb db = adodb.NewADOConnection('oci8') connection_string = makedsn("10.200.91.27", 1521, "scorpio") #<== your values here, of course db.Connect(connection_string, "kcmdev", "devkcm") #<== and here, too #query = "SEL

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Greg Lindstrom
My Oracle connection is set up using the adodb module ( http://adodb.sourceforge.net/). I don't remember why we set it up that way...we haven't touched this part of our code for almost 2 years!. from cx_Oracle import makedsn import adodb db = adodb.NewADOConnection('oci8') connection_string = ma

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Amit Saxena
I m on Windows Platform, was trying to use cx_oracle library but no success On 7/30/07, Greg Lindstrom <[EMAIL PROTECTED]> wrote: > > >Can anybody help me in how to connect Python to oracle and then to > execute > >an already existing PL/SQL Procedure through Python. > > What platform are you runn

Re: [Tutor] How can I execute a PL/SQL Procedure directly through

2007-07-30 Thread Greg Lindstrom
>Can anybody help me in how to connect Python to oracle and then to execute >an already existing PL/SQL Procedure through Python. What platform are you running? Windows? Linux? Mac? I've used Oracle and plSql for years and will be happy to help out once I know what you need. --greg __

[Tutor] How can I execute a PL/SQL Procedure directly through python rather than executing it through Command Prompt

2007-07-30 Thread Amit Saxena
Hi Can anybody help me in how to connect Python to oracle and then to execute an already existing PL/SQL Procedure through Python. -- Thanks and Regards, Amit Saxena Senior QA Engineer Ketera Direct: +91 4199 5028 Mobile: +91 99001 18641 [EMAIL PROTECTED] » Visit us at http://www.ketera.com » W