Re: MySQL One More Again

2010-07-16 Thread Victor Subervi
On Fri, Jul 16, 2010 at 10:09 AM, MRAB wrote: > Victor Subervi wrote: > >> Hi; >> I have the following code: >> >>cursor.execute('select MyTable from optionsDetails where Store=%s', >> (store,)) >>options_tables = [item[0] f

Re: Accumulate function in python

2010-07-19 Thread Brian Victor
dhruvbird wrote: > Hello, > I have a list of integers: x = [ 0, 1, 2, 1, 1, 0, 0, 2, 3 ] > And would like to compute the cumulative sum of all the integers > from index zero into another array. So for the array above, I should > get: [ 0, 1, 3, 4, 5, 5, 5, 7, 10 ] > What is the best way (or p

Re: Builtn super() function. How to use it with multiple inheritance? And why should I use it at all?

2010-07-31 Thread Brian Victor
Steven D'Aprano wrote: > On Sat, 31 Jul 2010 14:25:39 +1200, Gregory Ewing wrote: > >> Steven D'Aprano wrote: >> >>> A >>> / \ >>> C B >>> \ / >>> D >>> / \ >>> E F >>> >>> Yes, a super call might jog left from C to B, but only when being >>> called from one

Re: looping through possible combinations of McNuggets packs of 6,9 and 20

2010-08-12 Thread Brian Victor
Baba wrote: > def can_buy(n_nuggets): [snip] > can_buy(55) > > as you can see i am trying to loop through all combinations of values > bewtween 1 and n_nuggets and when the equation resolves it should > return True, else it should return False. > > I was hoping that when i then call my function and

Auto Send URL

2009-07-18 Thread Victor Subervi
. How do I do this? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Auto Send URL

2009-07-19 Thread Victor Subervi
Ah. How easy! Thank you. On Sat, Jul 18, 2009 at 7:32 PM, Chris Rebert wrote: > On Fri, Jul 17, 2009 at 6:02 AM, Victor Subervi > wrote: > > Hi; > > I am trying to script code that automatically sends a Web site visitor to > an > > URL. Specifically, when they enter

Getting a Form To Work

2009-07-19 Thread Victor Subervi
t; /> """ print '\n' Now, "Oops" never gets printed, nor does the variable num (although a blank space appears to print). I am calling the very page to which the form sends its values. Assuming the imported module works, why don´t I get anything printed? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Trouble With a Form

2009-07-19 Thread Victor Subervi
Hi: When the form comes up the first time, there is the default value for num. When I fill in a number in the form and press send, even though the form sends to itself (same page name), I would think it would read the number sent. Here again is the code: from primeNumbers import primeNumbers try:

Cannot Get Form To Work

2009-07-23 Thread Victor Subervi
Hi: When the form comes up the first time, there is the default value for num. When I fill in a number in the form and press send, even though the form sends to itself (same page name), I would think it would read the number sent. Here again is the code: from primeNumbers import primeNumbers try:

Re: Cannot Get Form To Work

2009-07-26 Thread Victor Subervi
er. You can see this here, if you like: http://13gems.com/test-Calculators_frame.py TIA, beno On Thu, Jul 23, 2009 at 2:01 PM, Dennis Lee Bieber wrote: > On Thu, 23 Jul 2009 12:46:16 -0300, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > sent

RE Question

2009-08-02 Thread Victor Subervi
Hi; How do I search and replace something like this: aLine = re.sub('[<]?[p]?[>]?[<]?[b]?[>]?', '', aLine) where RE *only* looks for the possibility of "" at the beginning of the string; that is, not the individual components as I have it coded above, but

Re: RE Question

2009-08-03 Thread Victor Subervi
That worked. Thank you again :) Victor On Mon, Aug 3, 2009 at 12:13 AM, Gabriel Genellina wrote: > En Sun, 02 Aug 2009 18:22:20 -0300, Victor Subervi < > victorsube...@gmail.com> escribió: > > > How do I search and replace something like this: >> aLine = re.s

Surpressing Warnings

2009-08-09 Thread Victor Subervi
Hi: I get a ton of warnings like this from a program I run: Warning (from warnings module): File "C:\Python25\read.py", line 67 cursor.execute(sqlKWDrop) Warning: Unknown table 'judaism_128' How do I surpress them? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Surpressing Warnings

2009-08-16 Thread Victor Subervi
This is strange because I actually had "if exists" in my code: sqlKWDrop = 'DROP TABLE IF EXISTS ' + kwTable + ';' where kwTable, in the instance cited below, becomes "judaism_128". What gives? Victor On Sun, Aug 9, 2009 at 7:57 PM, Dennis Lee Bieber wro

Trying To Catch Invalid User Input

2009-08-23 Thread Victor Subervi
ink this would catch errors and permit valid values, but it doesn't. If I enter an erroneous value the first time, and the second time a good value, it doesn't break the loop. Why? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Victor Subervi
Really slick! Thanks! V On Sun, Aug 23, 2009 at 11:08 AM, Albert Hopkins wrote: > On Sun, 2009-08-23 at 16:36 +0100, MRAB wrote: > > Victor Subervi wrote: > > > Hi; > > > I have the following: > > > > > > style = raw_input('What style is this? (1

Re: Trying To Catch Invalid User Input

2009-08-24 Thread Victor Subervi
That's nice. Thanks! V On Sun, Aug 23, 2009 at 5:02 PM, Dennis Lee Bieber wrote: > On Sun, 23 Aug 2009 10:04:57 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > Hi; > > I have the following: > > > > style = raw_input(

Problem w/ mysqldump

2009-09-02 Thread Victor Subervi
e some way to do the same thing from within MySQL? Can I at least print everything to screen and copy it? Where would I find my database in Windoze? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem w/ mysqldump

2009-09-02 Thread Victor Subervi
Obviously I'm sure. It created the file. But the file was blank. How can I do a mysqldump in mysql itself? V On Wed, Sep 2, 2009 at 8:13 AM, Nitebirdz wrote: > On Wed, Sep 02, 2009 at 06:43:12AM -0400, Victor Subervi wrote: > > Hi: > > I have the following python

Re: Problem w/ mysqldump

2009-09-02 Thread Victor Subervi
nt to screen in mysql itself? TIA, V On Wed, Sep 2, 2009 at 10:18 AM, Emile van Sebille wrote: > On 9/2/2009 3:43 AM Victor Subervi said... > >> Hi: >> I have the following python code: >> import os >> os.system("mysqldump -u root -pPASSWORD --opt spreadsheets >

Re: Problem w/ mysqldump

2009-09-02 Thread Victor Subervi
11:48 AM, Nitebirdz wrote: > On Wed, Sep 02, 2009 at 08:43:22AM -0400, Victor Subervi wrote: > > > > Obviously I'm sure. It created the file. But the file was blank. How can > I > > do a mysqldump in mysql itself? > > > > As I said, I only got a blank file

Re: Problem w/ mysqldump

2009-09-02 Thread Victor Subervi
hury wrote: > I tried running the mysqldump command >> from the python prompt >> > > I think you were being asked to try running it from the command prompt > (cmd.exe) -- it won't work from the Python prompt, of course. > > > On Wed, 02 Sep 2009 10:50:55 -0700, V

Try Except Problem

2009-09-03 Thread Victor Subervi
he sales person\'s fax number: ') home = raw_input('Please enter the sales person\'s home number: ') email = raw_input('Please enter the sales person\'s email address: ') assistant = raw_input('Please enter the name of the sales person\'s assistant: ') Now, both "one" and "two" get printed! So it's running the try AND the except!! Why??? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem w/ mysqldump

2009-09-04 Thread Victor Subervi
Thu, Sep 3, 2009 at 1:42 PM, Dennis Lee Bieber wrote: > On Wed, 2 Sep 2009 16:45:02 -0400, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > I tried running it like you said, got this error: > > 'mysqldump' is not a recognized inter

Passing Variables WITHOUT Dynamic URLs

2009-09-16 Thread Victor Subervi
Is there a way to pass this variable without that and without using a form for every page (which is not practical)? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing Variables WITHOUT Dynamic URLs

2009-09-17 Thread Victor Subervi
properly. >> > > What kind of web framework are you using? Most allow you to access the HTTP > headers sent with a request -- in this case, what you'd be after is the > 'User-Agent' header. > > > On Wed, 16 Sep 2009 16:21:41 -0700, Victor Subervi < > victor

Re: Passing Variables WITHOUT Dynamic URLs

2009-09-17 Thread Victor Subervi
Session variables, yes. That is what I need. Thanks, V On Thu, Sep 17, 2009 at 11:46 AM, Carsten Haese wrote: > Victor Subervi wrote: > > Right. Bad example on my part. How about if I want to pass a cookie from > > page to page? Or some data called up from a database query? >

Python/MySQL Frustration

2009-09-20 Thread Victor Subervi
ption="' + descr + '", UOM="' + uom + '", Price="' + price + '"' sql = 'insert into %s values (%s);' % (company, sql) cursor.execute(sql) i += 1 Now, all of this posts to the mysql database, but it forms an infinite loop! I have num == 1! I have printed num to make sure it's actually only 1 (or 2, depending). What in the heck am I doing wrong? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Python/MySQL Frustration

2009-09-20 Thread Victor Subervi
Yeah, that was the problem..."num" was a string ;) Just caught it myself, too. Thanks, V On Sun, Sep 20, 2009 at 2:37 PM, Philip Semanchuk wrote: > > On Sep 20, 2009, at 2:25 PM, Victor Subervi wrote: > > Hi; >> I have the following code: >> >>w

Dynamic Form

2009-09-22 Thread Victor Subervi
. The problem is, that when I go back to refresh the form, the data is re-entered into the table! How do I prevent that? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic Form

2009-09-22 Thread Victor Subervi
Well it's Web stuff, sure, but it's written in python :) The code follows. The problem is that I haven't figured out how to tell the program that the user has entered data and to clear the cache of that data so that it's not re-entered. How do I do that? TIA, Victor #!/us

Re: Dynamic Form

2009-09-23 Thread Victor Subervi
ot; if flag == '': print """ Company Name: """ else: host = 'h' db = 'db' user = 'u' passwd = '1' database = MySQLdb.connect(host, user, passwd, db) cursor = database.curso

Re: Dynamic Form

2009-09-24 Thread Brian Victor
victorsubervi wrote: > On Wed, Sep 23, 2009 at 9:13 PM, BJ Swope wrote: >> Is your web browser re-submitting the form with the same data if you >> refresh the screen? > yes I'm surprised no one has mentioned this before, but the standard approach to this problem is to redirect after a successful

Reversing a List

2010-09-01 Thread Victor Subervi
Hi; I have this code: cursor.execute('describe products;') cols = [item[0] for item in cursor] cols = cols.reverse() cols.append('Delete') cols = cols.reverse() Unfortunately, the list doesn't reverse. If I print cols after the first reverse(), it prints None. Please advise. Also, is th

Re: Reversing a List

2010-09-01 Thread Victor Subervi
On Wed, Sep 1, 2010 at 9:17 AM, Shashank Singh < shashank.sunny.si...@gmail.com> wrote: > reverse reverses in-place > > >>> l = [1, 2, 3] > >>> r = l.reverse() > >>> r is None > True > >>> l > [3, 2, 1] > >>> > Ah. Thanks! beno -- http://mail.python.org/mailman/listinfo/python-list

MySQL Problem

2010-09-02 Thread Victor Subervi
Hi; I have this code: print 'select * from spreadsheets s join products p on p.Item=s.Item join productsCategories pc on p.ID=pc.ProductsID join categories c on pc.CategoryID=c.ID where s.Client="%s" order by c.Category, c.Parent' % (client,) cursor.execute('select * from spreadsheets s jo

Re: Reversing a List

2010-09-02 Thread Victor Subervi
On Wed, Sep 1, 2010 at 9:26 AM, Shashwat Anand wrote: > > > On Wed, Sep 1, 2010 at 6:45 PM, Matt Saxton wrote: > >> On Wed, 1 Sep 2010 09:00:03 -0400 >> Victor Subervi wrote: >> >> > Hi; >> > I have this code: >> > >> > curso

Re: MySQL Problem

2010-09-03 Thread Victor Subervi
On Thu, Sep 2, 2010 at 3:02 PM, Ian wrote: > On 02/09/2010 19:34, Victor Subervi wrote: > >> for some reason running the command through python *omits* this one data!! >> The only difference is that a flag in spreadsheets (Temp) is set to 1. Why >> on earth doesn't

Re: MySQL Problem

2010-09-03 Thread Victor Subervi
This is an addendum to my last post. Please observe the following: mysql> select * from spreadsheets where Temp=1; +-++---+-++--+ | ID | Client | Multi | Item| Markup | Temp | +-++---+-++--

Re: MySQL Problem

2010-09-03 Thread Victor Subervi
On Fri, Sep 3, 2010 at 9:25 AM, Richard Arts wrote: > These are also mere suggestions. > > The statements you use in your print statement and the one you use to > feed the cursor differ slightly. The latter is missing quotes around > your search criterium. > > Isn't it possible to fetch results r

MySQL Query Problem

2010-09-17 Thread Victor Subervi
Hi; I have this code: cursor.execute('insert into Passengers values (Null, %s, %s, %s, %s, %s, %s, %s, %s, "no", "n/a")', (curr_flight, curr_customer, name, curr_sex, curr_weight, price, curr_rt, curr_confirmation)) Now, when I print it out, add quotes where necessary and enter it in at a

Re: MySQL Query Problem

2010-09-17 Thread Victor Subervi
| 1 | '' | NULL | NULL | 0.00 | 0 | 12345| NULL | NULL | | 15 | 1 | 1 | Dr. Mengela | Male |155 | 0.00 |100 | 654 | no | n/a | +----++-+-+--++---++--+---

Re: MySQL Query Problem

2010-09-17 Thread Victor Subervi
I rebooted MySQL and it now works fine ;) On Fri, Sep 17, 2010 at 9:26 AM, Victor Subervi wrote: > Here's some more data: > > print 'insert into Passengers values (Null, %s, %s, %s, %s, %s, %s, > %s, %s, "no", "n/a")' % (curr_flight, curr

Re: Down with tinyurl! (was Re: importing excel data into a python matrix?)

2010-09-20 Thread Brian Victor
Tim Harig wrote: > Posting two URLs rather defeats the purpose of using a URL shortening > service in the first place; but, if that is what you feel is effective, > then by all means, do so. You are the master of your posts and you have > the right to post them using whatever methods and formating

Python package to accept payments in Internet

2017-05-02 Thread Victor Porton
gateway for many different payment processors. Buy the commercial version and support scientific research and a new principle of the Web I am working on. I hope you don't take this message as spam. Is it OK to post updates of our software to this mailing list in the future? -- Victor Porton -

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
Steve D'Aprano wrote: > On Wed, 3 May 2017 02:19 am, Victor Porton wrote: > >> I have created a full featured package to accept payments in Internet >> (currently supports PayPal). > [...] >> Buy the commercial version and support scientific research and a

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
On Wed, 2017-05-03 at 17:02 +0200, Chris Warrick wrote: > On 3 May 2017 at 16:45, Victor Porton wrote: > > Steve D'Aprano wrote: > > > > > On Wed, 3 May 2017 02:19 am, Victor Porton wrote: > > > > > > > I have created a full featu

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
Chris Warrick wrote: > On 3 May 2017 at 17:19, Victor Porton wrote: >> What do you mean by "banned"? Does this mean that Google does not use >> software of this license? > > https://opensource.google.com/docs/using/agpl-policy/ > https:

Re: Python package to accept payments in Internet

2017-05-03 Thread Victor Porton
On Wed, 2017-05-03 at 17:02 +0200, Chris Warrick wrote: > On 3 May 2017 at 16:45, Victor Porton wrote: > > Steve D'Aprano wrote: > >  > > > On Wed, 3 May 2017 02:19 am, Victor Porton wrote: > > >  > > > > I have created a full featu

Re: Python package to accept payments in Internet

2017-05-04 Thread Victor Porton
Gregory Ewing wrote: > Victor Porton wrote: >> You carp with words, finding a problem where there is no real problem, >> just words (I mean the word "hack") which sound like a problem. > > Words are important. The very fact that it sounds like a > problem

Nested Loop to Generate Triangle

2017-05-25 Thread Victor Demelo
I need the triangle to be in reverse. The assignment requires a nested loop to generate a triangle with the user input of how many lines. Currently, I get answers such as: OOO OO O When I actually need it to be like this: OOO OO O I just need to get it flipped-over on the other

Nested

2017-05-25 Thread Victor Demelo
d -- https://mail.python.org/mailman/listinfo/python-list

Re: Nested Loop to Generate Triangle

2017-05-25 Thread Victor Demelo
On Thursday, May 25, 2017 at 12:28:45 PM UTC-4, Victor Demelo wrote: > I need the triangle to be in reverse. The assignment requires a nested loop > to generate a triangle with the user input of how many lines. > > Currently, I get answers such as: > > OOO > OO > O &

Re: Nested Loop to Generate Triangle

2017-05-25 Thread Victor Demelo
On Thursday, May 25, 2017 at 12:28:45 PM UTC-4, Victor Demelo wrote: > I need the triangle to be in reverse. The assignment requires a nested loop > to generate a triangle with the user input of how many lines. > > Currently, I get answers such as: > > OOO > OO > O &

Nested Loop Triangle

2017-05-25 Thread Victor Demelo
I need the triangle to be in reverse. The assignment requires a nested loop to generate a triangle with the user input of how many lines. Currently, I get answers such as: (A) OOO OO O When I actually need it to be like this: (B) OOO OO O I need the display (A) to

Re: Is there a nicer way to do this?

2007-10-04 Thread Victor B. Gonzalez
he dictionary is unnecessary but I may be wrong. anyhow, I keep getting "SyntaxError: Non-ASCII character '\xc2'..." on line 5. anyone know what this is? I couldn't run the script but from looking at it, it appears you're making some pointless keys when indexes may b

Re: "SyntaxError: Non-ASCII character '\xc2'...", was Re: Is there a nicer way to do this?

2007-10-05 Thread Victor B. Gonzalez
On Friday 05 October 2007 3:33:43 am Peter Otten wrote: > Victor B. Gonzalez wrote: > > anyhow, I keep getting "SyntaxError: Non-ASCII character '\xc2'..." on > > line 5. anyone know what this is? > > I too had that problem with KNode. Leading space consist

Re: Newbi Q: Recursively reverse lists but NOT strings?

2007-10-14 Thread Victor B. Gonzalez
be wrong but from a quick glance you'll need to end it for sure when dealing with recursion. maybe also trying to reverse using the iterator function reversed() or this shortcut may help e.g, 'abc'[::-1] -> 'cba'. good luck! -- Best Regards Victor B. Gonzalez -- http://mail.python.org/mailman/listinfo/python-list

RE: issue for setup pandas

2021-09-21 Thread Fady Victor Mikhael Abdelmalk
info failed')': /simple/pandas/ WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError(': Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/pandas/ Thanks, Fady

Re: What is not working with my "map" usage?

2018-09-22 Thread Victor via Python-list
Let me use a different input args and display them below. Basically, I am hoping to add up all elements of each nested list. So at first it should start with [1,11,111] ==> 1+11+111 = 123. But instead, it appears to take the 1st element from each nested list to add up [1,2,3] = 6. How shoul

Re: What is not working with my "map" usage?

2018-09-22 Thread Victor via Python-list
On Saturday, September 22, 2018 at 6:22:32 AM UTC-7, Peter Otten wrote: > Victor via Python-list wrote: > > > Let me use a different input args and display them below. Basically, I am > > hoping to add up all elements of each nested list. So at first it should > > start

Re: What is not working with my "map" usage?

2018-09-22 Thread Victor via Python-list
On Saturday, September 22, 2018 at 12:20:08 PM UTC-7, Thomas Jollans wrote: > On 22/09/2018 20:18, Victor via Python-list wrote: > > On Saturday, September 22, 2018 at 6:22:32 AM UTC-7, Peter Otten wrote: > >> Victor via Python-list wrote: > >> > >>> Let me

<    3   4   5   6   7   8