Re: Completely OT

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 2:00 PM, inhahe wrote: > On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote: > > On Mon, Nov 30, 2009 at 12:49 PM, Victor Subervi > > wrote: > >> > >> > >> If I'm not mistaken, that won't help me actually print to screen

Re: Completely OT

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 1:35 PM, Dennis Lee Bieber wrote: > On Mon, 30 Nov 2009 07:26:09 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > Hi; > > I need a recommendation. I want to print out data like this: > > > > blue

Re: Completely OT

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 2:37 PM, inhahe wrote: > On Mon, Nov 30, 2009 at 1:21 PM, Victor Subervi > wrote: > > On Mon, Nov 30, 2009 at 2:00 PM, inhahe wrote: > >> > >> On Mon, Nov 30, 2009 at 12:58 PM, inhahe wrote: > >> > On Mon, Nov 30, 2009

os.remove() permission problem

2009-11-30 Thread Victor Subervi
Hi; I get the following error when I try os.remove(file) *OSError*: [Errno 13] Permission denied: 'particulars.py' args = (13, 'Permission denied') errno = 13 filename = 'particulars.py' strerror = 'Permission denied' Here are the permissions: -rwxr-xr-x 1 root root 45

Re: os.remove() permission problem

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 3:21 PM, Victor Subervi wrote: > Hi; > I get the following error when I try > os.remove(file) > > *OSError*: [Errno 13] Permission denied: 'particulars.py' > args = (13, 'Permission denied') > errno = 13 >

Re: os.remove() permission problem

2009-12-01 Thread Victor Subervi
On Mon, Nov 30, 2009 at 5:06 PM, Christian Heimes wrote: > Victor Subervi wrote: > > When I go into the python interpreter and execute that statement, it > > succeeds. What have I missed? > > You are confusing the permissions of a Unix file system. In order to > create o

Re: os.remove() permission problem

2009-12-01 Thread Victor Subervi
On Tue, Dec 1, 2009 at 8:12 AM, Christian Heimes wrote: > Victor Subervi wrote: > > Well, that's what I've tried. I've loaded the permissions up, 0777, and > it > > still throws the same error. I've also tried os.chmod(file, 0777) from > the > >

getattr problem

2009-12-01 Thread Victor Subervi
Hi; I have the following code that execute without a problem: import sys,os sys.path.append(os.getcwd()) import options storesTables = [] junkStores = string.join(addStore(), ', ') for table in optionsTables(): if table not in ('particulars', junkStores): storesTables.append(table) for table

Re: getattr problem

2009-12-01 Thread Victor Subervi
On Tue, Dec 1, 2009 at 3:17 PM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Victor Subervi wrote: > >> Hi; >> I have the following code that execute without a problem: >> >> import sys,os >> sys.path.append(os.getcwd()) >> i

Don't Understand This Error

