Re: Problem Displaying Pics

2009-10-08 Thread Victor Subervi
, Oct 8, 2009 at 11:43 AM, Gabriel Genellina wrote: > En Thu, 08 Oct 2009 12:30:16 -0300, Victor Subervi < > victorsube...@gmail.com> escribió: > > http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1 >> >> On Wed, Oct 7, 2009 at 4:11 PM, Rami Chowdhury > >

Re: Nested Menus

2009-10-09 Thread Victor Subervi
Hmm. I didn't bother to look at the "comparison post". The indenting looks right to me. I reread my post and I believe my question is straight-forward. The crux of the issue is my sentence at the bottom. I believe that details what my objective is. Not sure what I should do here. I hope you can cla

Re: Nested Menus

2009-10-09 Thread Victor Subervi
h it. (And thank you Dennis!) V On Fri, Oct 9, 2009 at 11:13 AM, Stephen Hansen wrote: > > > On Fri, Oct 9, 2009 at 7:13 AM, Victor Subervi wrote: > >> Hmm. I didn't bother to look at the "comparison post". The indenting looks >> right to me. I reread my post an

Zip Question

2009-10-09 Thread Victor Subervi
Hi; I have the following code: elif table[0] == 't': # This is a store subtype table bits = string.split(table, '0') sst.append(bits[2]) sstp.append(bits[1]) subtypes = dict(zip(sstp, sst)) When I print these out to screen, I get this: sst: ['doctors', 'patient'] sstp: ['

Re: Zip Question

2009-10-09 Thread Victor Subervi
sstp.append(bits[1]) subtypes = dict(zip(sstp, sst)) print sst print '' print sstp print '' print subtypes print '' This is what prints out: ['doctors', 'patient'] ['prescriptions', 'prescriptions'] {'pre

Re: Zip Question

2009-10-09 Thread Victor Subervi
So, because the results in sstp were duplicates ( ['prescriptions', 'prescriptions'] ) it only returned one result in the dict(zip()) statement. Weird. Bug or feature? ;) Thanks, V On Fri, Oct 9, 2009 at 12:37 PM, Stephen Hansen wrote: > > > Changing the line: >> subtypes = dict(zip(sstp, sst))

Re: Zip Question

2009-10-10 Thread Victor Subervi
Ah! Thanks :) V On Fri, Oct 9, 2009 at 1:10 PM, Stephen Hansen wrote: > > > On Fri, Oct 9, 2009 at 11:04 AM, Victor Subervi > wrote: > >> So, because the results in sstp were duplicates ( ['prescriptions', >> 'prescriptions'] ) it only returned on

Re: Nested Menus

2009-10-10 Thread Victor Subervi
in line responses... On Thu, Oct 8, 2009 at 5:58 PM, Dennis Lee Bieber wrote: > On Thu, 8 Oct 2009 10:38:02 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > >First suggestion... Get rid of the confusing dat[0] and dat[1] and > use nam

It Doesn't Add Up!

2009-10-12 Thread Victor Subervi
Hi; I have the following code: for row in data: i += 1 total = 0 quantity = form.getfirst('order_' + str(i), '') if quantity != '': sql = 'select * from products p join %s c on p.ID=c.ID where c.ID=%s;' % (client, str(i)) cursor.execute(sql) stuf

Re: It Doesn't Add Up!

2009-10-12 Thread Victor Subervi
Ouch! You're right! <;) V On Mon, Oct 12, 2009 at 1:38 PM, Rami Chowdhury wrote: > On Mon, 12 Oct 2009 11:33:31 -0700, Victor Subervi < > victorsube...@gmail.com> wrote: > > Hi; >> I have the following code: >> >>for row in data: >> i +

os.chmod problem

2009-10-13 Thread Victor Subervi
Hi; I have the following code: if 13 < x < 20: y += 1 w += 1 try: getpic = "getpic" + str(w) + ".py" try: os.remove(getpic) except: pass code = """#! /usr/bin/pytho

Re: os.chmod problem

2009-10-13 Thread Victor Subervi
Never mind. I just discovered that os.chmod requires 0755, not just 755. V On Tue, Oct 13, 2009 at 9:26 AM, Victor Subervi wrote: > Hi; > I have the following code: > > if 13 < x < 20: > y += 1 > w += 1 > try: >

Re: Nested Menus

2009-10-13 Thread Victor Subervi
This is probably more appropriate for the MySQL list, but since this is Dennis' pseudo-code... Dennis wrote the following: cursor.execute("""create table if not exists Relationship (ID integer auto_increment primary key, Parent integer not null, foreign key (Categories.ID), Chi

Yet Another Pic Problem

2009-10-15 Thread Victor Subervi
Hi; My code was working fine then I must have inadvertently screwed something up. The result is a mysql insert/update statement that looks something like the following: update productsX set Name=%s, Title=%s, Description=%s, Price=%s, Bedrooms=%s, Bathrooms=%s, Conditions=%s, Acreage=%s, Construct

Re: Yet Another Pic Problem

2009-10-16 Thread Victor Subervi
and the only differences between them are that the first have the strings in quotes AND there is a % sign between the string widgets and the variables that replace them. That's it! Wonder what the *#&^%( difference that makes. V On Thu, Oct 15, 2009 at 3:20 PM, Bram Mertens wrote: >

More & More Fun w/ Pics & MySQL

2009-10-16 Thread Victor Subervi
Hi; Okay, here's the code: #! /usr/bin/python import cgitb; cgitb.enable() import MySQLdb import cgi import sys,os sys.path.append(os.getcwd()) from login import login def pic(): user, passwd, db, host = login() form = cgi.FieldStorage() db = MySQLdb.connect(host, user, passwd, db) cursor=

Re: More & More Fun w/ Pics & MySQL

2009-10-16 Thread Victor Subervi
I was trying all sorts of crap. I tried it without, too. Still didn't work :( V On Fri, Oct 16, 2009 at 4:42 PM, Carsten Haese wrote: > Victor Subervi wrote: > > [snip...] > > > > print 'Content-type: image/jpeg' > > print 'Content-Encoding: b

Re: More & More Fun w/ Pics & MySQL

2009-10-16 Thread Victor Subervi
is pretty clear. TIA, V On Fri, Oct 16, 2009 at 7:54 PM, Carsten Haese wrote: > Victor Subervi wrote: > > I was trying all sorts of crap. I tried it without, too. Still didn't > > work :( > > Please help us help you. "Still didn't work" tells us nothing. Se

Re: More & More Fun w/ Pics & MySQL

2009-10-17 Thread Victor Subervi
bly no longer worked. Then, lo and behold, when I came back to this code that I hadn't touched and was working fine earlier this week, it no longer works. Lovely. My "plug-and-play" program has devoured two weeks of my time and I'm still up the creek without a paddle. Sure would a

Re: More & More Fun w/ Pics & MySQL

2009-10-17 Thread Victor Subervi
in line... On Sat, Oct 17, 2009 at 11:33 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Let me clarify. This prints out "all sorts of crap", which means an > > image string, the image as a string, to the screen: > > > > print 'Content-type: image

Re: More & More Fun w/ Pics & MySQL

2009-10-18 Thread Victor Subervi
Sorry it was so difficult to communicate that to you. Thanks again, V On Sat, Oct 17, 2009 at 2:57 PM, Neo wrote: > Hi, > > Victor Subervi schrieb: > > Let me clarify. This prints out "all sorts of crap", which means an > > image string, the image as a string

Capturing a var from JavaScript

2009-10-18 Thread Victor Subervi
Hi; I have the following code: #!/usr/bin/python def getResolution(): print 'Content-Type: text/html\n' print ''' http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd'> var winX = screen.width; var winY = screen.height; ''' x = eval('document.write(winX)') #document.write('Your screen re

The Never-Ending Saga Continues

2009-10-19 Thread Victor Subervi
Hi; Now that we know for sure that my code isn't to blame for not being able to download/access images from MySQL I have contacted my hosting service to see if they will do anything about it. Presuming they won't, I need to find a work-around. What I am looking for is a way to upload data into MyS

Re: Capturing a var from JavaScript

2009-10-19 Thread Victor Subervi
Yeah, I know, but if I use CGI then I have to pass variables in the URL, and I was trying to avoid that. Thanks, V On Mon, Oct 19, 2009 at 12:50 PM, geremy condra wrote: > On Mon, Oct 19, 2009 at 11:41 AM, Victor Subervi > wrote: > > Hey, that's great! Can do it in python? Fa

Re: The Never-Ending Saga Continues

2009-10-19 Thread Victor Subervi
this easy (transparent) for my client. Let her just fill out a form and be done with it. TIA, V On Mon, Oct 19, 2009 at 2:58 PM, Rami Chowdhury wrote: > On Mon, 19 Oct 2009 11:51:04 -0700, Victor Subervi < > victorsube...@gmail.com> wrote: > > What I am looking for is a way to

Re: The Never-Ending Saga Continues

2009-10-19 Thread Victor Subervi
Can you give me an example of this? V On Mon, Oct 19, 2009 at 4:03 PM, Rami Chowdhury wrote: > On Mon, 19 Oct 2009 12:56:19 -0700, Victor Subervi < > victorsube...@gmail.com> wrote: > > Of course. >> 1) I need to upload data: images and other fields (mainly varchar, int)