2009-12-02 Thread Victor Subervi
I get the following error: /var/www/html/angrynates.com/cart/chooseOptions.py 8 from login import login 9 import string 10 import options 11 from particulars import optionsTables, addStore 12 options undefined SyntaxError: invalid syntax (options.py, line 140) args = ('inv

Re: Don't Understand This Error

2009-12-02 Thread Victor Subervi
To those who caught the colon at the end of what I thought was going to be def but turned out to be something else, thank. On Wed, Dec 2, 2009 at 5:55 AM, Bruno Desthuilliers wrote: > On Wed, Dec 2, 2009 at 2:33 AM, Victor Subervi >> wrote: >> >>> >>&g

Insane Problem

2009-12-02 Thread Victor Subervi
Hi; I have spent 2-3 hours trying to track this bug. Here's the code snippet: form = cgi.FieldStorage() fn = getattr(options, 'products') ourOptionsNames = [] optionsNames, doNotUse = fn('names') for name in optionsNames: test = table + '-' + name print test check = form.get

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Wed, Dec 2, 2009 at 4:08 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I have spent 2-3 hours trying to track this bug. Here's the code snippet: >> >> form = cgi.FieldStorage() >> fn = getattr(options, 'products') >> our

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Thu, Dec 3, 2009 at 6:07 AM, Victor Subervi wrote: > On Wed, Dec 2, 2009 at 4:08 PM, MRAB wrote: > >> Victor Subervi wrote: >> >>> Hi; >>> I have spent 2-3 hours trying to track this bug. Here's the code snippet: >>> >>> for

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Thu, Dec 3, 2009 at 8:02 AM, Victor Subervi wrote: > On Thu, Dec 3, 2009 at 6:07 AM, Victor Subervi wrote: > >> On Wed, Dec 2, 2009 at 4:08 PM, MRAB wrote: >> >>> Victor Subervi wrote: >>> >>>> Hi; >>>> I have spent 2-3

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Thu, Dec 3, 2009 at 10:13 AM, Carsten Haese wrote: > Victor Subervi wrote: > > I believe I mentioned in my first post that the "print test" does print > > the exact fields being called from the referring page. > > Was any part of "What do the print statemen

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Thu, Dec 3, 2009 at 10:53 AM, Carsten Haese wrote: > Victor Subervi wrote: > > In order to help you diagnose the problem, we need to see the *exact* > > code you're running, we need to see the *exact* inputs going into it, > > and we need to see the *exac

Re: Insane Problem

2009-12-03 Thread Victor Subervi
On Thu, Dec 3, 2009 at 12:38 PM, Carsten Haese wrote: > Victor Subervi wrote: > > No, it doesn't, because you've only provided one third of what I > asked > > for. I also asked for the code and the inputs that go into it. > > > > > > I prov

Re: Insane Problem

2009-12-04 Thread Victor Subervi
On Thu, Dec 3, 2009 at 7:07 PM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Thu, 03 Dec 2009 10:13:14 -0500, Carsten Haese wrote: > > > Victor Subervi wrote: > >> I believe I mentioned in my first post that the "print test" doe

Killing Another Bug

2009-12-04 Thread Victor Subervi
Hi; I have this code: for table in tables: if table == 'products': optionsCode = optionsCodeProducts fromForm = prodsFromForm try: fn = getattr(options, table) fromForm = form.getfirst('%s-options' % table) fromForm = string.split(fromForm[2:-2], "', '")

Re: Killing Another Bug

2009-12-04 Thread Victor Subervi
On Fri, Dec 4, 2009 at 12:43 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I have this code: >> >> > [snip] > > As you can see in the supplied comments, when I loop through for table >> 'prescriptions', it only prints out the fir

Re: Killing Another Bug

2009-12-04 Thread Victor Subervi
On Fri, Dec 4, 2009 at 2:08 PM, Victor Subervi wrote: > On Fri, Dec 4, 2009 at 12:43 PM, MRAB wrote: > >> Victor Subervi wrote: >> >>> Hi; >>> I have this code: >>> >>> >> [snip] >> >> As you can see in the supplied com

Re: Killing Another Bug

2009-12-04 Thread Victor Subervi
On Fri, Dec 4, 2009 at 3:46 PM, Stephen Hansen wrote: > > On Fri, Dec 4, 2009 at 7:52 AM, Victor Subervi wrote: > >> except: >> > > >> except: >> pass >> > > If you want any hope of fixing the bug, remove both of these. Really --

Nested Dicts

2009-12-05 Thread Victor Subervi
Hi; I have the following error: /var/www/html/angrynates.com/cart/catTree.py in getChildren(levelDict={'cat3': {}}, level=0) 23 if level > MAXLEVEL: 24 return #possibly the data has a cycle/loop 25 for (nm, dt) in levelDict: ### ERROR HERE 26 cursor.execute('''select c.na

Re: Nested Dicts

2009-12-05 Thread Victor Subervi
On Sat, Dec 5, 2009 at 12:01 PM, Carsten Haese wrote: > Victor Subervi wrote: > >>>> d = {'cat': {'one':'two'}} > >>>> for a, b in d: > > ... > > File "", line 2 > > > > ^ > > Inden

Re: Nested Dicts

2009-12-05 Thread Victor Subervi
On Sat, Dec 5, 2009 at 12:39 PM, Carsten Haese wrote: > Victor Subervi wrote: > > Of course I knew about those indentation errors > > That may be so, but you cleverly disguised this fact by saying the exact > opposite. > I will try not to make such assumptions in the f

unsupported operand type(s) for %: 'NoneType' and 'tuple'

2009-12-07 Thread Victor Subervi
Hi; I get the following error: /var/www/html/angrynates.com/cart/createCats2.py 111 112 113 ''' 114 115 createCats2() createCats2 = /var/www/html/angrynates.com/cart/createCats2.py in createCats2() 85 for standAloneStore in storePrimaryStandAlone: 86 allStores.append(stan

Re: unsupported operand type(s) for %: 'NoneType' and 'tuple'

2009-12-07 Thread Victor Subervi
On Mon, Dec 7, 2009 at 7:14 AM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Victor Subervi wrote: > >> >> global printTree = , allTrees = [{'prodCat1': {}, >> 'prodCat2': {}}, {'presCat1': {}, 'presCat2&

Re: unsupported operand type(s) for %: 'NoneType' and 'tuple'

2009-12-07 Thread Victor Subervi
On Mon, Dec 7, 2009 at 9:36 AM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Victor Subervi wrote: > > On Mon, Dec 7, 2009 at 7:14 AM, Jean-Michel Pichavant < >> jeanmic...@sequans.com <mailto:jeanmic...@sequans.com>> wrote: >> >>

Re: unsupported operand type(s) for %: 'NoneType' and 'tuple'

2009-12-07 Thread Victor Subervi
On Mon, Dec 7, 2009 at 11:29 AM, Carsten Haese wrote: > Victor Subervi wrote: > > I'll do my best to remember to do that from > > now on to: > > > >>>> allTrees = [{'prodCat1': {}, 'prodCat2': {}}, {'presCat1': {}, >

Re: unsupported operand type(s) for %: 'NoneType' and 'tuple'

2009-12-07 Thread Victor Subervi
On Mon, Dec 7, 2009 at 12:40 PM, Rami Chowdhury wrote: > Coming from PHP, > Wash your mouth out with soap, Rami! I might not be a good programmer, but I'm loyal to the Flying Circus. I only did one job, my first one, in PHP before I became "enlightened" :)) > I can see why you might be confused

Re: unsupported operand type(s) for %: 'NoneType' and 'tuple'

2009-12-07 Thread Victor Subervi
On Mon, Dec 7, 2009 at 12:52 PM, Carsten Haese wrote: > Victor Subervi wrote: > > Well, if you could point me in the right direction, it would be > > appreciated. I've tried googling this with no luck. Apparently, "expand" > > is not a well-documented te

My Darned Image Again

2009-12-08 Thread Victor Subervi
Hi; I'm having trouble loading my image again. Here's my code: for pic in pics: sql = 'update %s set %s=%s where SKU=%s;' % (store, colNamesPics[i], '%s', sku) sql = sql, (MySQLdb.Binary(pics[int(i)]),) cursor.execute(sql, (MySQLdb.Binary(pics[int(i)]),)) prin

Re: My Darned Image Again

2009-12-08 Thread Victor Subervi
On Tue, Dec 8, 2009 at 3:28 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I'm having trouble loading my image again. Here's my code: >> >> for pic in pics: >>sql = 'update %s set %s=%s where SKU=%s;' % (store, >>

MySQL set and enum, calling values

2009-12-11 Thread Victor Subervi
Hi; I have the following code: cursor.execute('describe %s;' % store) colFields, colFieldValues = [itm[0] for itm in cursor], [itm[1] for itm in cursor] ... for col in colFields: ... print '%s: %s\n' % (col, colValue[0]) Don't worry about the colValue[0]. In fact, the code throws no errors. H

Re: MySQL set and enum, calling values

2009-12-11 Thread Victor Subervi
On Fri, Dec 11, 2009 at 3:12 PM, Carsten Haese wrote: > Victor Subervi wrote: > > [...] if I go to print, say, > > colFieldValues[20], which is a set, it prints out the whole set: > > set('Extra-small','Small','Medium','Large','X

Re: MySQL set and enum, calling values

2009-12-12 Thread Victor Subervi
On Fri, Dec 11, 2009 at 8:13 PM, Gabriel Genellina wrote: > En Fri, 11 Dec 2009 16:28:23 -0300, Victor Subervi < > victorsube...@gmail.com> escribió: > > On Fri, Dec 11, 2009 at 3:12 PM, Carsten Haese > >wrote: >> >> Victor Subervi wrote: >>> > [

Getting Default Values Out of MySQL

2009-12-12 Thread Victor Subervi
Hi; I'm using MySQLdb. If I do a cursor.execute('describe myTable;') it gives me all sorts of data but not my default values. How do I retrieve them? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting Default Values Out of MySQL

2009-12-12 Thread Victor Subervi
On Sat, Dec 12, 2009 at 10:54 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Hi; > > I'm using MySQLdb. If I do a > > cursor.execute('describe myTable;') > > it gives me all sorts of data but not my default values. > > That function cal

Re: Getting Default Values Out of MySQL

2009-12-12 Thread Victor Subervi
On Sat, Dec 12, 2009 at 11:38 AM, MRAB wrote: > That's strange, I count 6! > > For example, the first field has the following columns: > >1. 'ID' > >2. 'tinyint(5) unsigned' > >3. 'NO' > >4. 'PRI' > >5. None > >6. 'auto_increment' Dunno why I counted 4 last time. Maybe c

Manipulating MySQL Sets

2009-12-12 Thread Victor Subervi
Hi; What type does python consider a MySQL Set?? if isinstance(colValue[0], (str, int, long, float, long, complex, unicode, list, buffer, xrange, tuple)): pass else: print 'XXX' And the following fields pass through this net: Set and dat

Re: Manipulating MySQL Sets

2009-12-12 Thread Victor Subervi
On Sat, Dec 12, 2009 at 5:11 PM, Carsten Haese wrote: > Victor Subervi wrote: > > Hi; > > What type does python consider a MySQL Set?? > > Let's take a look: > > >>> import MySQLdb > >>> conn = MySQLdb.connect(db="carsten", user=&qu

Re: Manipulating MySQL Sets

2009-12-12 Thread Victor Subervi
On Sat, Dec 12, 2009 at 6:07 PM, Victor Subervi wrote: > On Sat, Dec 12, 2009 at 5:11 PM, Carsten Haese wrote: > >> Victor Subervi wrote: >> > Hi; >> > What type does python consider a MySQL Set?? >> >> Let's take a look: >> >> >>

Re: Manipulating MySQL Sets

2009-12-13 Thread Victor Subervi
On Sat, Dec 12, 2009 at 6:35 PM, Carsten Haese wrote: > The traceback helpfully shows us that colValue is a 1-tuple whose zeroth > entry, colValue[0], is an actual bona-fide Python Set object. Such > objects aren't indexable, because sets are unordered. That still doesn't > tell us where colValue

Re: Manipulating MySQL Sets

2009-12-13 Thread Victor Subervi
On Sun, Dec 13, 2009 at 11:36 AM, Carsten Haese wrote: > > I don't know what I'm expecting! > > That statement is the most succinct summary of the root cause of all > your problems. If you don't know what to expect, how could you possibly > write code that produces what you expect? (Don't answer t

Re: Manipulating MySQL Sets

2009-12-13 Thread Victor Subervi
On Sun, Dec 13, 2009 at 11:56 AM, Robert P. J. Day wrote: > On Sun, 13 Dec 2009, Victor Subervi wrote: > > > On Sun, Dec 13, 2009 at 11:36 AM, Carsten Haese > > > wrote: > > > I don't know what I'm expecting! > > > > That statement i

Re: Manipulating MySQL Sets

2009-12-13 Thread Victor Subervi
On Sun, Dec 13, 2009 at 11:26 AM, Sebastian Bassi wrote: > On Sun, Dec 13, 2009 at 12:48 PM, Victor Subervi > wrote: > > Who said I was expecting a string? I don't know what I'm expecting! I > need > > to be able to parse this thing, whatever it is. You say it'

Re: Manipulating MySQL Sets

2009-12-13 Thread Victor Subervi
On Sun, Dec 13, 2009 at 12:10 PM, Carsten Haese wrote: > Victor Subervi wrote: > > I need to get at the individual elements of the set (that which is > > between the single quotes). > > It's not quite clear what you mean by "get at the individual elements",

Re: Manipulating MySQL Sets

2009-12-13 Thread Victor Subervi
On Sun, Dec 13, 2009 at 12:39 PM, Victor Subervi wrote: PS: I have another field that's a datetime with the same problem. How do I parse and otherwise work with that? TIA, V -- http://mail.python.org/mailman/listinfo/python-list

Another MySQL Problem

2009-12-13 Thread Victor Subervi
Hi; mysql> truncate tem126072414516; Query OK, 0 rows affected (0.00 sec) Then I run a script: if whatDo == 'insert': try: sql = 'insert into %s (ProdID, Quantity) values ("%s", "%s");' % (tmpTable, prodid, quantity) print sql cursor.execute(sql) that runs this (printed

Re: Manipulating MySQL Sets

2009-12-13 Thread Victor Subervi
On Sun, Dec 13, 2009 at 12:40 PM, Victor Subervi wrote: > On Sun, Dec 13, 2009 at 12:39 PM, Victor Subervi > wrote: > > PS: I have another field that's a datetime with the same problem. How do I > parse and otherwise work with that? > I have yet another problem with thi

Re: Another MySQL Problem

2009-12-13 Thread Victor Subervi
On Sun, Dec 13, 2009 at 1:37 PM, MRAB wrote: > 2. Did you commit the changes? > Ah, yes, caught me napping! db.commit() has bit me in the a$$ again. Thanks, V -- http://mail.python.org/mailman/listinfo/python-list

(OT) Where Are Cookies Stored?

2009-12-15 Thread Victor Subervi
Hi; I've googled, found where cookies are supposed to be, the folders and files don't exist. I've opened my latest and greatest FF and seen cookies in there, but when I search for the name of the cookie in the C: dir, it's not there...anywhere. I've made sure no folders/files are hidden and I still

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 11:42 AM, geremy condra wrote: > Was on the first[1], second, and third google hits for me. Also, given the > number of web-related questions you're asking, you may want to look > into evolt's lists[2]. > > Geremy Condra > > [1]: > http://askville.amazon.com/Firefox-store-

Re: (OT) Where Are Cookies Stored?

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 12:03 PM, Gabriel Genellina wrote: > En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi < > victorsube...@gmail.com> escribió: > > > I've googled, found where cookies are supposed to be, the folders and >> files >> don't exist

Calling Cookie Values

2009-12-15 Thread Victor Subervi
Hi; import Cookie ... cookie = Cookie.SimpleCookie() cookieString = os.environ.get('HTTP_COOKIE') if not cookieString: cExpires, cPath, cComment, cDomain, cMaxAge, cVersion = myCookie() cookie['lastvisit'] = str(time.time()) cookie['lastvisit']['expires'] = cExpires cookie['l

Re: Calling Cookie Values

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 2:36 PM, MRAB wrote: > You've just created a cookie, but are trying to get a value without > having set it first! > LOL! Rewrote code thus: cookie = os.environ.get('HTTP_COOKIE') if not cookie: cookie = Cookie.SimpleCookie() cExpires, cPath, cComment, cDomain

Re: Calling Cookie Values

2009-12-15 Thread Victor Subervi
On Tue, Dec 15, 2009 at 4:05 PM, MRAB wrote: > What you got from HTTP_COOKIE was a _string_ (or None). You then need to > turn it into a cookie: > >cookie_string = os.environ.get('HTTP_COOKIE') >if cookie_string: >cookie = Cookie.SimpleCookie(cookie_string) >... >else:

Storing a Value in a Cookie

2009-12-16 Thread Victor Subervi
Hi; >From what I've studied and gotten working about cookies, it seems one can store only a certain few pieces of information--expiration, path, comment, domain, max-age, version and last visit--but how is it useful if one can't also store, say, the name of a temporary MySQL table where pertinent c

Spot Metals Prices (slightly OT)

2009-12-16 Thread Victor Subervi
Hi; I need to update a client's site with spot metals prices. I could build a scraper to grab them off someone else' site (they only need to be accurate within 24 hours), but is there a better *free* source? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Storing a Value in a Cookie

2009-12-16 Thread Victor Subervi
On Wed, Dec 16, 2009 at 4:42 AM, Chris Rebert wrote: > On Wed, Dec 16, 2009 at 1:13 AM, Victor Subervi > wrote: > > Hi; > > From what I've studied and gotten working about cookies, it seems one can > > store only a certain few pieces of information--expiration, pat

Re: Calling Cookie Values

2009-12-16 Thread Victor Subervi
On Tue, Dec 15, 2009 at 4:01 PM, Grant Edwards wrote: > > On Tue, Dec 15, 2009 at 2:36 PM, MRAB > > wrote: > > > > You've just created a cookie, but are trying to get a value without > > having set it first! > > > > > > LOL! Rewrote code thus: > > > >

Re: (OT) Where Are Cookies Stored?

2009-12-16 Thread Victor Subervi
On Tue, Dec 15, 2009 at 6:57 PM, r0g wrote: > Gabriel Genellina wrote: > > En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi > > escribió: > > > >> I've googled, found where cookies are supposed to be, the folders and > >> files > >> don&#x

Re: (OT) Where Are Cookies Stored?

2009-12-16 Thread Victor Subervi
On Tue, Dec 15, 2009 at 6:29 PM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Tue, 15 Dec 2009 13:03:07 -0300, Gabriel Genellina wrote: > > > En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi > > escribió: > > > >> I've goo

Re: (OT) Where Are Cookies Stored?

2009-12-16 Thread Victor Subervi
On Wed, Dec 16, 2009 at 11:33 AM, Dave Angel wrote: > > > Victor Subervi wrote: > >> On Tue, Dec 15, 2009 at 6:57 PM, r0g wrote: >> >> >> >> Cookies in FF for Windows are stored in an sqlite database in here... >>> >>> ~\App

Can't Iterate

2009-12-16 Thread Victor Subervi
Hi; I have this line of code: for store in ourStores(): which is called from the statement: from particulars import ourStores The latter file has the following: def ourStores(): return ['prescriptions', 'products'] Yet, the above iteration only iterates the last of these items ('products').

How Do I...?

2009-12-18 Thread Victor Subervi
Hi; I have this code: i = 0 nameNos = [] nos = [] for option in ourOptions(): nameNos.append('optionNo%d' % i) nos.append(i) i += 1 The idea is that through every iteration of option, I can create a new variable such as 'optionNo0', 'optionNo1' etc and assign val

Re: How Do I...?

2009-12-18 Thread Victor Subervi
On Fri, Dec 18, 2009 at 3:46 PM, Rami Chowdhury wrote: > On Fri, Dec 18, 2009 at 10:55, Victor Subervi > wrote: > > Hi; > > I have this code: > > > > i = 0 > > nameNos = [] > > nos = [] > > for option in ourOpti

Re: How Do I...?

2009-12-19 Thread Victor Subervi
On Fri, Dec 18, 2009 at 3:03 PM, Tim Chase wrote: > Victor Subervi wrote: > >> How do I...? >> > > Well, you start by reading a book on how to program. You would then learn > that what you want (in all likelihood) is a dictionary/map structure for > dynamically cre

Re: How Do I...?

2009-12-19 Thread Victor Subervi
On Sat, Dec 19, 2009 at 10:22 AM, Tim Chase wrote: > Victor Subervi wrote: > >> On Fri, Dec 18, 2009 at 3:03 PM, Tim Chase > >wrote: >> >> Well, you start by reading a book on how to program. You would then >>> learn >>> that what you want (in a

Re: How Do I...?

2009-12-19 Thread Victor Subervi
On Sat, Dec 19, 2009 at 3:06 PM, Rami Chowdhury wrote: > Tim's given you a few suggestions, as have many others -- perhaps it would > be worth making a note, somewhere, of checks to go through before you post, > to ensure that you come across as well as you intend? > I appreciate Tim's advice. I

Re: How Do I...?

2009-12-20 Thread Victor Subervi
t, much less this one! Ever since then, I've been signing up under different pseudonames, the latest of which is "Victor Subervi". My legal name (changed to) is actually "beno". I would prefer to re-sign up under that. May I? If not, I'll put Victor out of his misery and cre

Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Victor Subervi
Hi; I'm looking for something like os.environ['HTTP_REFERER'] but for python scripts. That is, if I have a script that is imported by another script, how can I have the script that is being imported determine which script imported it? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-l

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Victor Subervi
On Sun, Dec 20, 2009 at 5:18 AM, Chris Rebert wrote: > On Sun, Dec 20, 2009 at 2:06 AM, Victor Subervi > wrote: > > Hi; > > I'm looking for something like os.environ['HTTP_REFERER'] but for python > > scripts. That is, if I have a script that is imported

Import Problem

2009-12-20 Thread Victor Subervi
Hi; I have this import statement: from particulars import storePrimaryStandAlone, addStore, ourStores particulars.py has this code: def addStore(): return 'jewelry' def ourStores(): return ['products', 'prescriptions'] def storePrimaryStandAlone(): return 'prescriptions' But I get this

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Victor Subervi
On Sun, Dec 20, 2009 at 1:20 PM, Stephen Hansen wrote: > On Sun, Dec 20, 2009 at 3:05 AM, Victor Subervi > wrote: > >> Of course, I can pass the page name as a parameter, but that's not >> elegant. >> > > That is precisely what it is in fact-- elegan

Re: Something Like os.environ['HTTP_REFERER']

2009-12-20 Thread Victor Subervi
On Sun, Dec 20, 2009 at 3:26 PM, Stephen Hansen wrote: > On Sun, Dec 20, 2009 at 11:01 AM, Victor Subervi > wrote: > >> If you want a piece of code to have a variable number of differing >>> behaviors, that's something you can handle in many elegant ways. That's

OT Question

2009-12-21 Thread Victor Subervi
Hi; Back when I worked with Zope, they had this nifty form element where I could select from a list of elements on the right and click an arrow to make them go into a list on the left. I need to add this functionality to the store I am creating. What is it called? TIA, beno -- http://mail.python.o

Re: OT Question

2009-12-22 Thread Victor Subervi
On Tue, Dec 22, 2009 at 12:08 PM, Emile van Sebille wrote: > On 12/21/2009 10:27 PM Victor Subervi said... > > Hi; >> Back when I worked with Zope, they had this nifty form element where I >> could select from a list of elements on the right and click an arrow to make >

Strange Problem

2009-12-22 Thread Victor Subervi
Hi; I have the following code: print 'printTheForm: ', descrProds, '' for value in descrProds: print 'value: ', value, '' which prints this: printTheForm: [['ID', 'tinyint', '5', '0', None], ['SKU', 'varchar', '40', '', None], ['Category', 'varchar', '40', '', None], ['Name', 'varchar',

Re: Strange Problem

2009-12-23 Thread Victor Subervi
On Tue, Dec 22, 2009 at 5:14 PM, Dave Angel wrote: > Victor Subervi wrote: > >> Hi; >> I have the following code: >> >> print 'printTheForm: ', descrProds, '' >> for value in descrProds: >>print 'value: ', value, &#

More On the Strange Problem

2009-12-23 Thread Victor Subervi
I've isolated the problem in the print-out at the bottom of this post. It occurs when these values are passed: ['LastDatePrice', 'date', '10', '/mm/dd', None], Since this is the first datetime that is passed, it would appear to be associated with such values, which are processed thus: el

Re: More On the Strange Problem

2009-12-23 Thread Victor Subervi
On Wed, Dec 23, 2009 at 2:21 PM, Victor Subervi wrote: > I've isolated the problem in the print-out at the bottom of this post. It > occurs when these values are passed: > > ['LastDatePrice', 'date', '10', '/mm/dd', None], > > S

Re: More On the Strange Problem

2009-12-23 Thread Victor Subervi
On Wed, Dec 23, 2009 at 3:03 PM, MRAB wrote: > Victor Subervi wrote: > >> I've isolated the problem in the print-out at the bottom of this post. It >> occurs when these values are passed: >> >> ['LastDatePrice', 'date', '10', &#

OT: Broadband TV

2009-12-24 Thread Victor Subervi
Hi; My professional background before programming was media and I got into this because I saw where the industry was eventually headed. I'd like to find out what the people in the know have to say about when broadband quality is high enough to reliably stream video and the penetration of such broad

Re: OT: Broadband TV

2009-12-24 Thread Victor Subervi
On Thu, Dec 24, 2009 at 2:13 PM, MRAB wrote: > Victor Subervi wrote: > >> My professional background before programming was media and I got into >> this because I saw where the industry was eventually headed. I'd like to >> find out what the people in the know hav

getlist question

2009-12-24 Thread Victor Subervi
Hi; I have the following code: try: trueVal = form.getlist(storeColNames[i]) colNames.append(storeColNames[i]) if len(trueVal) > 1: trueVal = string.join(trueVal, ',') values.append(trueVal) elif len(trueVal) == 1: print storeColN

Re: getlist question

2009-12-24 Thread Victor Subervi
On Thu, Dec 24, 2009 at 3:28 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I have the following code: >> >> try: >>trueVal = form.getlist(storeColNames[i]) >>colNames.append(storeColNames[i]) >>if len(trueVal

Re: getlist question

2009-12-25 Thread Victor Subervi
On Thu, Dec 24, 2009 at 6:32 PM, MRAB wrote: > Victor Subervi wrote: > > On Thu, Dec 24, 2009 at 3:28 PM, MRAB > pyt...@mrabarnett.plus.com>> wrote: >> >>Victor Subervi wrote: >> >>Hi; >>I have the following code:

Re: getlist question

2009-12-25 Thread Victor Subervi
On Fri, Dec 25, 2009 at 11:35 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Well I've done that. What happens is the storeColNames registers the > > "Availability" field naturally enough; however, as I stated before, the > > getlist doesn't fetch a

Re: getlist question

2009-12-25 Thread Victor Subervi
On Fri, Dec 25, 2009 at 12:59 PM, Benjamin Kaplan wrote: > On Fri, Dec 25, 2009 at 12:40 PM, Victor Subervi > wrote: > > > > It returns nothing. I believe I've stated that three times now. > > In Python, that's not possible. Every function returns something. If

Re: getlist question

2009-12-26 Thread Victor Subervi
On Fri, Dec 25, 2009 at 8:28 PM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Fri, 25 Dec 2009 12:59:20 -0500, Benjamin Kaplan wrote: > > > On Fri, Dec 25, 2009 at 12:40 PM, Victor Subervi > > wrote: > >> > >> It returns noth

Missing Images

2009-12-26 Thread Victor Subervi
For some reason, I'm not able to upload images to insert into my database. Here's my html: Picture #1 Picture #2 Here's the code from the page that processes the data from the preceding form: i = 0 for picsStore, num in pics().iteritems(): if picsStore ==

Re: Missing Images

2009-12-26 Thread Victor Subervi
On Sat, Dec 26, 2009 at 11:28 AM, Carsten Haese wrote: > It's hard to say what you have missed, since you're not giving us nearly > enough information to determine what you haven't missed. So, we can now > either beg for more information, make random guesses, or point you at a > code example that

Re: Missing Images

2009-12-27 Thread Victor Subervi
On Sat, Dec 26, 2009 at 4:52 PM, Carsten Haese wrote: > Victor Subervi wrote: > > Right. Thank you again. I'd forgotten to put in > > enctype="multipart/form-data". Now I have the following snipped: > > > > for pic in ourPics: > >

Another Sets Problem

2009-12-28 Thread Victor Subervi
Hi; I'm using python 2.4.3 which apparently requires that I import Set: from sets import Set I've done this. In another script I successfully manipulated MySQL sets by so doing. Here's the code snippet from the script where I was able to call the elements in a for loop: if isinstance(col

Re: Another Sets Problem

2009-12-28 Thread Victor Subervi
On Mon, Dec 28, 2009 at 1:41 PM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I'm using python 2.4.3 which apparently requires that I import Set: >> from sets import Set >> I've done this. In another script I successfully manipulated MySQL sets by >&

Re: Another Sets Problem

2009-12-28 Thread Victor Subervi
On Mon, Dec 28, 2009 at 3:07 PM, Steve Holden wrote: > Victor Subervi wrote: > > On Mon, Dec 28, 2009 at 1:41 PM, MRAB > <mailto:pyt...@mrabarnett.plus.com>> wrote: > > > > Victor Subervi wrote: > > > > Hi; > > I'm us

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Mon, Dec 28, 2009 at 4:23 PM, Steve Holden wrote: > There is only one way for the piece of code you quote to print nothing > (unless you suspect a bug in the Python interpreter, but the probability > of that is so low compared with the probability of your making a mistake > in interpretation o

Re: Another Sets Problem

2009-12-29 Thread Victor Subervi
On Tue, Dec 29, 2009 at 6:29 AM, Jean-Michel Pichavant < jeanmic...@sequans.com> wrote: > Matt Nordhoff wrote: > >> Victor Subervi wrote: >> >> >>> On Mon, Dec 28, 2009 at 1:41 PM, MRAB >> <mailto:pyt...@mrabarnett.plus.com>> wrote: >>

<    1   2   3   4   5   6   >