OT Virtual Server Host

2009-10-25 Thread Victor Subervi
Hi; Completely OT, but my back's up against the wall. I'm convinced that the reason my codes keep breaking--and even stable installations of s/w from SourceForge such as SimpleMail--on the hosts I've been using is because their hardware should have conservatively been trashed 5 years ago. It's simp

Re: OT Virtual Server Host

2009-10-26 Thread Victor Subervi
0:55 PM, geremy condra wrote: > On Sun, Oct 25, 2009 at 2:52 PM, Victor Subervi > wrote: > > Hi; > > Completely OT, but my back's up against the wall. I'm convinced that the > > reason my codes keep breaking--and even stable installations of s/w from > > SourceFo

Re: OT Virtual Server Host

2009-10-26 Thread Victor Subervi
You're saving my neck, man. Thanks!!! V On Mon, Oct 26, 2009 at 11:10 AM, Ryan Lynch wrote: > On Mon, Oct 26, 2009 at 10:56, Victor Subervi > wrote: > > YES, that is what I want! How do I google this service? Or just flat-out > > recommend one for me (or both). Goo

datetime question

2009-10-30 Thread Victor Subervi
Hi; I have this code: today = datetime.date.today() day = today.day mo = today.month yr = today.year Works great. What I need to calculate is the length of days in the given month. How do I do that? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: datetime question

2009-10-31 Thread Victor Subervi
Thanks, Rami, that will work. V On Sat, Oct 31, 2009 at 4:54 AM, Albert Hopkins wrote: > On Sat, 2009-10-31 at 20:34 +1100, Ben Finney wrote: > > Fixing ‘time’, ‘datetime’, and ‘calendar’ was the reason for Python 3? > > No, it wasn't. > > > > Or perhaps you mean that any backward-incompatible ch

Calendar Problem

2009-11-03 Thread Victor Subervi
Hi; I have the following: import calendar, datetime myCal = calendar.calendar(6) today = datetime.date.today() day = today.day mo = today.month yr = today.year month = myCal.monthdayscalendar(yr, mo) The last line throws errors no matter how I try and tweak it. The current incarnation complains

Re: Calendar Problem

2009-11-04 Thread Victor Subervi
Well, you're right. That's what I initially had. My server, that I am in the process of leaving, rejected that syntax. Lovely. Thanks, V On Tue, Nov 3, 2009 at 6:56 PM, Dave Angel wrote: > > > MichaB Klich wrote: > >> Dnia wtorek 03 listopada 2009 o 20:50

Serious Privileges Problem: Please Help

2009-11-07 Thread Victor Subervi
I have a serious privileges problem that is making it impossible to serve python pages on a CentOS server. It appears that nobody on the CentOS discussion list has a solution to this problem. I'm desperate and hoping someone on this list can help. [Fri Nov 06 11:50:40 2009] [error] [client 66.248.

Can't Find Module

2009-11-07 Thread Victor Subervi
Hi; I'm getting this error: Mod_python error: "PythonHandler mod_python.publisher" Traceback (most recent call last): File "/usr/lib64/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch result = object(req) File "/usr/lib64/python2.4/site-packages/mod_python/pub

Re: Serious Privileges Problem: Please Help

2009-11-07 Thread Victor Subervi
tsd_sales_tax_dealer_or_purchaser_exemption_certificate_st5.pdf On Sat, Nov 7, 2009 at 4:09 PM, Rami Chowdhury wrote: > On Saturday 07 November 2009 06:13:11 Victor Subervi wrote: > > I have a serious privileges problem that is making it impossible to serve > > python pages on a CentOS ser

Re: Serious Privileges Problem: Please Help

2009-11-08 Thread Victor Subervi
ill it. Furthermore, [r...@13gems global_solutions]# ps wax|grep selinux 17645 pts/0S+ 0:00 grep selinux Please advise. V On Sat, Nov 7, 2009 at 5:49 PM, Rami Chowdhury wrote: > > On Saturday 07 November 2009 13:51:06 Victor Subervi wrote: > > httpd.conf: > > > > > &g

Re: Serious Privileges Problem: Please Help

2009-11-08 Thread Victor Subervi
obal_solutions/ [Sun Nov 08 09:38:44 2009] [error] [client 66.248.168.98] Premature end of script headers: index.py, referer: http://209.216.9.56/global_solutions/ TIA, V On Sun, Nov 8, 2009 at 12:28 PM, Rami Chowdhury wrote: > On Sunday 08 November 2009 05:44:31 Victor Subervi wrote: > >

CGI vs mod_python

2009-11-09 Thread Victor Subervi
Hi; I've been told by a server farm that they're having trouble getting my scripts to work because they're written with cgi calls as opposed to mod_python. Is there a basis for their complaint? These pages serve fine on another server. TIA, Victor -- http://mail.python.org/mailman/listinfo/python

Re: CGI vs mod_python

2009-11-09 Thread Victor Subervi
Yes, obviously. But if CGI is enabled, it should work anyway, should it not? V On Mon, Nov 9, 2009 at 9:46 AM, sstein...@gmail.com wrote: > > On Nov 9, 2009, at 9:32 AM, Victor Subervi wrote: > > Hi; >> I've been told by a server farm that they're having trouble g

Re: CGI vs mod_python

2009-11-09 Thread Victor Subervi
Uuuuh. Thanks! V On Mon, Nov 9, 2009 at 10:45 AM, sstein...@gmail.com wrote: > On Nov 9, 2009, at 10:41 AM, Victor Subervi wrote: > > On Mon, Nov 9, 2009 at 10:29 AM, sstein...@gmail.com > wrote: > >> >> On Nov 9, 2009, at 10:18 AM, Victor Subervi wrote: >>

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Victor Subervi
Did you give up on me? V On Sun, Nov 8, 2009 at 12:40 PM, Victor Subervi wrote: > [r...@13gems angrynates.com]# chcon -R -h > unconfined_u:object_r:httpd_sys_content_t global_solutions/* > > Then I surfed to > http://209.216.9.56/global_solutions/index.py > > [r...@13gems

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Victor Subervi
; return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> ''' print " ''

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Victor Subervi
On Mon, Nov 9, 2009 at 1:53 PM, Rami Chowdhury wrote: > On Mon, 09 Nov 2009 10:36:31 -0800, Victor Subervi < > victorsube...@gmail.com> wrote: > > Of course. Let me start with some updates to httpd.conf, which didn't help >> anyway: >> >> >> Server

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Victor Subervi
On Mon, Nov 9, 2009 at 2:30 PM, Victor Subervi wrote: > > On Mon, Nov 9, 2009 at 2:27 PM, Rami Chowdhury > wrote: > >> On Mon, 09 Nov 2009 11:24:33 -0800, Victor Subervi < >> victorsube...@gmail.com> wrote: >> >> On Mon, Nov 9, 2009 at 1:53 PM, Rami Ch

Re: Serious Privileges Problem: Please Help

2009-11-10 Thread Victor Subervi
a pain in the &(%( Thanks for everyone's help! V On Mon, Nov 9, 2009 at 9:12 PM, Dave Angel wrote: > Victor Subervi wrote: > >> On Mon, Nov 9, 2009 at 2:30 PM, Victor Subervi > >wrote: >> >> >> >>> On Mon, Nov 9, 2009 at 2:27 PM, Rami Chowd

Calendar Stuff

2009-11-10 Thread Victor Subervi
Hi; I have the following code: import calendar, datetime def cal(): ... myCal = calendar.Calendar(calendar.SUNDAY) today = datetime.date.today() day = today.day mo = today.month yr = today.year # month = myCal.monthdayscalendar(int(time.strftime("%Y")) month = myCal.monthdayscalend

Re: Calendar Stuff

2009-11-10 Thread Victor Subervi
On Tue, Nov 10, 2009 at 2:02 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I have the following code: >> >> import calendar, datetime >> >> def cal(): >> ... >> myCal = calendar.Calendar(calendar.SUNDAY) >> today = datetime.

Can't Write File

2009-11-10 Thread Victor Subervi
Hi; I've determined the problem in a script is I can't open a file to write it: script = open(getpic, "w") # where getpic is already defined Here are the permissions: -rwxr-xr-x 1 root root 4649 Nov 10 12:31 start.py What am I doing wrong? TIA, Victor -- http://mail.python.org/mailman/listinfo/

Re: Can't Write File

2009-11-10 Thread Victor Subervi
On Tue, Nov 10, 2009 at 3:41 PM, Rami Chowdhury wrote: > On Tue, 10 Nov 2009 12:38:36 -0800, Victor Subervi < > victorsube...@gmail.com> wrote: > > Hi; >> I've determined the problem in a script is I can't open a file to write >> it: >> script

Re: Calendar Stuff

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 1:12 AM, Simon Forman wrote: > On Tue, Nov 10, 2009 at 12:53 PM, Victor Subervi > wrote: > > Hi; > > I have the following code: > > > > import calendar, datetime > > > > def cal(): > > ... > >

Re: CGI vs mod_python

2009-11-11 Thread Victor Subervi
On Tue, Nov 10, 2009 at 6:12 PM, John Nagle wrote: > sstein...@gmail.com wrote: > >> >> On Nov 9, 2009, at 10:18 AM, Victor Subervi wrote: >> >> Yes, obviously. But if CGI is enabled, it should work anyway, should it >>> not? >>> >> >>

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: > Victor Subervi wrote: > >> Hi; >> I've determined the problem in a script is I can't open a file to write >> it: >> script = open(getpic, "w") # where getpic is already defined >> Here a

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury wrote: > On Wed, 11 Nov 2009 06:00:44 -0800, Victor Subervi < > victorsube...@gmail.com> wrote: > > On Tue, Nov 10, 2009 at 4:33 PM, Dave Angel wrote: >> >> Victor Subervi wrote: >>> >> > Wron

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 11:58 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Here's > > a bigger code snippet with the entire try clause: > > > > if 14 < x < 20: # This just shows that it's a pic, not some > > other type of d

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 1:20 PM, Benjamin Kaplan wrote: > On Wed, Nov 11, 2009 at 11:42 AM, Victor Subervi > wrote: > > On Wed, Nov 11, 2009 at 11:23 AM, Rami Chowdhury < > rami.chowdh...@gmail.com> > > wrote: > >> > >> On Wed, 11 Nov 20

Re: Can't Write File

2009-11-11 Thread Victor Subervi
Never mind. It appears my old original file from a couple of years ago prints out the image nicely. Thanks all! V On Wed, Nov 11, 2009 at 2:26 PM, Victor Subervi wrote: > On Wed, Nov 11, 2009 at 1:20 PM, Benjamin Kaplan > wrote: > >> On Wed, Nov 11, 2009 at 11:42 AM, Victor Su

Re: Can't Write File

2009-11-11 Thread Victor Subervi
On Wed, Nov 11, 2009 at 2:46 PM, Rami Chowdhury wrote: > Now, the problem is that it doesn't print the picture. It prints only the >> url. Please try: >> http://angrynates.com/stcroixresort/cart/getpic.py?w=1&i=1 >> Now, if I go into mysql and the correct database and enter: >> select pic1 from pr

Re: Can't Write File

2009-11-12 Thread Victor Subervi
On Wed, Nov 11, 2009 at 6:35 PM, Rhodri James wrote: > On Wed, 11 Nov 2009 14:00:44 -0000, Victor Subervi < > victorsube...@gmail.com> wrote: > > 6) you don't indicate which user is executing this script (only root can >>> write to it) >>> >>>

Re: CGI vs mod_python

2009-11-12 Thread Victor Subervi
On Wed, Nov 11, 2009 at 3:32 PM, Dave Angel wrote: > > > Victor Subervi wrote: > >> >> >> The problem was not CGI. It turned out to be line-endings being mangled by >> Windoze and __invisible __ in my unix editor. Lovely. >> Thanks anyway, >> V &

(OT) Recommend FTP Client

2009-11-12 Thread Victor Subervi
Hi; Someone on this list just recommended I find an ftp client that enables me to change line endings. He indicated that it would be easy, but googling I haven't been able to find one. I would prefer a free client, but whatever. Please send me a recommendation. TIA, Victor -- http://mail.python.or

Re: (OT) Recommend FTP Client

2009-11-12 Thread Victor Subervi
Thanks. V On Thu, Nov 12, 2009 at 2:26 PM, Dave Angel wrote: > > > Victor Subervi wrote: > >> Hi; >> Someone on this list just recommended I find an ftp client that enables me >> to change line endings. He indicated that it would be easy, but googling I >> ha

base64MIME problem, Or Just New Email Client

2009-11-18 Thread Victor Subervi
Hi; I'm using SimpleMail, available from SF, that used to work fine for me but now I can't build it on my new server. I get this error: [Tue Nov 17 09:53:13 2009] [error] [client 208.84.198.58] import smtplib, referer: http://globalsolutionsgroup.vi/display_spreadsheet.py [Tue Nov 17 09:53:13

A Good Mailer

2009-11-18 Thread Victor Subervi
Hi; I need a good mailer that will enable me to mail email from web forms. Suggestions? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: A Good Mailer

2009-11-19 Thread Victor Subervi
On Wed, Nov 18, 2009 at 6:30 PM, Nick Stinemates wrote: > On Wed, Nov 18, 2009 at 03:27:11PM -0400, Victor Subervi wrote: > > Hi; > > I need a good mailer that will enable me to mail email from web forms. > > smtplib > > > Suggestions? > > silly example.

Python Will Not Send Email!!

2009-11-19 Thread Victor Subervi
Hi; I created this testMail.py file as root: #!/usr/bin/env python import smtplib session = smtplib.SMTP("localhost") subject = "Hello, " header = "Subject: %s \r\nContent-type: text/html; charset=utf-8\r\n\r\n" message = "world!" email_from = "vic...@is.awesome" email_to = ["em...@myhost.com"] se

Re: Python Will Not Send Email!!

2009-11-19 Thread Victor Subervi
On Thu, Nov 19, 2009 at 11:28 AM, Victor Subervi wrote: > Hi; > I created this testMail.py file as root: > > #!/usr/bin/env python > import smtplib > session = smtplib.SMTP("localhost") > subject = "Hello, " > header = "Subject: %s \r\nContent-

Re: Python Will Not Send Email!!

2009-11-20 Thread Victor Subervi
On Thu, Nov 19, 2009 at 5:01 PM, Kev Dwyer wrote: > On Thu, 19 Nov 2009 11:28:37 -0400, Victor Subervi wrote: > > Hello Victor, > > There are some pages on the internet that suggest that this problem my be > caused by a module named email.py (or email.pyc) in your pythonp

Too Many Values To Unpack

2009-11-20 Thread Victor Subervi
Hi; At one point Dennis Lee Bieber helped me with the following slightly modified code: #!/usr/bin/python import sys,os sys.path.append(os.getcwd()) import MySQLdb from login import login import re, string def printTree(aTree, level=0): tree = [] for name in sorted(aTree.keys()): tree.ap

Re: Python Will Not Send Email!!

2009-11-20 Thread Victor Subervi
On Fri, Nov 20, 2009 at 11:05 AM, Kev Dwyer wrote: > I ran your script on a CentOS vm (5.2 server 32bit, not quite the same as > yours but also running python 2.4.3). It ran without error. So I > suspect that either you have a rogue email module/package on your machine > or there's something wr

Re: Python Will Not Send Email!!

2009-11-20 Thread Victor Subervi
On Fri, Nov 20, 2009 at 11:14 AM, Carsten Haese wrote: > Kevin neglected to mention that the new interpreter session must be > started in the same directory as the one you're in when you run your > testMail.py script. Since he didn't mention that, we can't be sure that > that's what you did, so th

Serve Pages Under Different Ownership

2009-11-20 Thread Victor Subervi
Hi; I'm building a new server after many years hiatus. I currently can only serve python pages chown'd to root. How do I change this? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Too Many Values To Unpack

2009-11-20 Thread Victor Subervi
On Fri, Nov 20, 2009 at 12:14 PM, Shashank Singh < shashank.sunny.si...@gmail.com> wrote: > Are you sure your key values are 2-tuples in levelDict? > No. Here's some tweaked code: cursor.execute('select category from categories order by category') theTree = expand(cursor.fetchall())

Re: Python Will Not Send Email!!

2009-11-20 Thread Victor Subervi
On Fri, Nov 20, 2009 at 12:38 PM, Carsten Haese wrote: > Thank you. This proves conclusively that there IS in fact a file called > email.pyc (and/or email.py) in your directory next to testMail.py. It is > this email.pyc that is being imported instead of the email.py from the > Python library. Get

Problem w/ smtplib

2009-11-21 Thread Victor Subervi
Hi; I get the following error: /var/www/html/globalsolutionsgroup.vi/mailSpreadsheet.py52 session.sendmail(clientEmail, ourEmail1, header+msg) 53 # session.sendmail(clientEmail, ourEmail2, header+msg) 54 55 mailSpreadsheet() 56 *mailSpreadsheet* = /var/www/html/globalsol

crontab problem

2009-11-21 Thread Victor Subervi
Hi; I have the following in crontab -eu root: @daily /usr/local/bin/mysql-backup-daily.sh @weekly /usr/local/bin/mysql-backup-weekly.sh @monthly /usr/local/bin/mysql-backup-monthly.sh [r...@13gems globalsolutionsgroup.vi]# ls /usr/local/bin/mysql-* /usr/local/bin/mysql-daily.sh /usr/local/bin/mys

Re: crontab problem

2009-11-21 Thread Victor Subervi
On Sat, Nov 21, 2009 at 8:59 AM, Chris Rebert wrote: > > And this is germane to Python (and not instead say, *nix) how exactly? > Oops! Wrong list! -- http://mail.python.org/mailman/listinfo/python-list

Re: Too Many Values To Unpack

2009-11-21 Thread Victor Subervi
On Sat, Nov 21, 2009 at 2:10 AM, Dennis Lee Bieber wrote: >And my follow-up to that original thread stated that it /was/ > pseudo-code, not something tested. My goal was to illustrate the > general concepts of processing a recursive/nested data set stored in a > flat/relational table. >

Re: Problem w/ smtplib

2009-11-21 Thread Victor Subervi
On Sat, Nov 21, 2009 at 12:04 PM, Kev Dwyer wrote: > On Sat, 21 Nov 2009 08:19:52 -0500, Victor Subervi wrote: > > Hello Victor, > > The information that you have sent comes from the client side of the > transaction, so it isn't possible to tell why the server disconnected

Re: Problem w/ smtplib

2009-11-21 Thread Victor Subervi
On Sat, Nov 21, 2009 at 1:16 PM, Kev Dwyer wrote: > > 2009/11/21 Victor Subervi > > On Sat, Nov 21, 2009 at 12:04 PM, Kev Dwyer wrote: >> >>> On Sat, 21 Nov 2009 08:19:52 -0500, Victor Subervi wrote: >>> >>> Hello Victor, >>> >>> T

Scripts Only Run In Root

2009-11-22 Thread Victor Subervi
Hi; I can only run my python scripts on my server if they are owned by root. How do I change that? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Scripts Only Run In Root

2009-11-22 Thread Victor Subervi
On Sun, Nov 22, 2009 at 1:30 PM, Martijn Arts wrote: > If it's a UNIX server you can use Chown in the command line. Try "man > chown" first to see how it works. > This is strange. I'd tried chown'ing before and was always getting 403 errors. Just to make sure that's what the problem was, I did it

Switching Databases

2009-11-23 Thread Victor Subervi
Hi; I have the following code: import MySQLdb ... user, passwd, db, host = login() db = MySQLdb.connect(host, user, passwd, 'cart') cursor= db.cursor() ... cursor.close() db = MySQLdb.connect(host, user, passwd, db) cursor= db.cursor() Now, python complains about me opening a new connection. But

Re: Switching Databases

2009-11-23 Thread Victor Subervi
On Mon, Nov 23, 2009 at 9:17 AM, Carsten Haese wrote: > You thought you did, but did you? The code snippet above doesn't show > any code that closes a database connection. > Would you be so kind as to tell me exactly what code *does* close a database, then? That would solve this handily. Other th

Re: Switching Databases

2009-11-23 Thread Victor Subervi
On Mon, Nov 23, 2009 at 10:08 AM, Carsten Haese wrote: > As I said, the best way we can help you is if you copy the actual error > message so that we may diagnose the actual problem and suggest a > solution that fixes the problem. > That gave me the idea that I should simply open two separate con

Re: Switching Databases

2009-11-23 Thread Victor Subervi
On Mon, Nov 23, 2009 at 10:59 AM, Carsten Haese wrote: > Have you tried to *read* and *understand* this error message? My guess > is no. The error message tells you all you need to know. You need to > pass a string as argument 4, but you aren't. <> is a database > connection object, not a string.

Don't Understand Error

2009-11-23 Thread Victor Subervi
Hi; I have the following code: #!/usr/bin/env python import smtplib import cgitb; cgitb.enable() import cgi import sys,os sys.path.append(os.getcwd()) from login import login import MySQLdb import re, string def mailSpreadsheet(): user, passwd, db, host = login() database = MySQLdb.connect(h

Re: Don't Understand Error

2009-11-23 Thread Victor Subervi
On Mon, Nov 23, 2009 at 3:18 PM, Carsten Haese wrote: > Victor Subervi wrote: > > [Mon Nov 23 09:52:21 2009] [error] [client 66.248.168.98] Premature end > > of script headers: mailSpreadsheet.py, referer: > > http://globalsolutionsgroup.vi/display_spreadsheet.py > > &

Workaround To Add Value To TextArea

2009-11-25 Thread Victor Subervi
Hi; I've noticed that html doesn't support a "value" attribute for textarea. I have a form in which I enable users to edit data they've entered into my database, and one of the data is a textarea. How do I fill the textarea with the value, or what kind of workaround can I create? TIA, Victor -- ht

Re: Workaround To Add Value To TextArea

2009-11-25 Thread Victor Subervi
On Wed, Nov 25, 2009 at 10:27 AM, Rami Chowdhury wrote: > You'll find the textarea and input tags differ significantly, even > though they're both typically used in HTML forms. The W3C page has a > fair overview of how various parts of HTML forms work in HTML 4.01, > and it's roughly accurate for

Can't Encode Pic

2009-11-26 Thread Victor Subervi
Hi; I have the following code: import cgitb; cgitb.enable() import cgi import MySQLdb from login import login user, passwd, db, host = login() db = MySQLdb.connect(host, user, passwd, db) cursor= db.cursor() form = cgi.FieldStorage() pic1 = form.getfirst('pic1') cursor.execute('update products set

Re: Can't Encode Pic

2009-11-26 Thread Victor Subervi
On Thu, Nov 26, 2009 at 10:03 AM, Carsten Haese wrote: > cursor.execute('update products set pic1=%s where ID=1', > (MySQLdb.Binary(pic1),)) > > [That comma between the two closing parentheses is not a typo. Do not > leave it out!] > A problem occurred in a Python script. Here is the sequence of

Re: Can't Encode Pic

2009-11-26 Thread Victor Subervi
On Thu, Nov 26, 2009 at 11:52 AM, MRAB wrote: > Victor Subervi wrote: > >> On Thu, Nov 26, 2009 at 10:03 AM, Carsten Haese >> > carsten.ha...@gmail.com>> wrote: >> >>cursor.execute('update products set pic1=%s where ID=1', >>(MySQL

Re: Can't Encode Pic

2009-11-26 Thread Victor Subervi
On Thu, Nov 26, 2009 at 1:10 PM, Victor Subervi wrote: > On Thu, Nov 26, 2009 at 11:52 AM, MRAB wrote: > >> Victor Subervi wrote: >> >>> On Thu, Nov 26, 2009 at 10:03 AM, Carsten Haese >>> >> carsten.ha...@gmail.com>> wrote: >>> >

Re: Can't Encode Pic

2009-11-26 Thread Victor Subervi
On Thu, Nov 26, 2009 at 2:12 PM, MRAB wrote: > Victor Subervi wrote: > >> On Thu, Nov 26, 2009 at 1:10 PM, Victor Subervi >> > victorsube...@gmail.com>> wrote: >> >>On Thu, Nov 26, 2009 at 11:52 AM, MRAB ><mailto:pyt...@mrabarnett.plus.c

OT: Instant Messenger Clients

2010-01-31 Thread Victor Subervi
Hi; I need to record my IM conversations. I'm using Gmal's IM client and I can't figure out how to do it, nor do I find any help googling it. Is it possible with Gmail? If so, how? If not, is there a good IM client that will allow me to do this? TIA, beno -- The Logos has come to bear http://logo

Timer

2010-02-17 Thread Victor Subervi
Hi; I have the following css: .splash { position:absolute; left:0px; top:0px; z-index:2 } .page { position:absolute; left:0px; top:0px; z-index:1 } .text { font-family: Arial, Helvetica, sans-serif; font-size: 16px; text-decoration: none; text-align: justify} and the following python: if ne

Re: Timer

2010-02-18 Thread Victor Subervi
On Wed, Feb 17, 2010 at 2:37 PM, Stephen Hansen wrote: > On Wed, Feb 17, 2010 at 10:14 AM, Victor Subervi > wrote: > >> Obviously, the removeCSS isn't going to work in that last line. What can I >> put there to remove the splash page after 5 seconds? >> > &

SMTPServerDisconnected

2010-02-23 Thread Victor Subervi
Hi; I think the last main thing I have to do on my server is get a running email server up. Now that I've nuked sendmail and given up on postfix, I'm back to trying to get qmail up and running again. Of course, there are no active discussion lists for *any* email server, so I have to turn here for

Can't Connect To SMTP

2010-02-24 Thread Victor Subervi
Hi; I'm getting this error: A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred. /var/www/html/globalsolutionsgroup.vi/simplemail/mail2.py 52 53 ''' 54 my_mail() 55 print ''' 56 my_mail = /var/www/ht

<    1   2   3   4   5   6   >