Re: Callback from c thread with ctypes

2009-03-08 Thread Victor Lin
On 3月8日, 下午9時56分, "Diez B. Roggisch" wrote: > Victor Lin schrieb: > > > > > Hi, > > > I am going to develop a c library binding with ctypes. That c library > > will call callback from worker threads it created. Here comes the > > problem : Wi

Re: Callback from c thread with ctypes

2009-03-08 Thread Victor Lin
On 3月8日, 下午10時20分, Christian Heimes wrote: > Victor Lin wrote: > > Hi, > > > I am going to develop a c library binding with ctypes. That c library > > will call callback from worker threads it created. Here comes the > > problem : Will the GIL be acquired before it

Any c header parser for generate ctypes module?

2009-03-09 Thread Victor Lin
arser that parse header of c library and generate ctypes python module automatically. My question is, is there any available tools can achieve this? If not, what tool can I use to such a job easily. I need a c parser, is there any C parser written in python? Thanks. Victor Lin. -- http://mail.pytho

How Get Name Of Working File

2009-03-22 Thread Victor Subervi
quot;? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Printing Out Called Function Calls

2009-03-31 Thread Victor Subervi
, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing Out Called Function Calls

2009-03-31 Thread Victor Subervi
> > change server famrs? > Really. But I imagine they are all trash for the price I pay. > > use eval() or exec()? > eval worked, exec no. Thanks! > > andrew > > -- http://mail.python.org/mailman/listinfo/python-list

Eval Problem

2009-04-06 Thread Victor Subervi
d add: print tableBottom(348,180) it prints! What´s wrong? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Eval Problem

2009-04-07 Thread Victor Subervi
ll nicely print the commands, such as this: tableTop(123,456) which is supposed to call said fn. If I place that line in the file calling the text files and the bits file it will execute just fine, but that inevitably makes my job harder. Ideas? TIA, Victor On Mon, Apr 6, 2009 at 6:37 PM, J. Clif

Re: Custom Classes?

2008-05-13 Thread Victor Subervi
On 5/9/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Thu, 08 May 2008 12:33:55 -0300, Victor Subervi < > [EMAIL PROTECTED]> escribió: > > Okay, trying this again with everything working and no ValueError or any > > other errors, here we go: > >

Re: Custom Classes?

2008-05-13 Thread Victor Subervi
I remember why I had the number with the getpic. It is because I display several of these images on a single page, and apparently I cannot call the same script and get more than one image from an HTML page. Victor On Fri, May 9, 2008 at 10:26 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote:

Re: Custom Classes?

2008-05-15 Thread Victor Subervi
Well, you are right. It looks like one of those instances where I fixed something and did not check to see if it influenced the problem now at hand. Thanks again. Victor On 5/15/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Tue, 13 May 2008 15:10:21 -0300, Victor Suberv

Re: Python is slow

2008-05-24 Thread Paolo Victor
I love it when a troll tries to make his/hers/its point with a vague, biased assumption: "I mean, it's not that slow - wait, I guess it's slower, because I... I think so! Yeah! It's slow! At least it feels like it..." It's all about choosing the right tool. If you think Python doesn't suit your n

Re: shorten this: if char in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz":

2008-06-24 Thread Brian Victor
cirfu wrote: > if char in "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz": > > cant i write something like: > if char in "[A-Za-z]": Either of the following should do what you want, without resorting to regular expressions: import string if char in string.letters: or if char.isalpha():

Re: C++ or Python

2008-06-28 Thread Victor Noagbodji
in a team. Python doesn't give you much choice on the code layout, and that's a good thing. And it also increases the speed of your coding. I strongly suggest you learn Python, then C (not C++) in order to extend Python when you feel like something is slow. -- NOAGBODJI Paul Victo

Re: Beginner's Python development questions

2008-06-28 Thread Victor Noagbodji
Python 2.5 that will not break; you just have to avoid things that will be deprecated. >3. Is this good mailing list for such questions? Of course. >Sorry for my English - it isn't my native language :) >Greetings, Łukasz. No problemo. -- NOAGBODJI Paul Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML Parsing

2008-06-28 Thread Victor Noagbodji
in Python too? That would be great. BeautifulSoup: http://www.crummy.com/software/BeautifulSoup/ http://www.crummy.com/software/BeautifulSoup/documentation.html All the best -- NOAGBODJI Paul Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: How to make a function associated with a class?

2008-07-01 Thread Victor Noagbodji
; Thank you in advance. > > Do you think a static method will do the thing? > Well you can define the function inside the class. Then create a name outside the class that references it. Is is. dot = Class.dot. By the way, why do you want to tie this function to the class? -- NOAGBODJI Paul Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: GUI Programming by hand not code with Python Code

2008-07-06 Thread Victor Noagbodji
he Designer program that comes with PyQt. -- NOAGBODJI Paul Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple Image Cropper

2008-07-14 Thread Victor Noagbodji
mon/pygtkimageview-docs/gtkimageview.ImageToolSelector-class.html) that can be customized to make an image cropper. Well, I hope my little finding can help. -- NOAGBODJI Paul Victor -- http://mail.python.org/mailman/listinfo/python-list

Simplify Code

2008-07-15 Thread Victor Subervi
er_size == size: # The following line is ILLEGAL h + string(header_size) = line del = 1 if del = 1 # The following line is ILLEGAL h + string(header_size) = '' How can I rewrite those illegal lines, such that I can create the proper name for the variable, and write the necessary data? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Type Problem

2008-07-15 Thread Victor Subervi
line 1, in type(len(dirs)) TypeError: 'int' object is not callable Forgot to bring it with me, but type(len) gives me an intelligent response. TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Characters Being Misread

2008-07-15 Thread Victor Subervi
Here's another one: >>> rtf_markup = '\viewkind4\\uc1\\pard\nowidctlpar\\qc\\i\x0c0\x0cs36' >>> a = [] >>> a.append(re.compile('\\i').match(rtf_markup, 1)) >>> a [<_sre.SRE_Match object at 0x011802F8>] >>> a = [] >>> a.append(re.compile('\\qc').match(rtf_markup, 1)) [None] What's the problem? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Is it legal to rebuild Python.exe to include Version property tab?

2008-07-15 Thread Victor Noagbodji
I think it is. I got a bundle of Python named EnthoughtPython and the version string gave something different from original Python. -- NOAGBODJI Paul Victor -- http://mail.python.org/mailman/listinfo/python-list

'if name is not None:' v. 'if name:'

2008-07-15 Thread Victor Noagbodji
Hello, what's the difference between these two statement? And which one should one use? -- NOAGBODJI Paul Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: 'if name is not None:' v. 'if name:'

2008-07-15 Thread Victor Noagbodji
f course. > > Well that's exactly why I'm asking. Since None returns False in if statements. Why do people use if name is not None: instead of simply writing if not name? -- NOAGBODJI Paul Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Simplify Code

2008-07-29 Thread Victor Subervi
Thanks. That worked. Victor On 7/16/08, Alexandr N Zamaraev <[EMAIL PROTECTED]> wrote: > > header_sizes = (36, 26, 22, 18, 14, 12) > if x not in header_sizes: > raise Exception() > else: > h36, h26, h22, h18, h14, h12 = tuple( >line if x == size el

Windows Interpreter

2008-07-29 Thread Victor Subervi
Hi: I would like to make my windows python interpreter work like my linux one. I want to be able to cut and paste multiple lines of code. Now I can only paste one line at a time. I do not want it to indent automatically. How can I change this? TIA, Victor -- http://mail.python.org/mailman/listinfo

RTF Parsing

2008-07-29 Thread Victor Subervi
xpected this: >>> a() \qc \i >>> Why do I get more than that? Also, if I change this line thus: c = '(?<=' + char + ')[0 ]' I get this result: >>> a() \b >>> Why? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Windows Interpreter

2008-07-29 Thread Victor Subervi
t him?\par' for char in chars: c = '(?<=' + char + ')' test = re.search(c, rtf_markup) try: junk = test.group(0) print char except: pass Now, I can paste that entire fn in linux. But in windows I have to paste it line_by_line. Pain in

Re: Windows Interpreter

2008-07-29 Thread Victor Subervi
I´ll try that. Back online in a week. Victor On 7/29/08, Tim Golden <[EMAIL PROTECTED]> wrote: > > Victor Subervi wrote: > >> def a(): >> chars = ['\\i0', '\\u0', '\\qc', '\\b0', '\\ql', '\\i', '\\u&#

How to redirect operation methods to some sepcific method easily?

2008-08-03 Thread Victor Lin
Hi, I'd like to write some class that can help me build reusable formula easily, some simple code like this. # -*- coding: utf8 -*- class OperationResult: def __init__(self, left, right): self.dataSource = dataSource def __add__(self, other): self.dataSource.stack.append(

Cutting and Pasting in Windows IDLE

2008-08-12 Thread Victor Subervi
o have QuickEdit on by default in all by console windows, but the only difference I expect that to make is that you'd otherwise have to use the window's System Menu (Alt-Space, Edit, Paste). TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Logging library unicode problem

2008-08-13 Thread Victor Lin
be considered as a bug? If it is, how to report this bug? Is my solution correct? Are there any side effect will caused by doing so? If the code I write is fine, and solve that problem, how to report it to Python's project? I think this could be helpful for people who also encountered this problem. Thanks. Victor Lin. -- http://mail.python.org/mailman/listinfo/python-list

Adding Images to MySQL

2008-04-01 Thread Victor Subervi
col_names + ') values (' + col_values + ');') where col_names is all the names of the columns and col_values, obviously, the values. Works fine for strings and digits. Not so well for files :) What do? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Adding Images to MySQL

2008-04-02 Thread Victor Subervi
lose() print '\nBye!\n' which prints Hi! but not Bye! and gives me an HTTP 200 error. I threw the line f = imgfile.read() in there just to make sure it is reading the imgfile. Also, I tested it with all the import statements alone to make sure it was importing everything. So the problem

Strange MySQL Problem...

2008-04-02 Thread Victor Subervi
, if I take out this part, which I can´t see does anything at all in the code, it no longer works: names = 'aramis', 'athos', 'porthos' data = {} for name in names: datum = list(name) datum.sort() data[name] = cPickle.dumps(datum, 1) Why? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange MySQL Problem...

2008-04-03 Thread Victor Subervi
the script insists on, is a relic from the code I tweaked. It was there to make a binary, that is all. So why do I still need the darn thing?? > > You have to look at the server error logs, else you're blind fighting. > I am blind fighting. No longer run my own server, no longer have root access. > See > other suggestions in my previous post. > Sorry. Can you repost it? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange MySQL Problem...

2008-04-03 Thread Victor Subervi
On Thu, Apr 3, 2008 at 9:34 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 03 Apr 2008 09:43:57 -0300, Victor Subervi > <[EMAIL PROTECTED]> escribió: > > >> Steve Holden wrote: > >> Define "no longer works". > > Sorry. Throws HTT

Re: Adding Images To MySQL

2008-04-05 Thread Victor Subervi
>* *(What a mess! I don't know where to begin...) Yeah. Never claimed to be any good at this :( Just persistent :) >* *- You say Content-Type: image/jpeg but you emit HTML code. You're lucky if you see any >* *text at all. Well, I tried Content-Type: text/html and that threw an HTTP 500 Error

Re: Adding Images To MySQL

2008-04-07 Thread Victor Subervi
in line... On 4/5/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > > En Sat, 05 Apr 2008 11:32:00 -0300, Victor Subervi > <[EMAIL PROTECTED]> escribió: > > >> * *- You say Content-Type: image/jpeg but you emit HTML code. You're > >> lucky > >

String Literal to Blob

2008-04-08 Thread Victor Subervi
ength: %d\n' % len(content) print 'Content-Type: image/jpeg\r\n' print '\n' print content print '\n' cursor.close() test() (Apparently, Plesk doesn´t like if __name__ == '__main__': ) The commented out line gives me a leading less than sign...and that´s it. What do? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: String Literal to Blob

2008-04-08 Thread Victor Subervi
Thanks. I apparently am printing some holder for the image. I stripped out most of it with this content[0][0] but then I am left with this: array('c', '\xff\xd8\xff\xe0\\0\x10JFI...) How do I extract an image from that? TIA, Victor On Tue, Apr 8, 2008 at 11:15 AM, Steve

Re: String Literal to Blob

2008-04-09 Thread Victor Subervi
ng is inadvisable: form = cgi.FieldStorage() pic1 = form.getfirst('pic1', '') This appears to work better: form = cgi.FieldStorage() imgfile=open("pixel.gif",'rb') pixel = imgfile.read() pic1 = form.getfirst('pic1', pixel) because it gives a binary default. The string appears to screw things up. Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: String Literal to Blob

2008-04-09 Thread Victor Subervi
On Wed, Apr 9, 2008 at 10:24 AM, Steve Holden <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > On Wed, Apr 9, 2008 at 1:14 AM, Gabriel Genellina > > <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote: > > Now all you have to do is what I told you i

Re: String Literal to Blob

2008-04-09 Thread Victor Subervi
On Wed, Apr 9, 2008 at 11:10 AM, Steve Holden <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > > On Wed, Apr 9, 2008 at 10:24 AM, Steve Holden <[EMAIL PROTECTED] > [EMAIL PROTECTED]>> wrote: > > connection = MySQLdb.connect(host=host, user=us

Re: String Literal to Blob

2008-04-09 Thread Victor Subervi
On Wed, Apr 9, 2008 at 12:51 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > > On Wed, Apr 9, 2008 at 11:10 AM, Steve Holden <[EMAIL PROTECTED] > [EMAIL PROTECTED]>> wrote: > > > > I'm having a problem believing this, but I

Re: String Literal to Blob

2008-04-09 Thread Victor Subervi
On Wed, Apr 9, 2008 at 1:49 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > On Wed, Apr 9, 2008 at 12:51 PM, Steve Holden <[EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]>> wrote: > I imagine the following code should do so, given yo

Re: String Literal to Blob

2008-04-10 Thread Victor Subervi
no_bre' user = 'benobeno' passwd = '21122112' connection = MySQLdb.connect(host=host, user=user, passwd=passwd, db=db) cursor = connection.cursor() cursor.execute('select pic1 from products where id="2";') content = cursor.fetchall()[0][0] content = content.tostr

Re: String Literal to Blob

2008-04-10 Thread Victor Subervi
g i. Ugly. Stupid. But if it is the only way to do it in python, and I do not want to invest the time doing it in php, which I think would be prettier in this instance, then I guess it will do. Your thoughts appreciated. Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: String Literal to Blob

2008-04-11 Thread Victor Subervi
Nope. Do not see it. My ugly stupid way works. I guess I will just proceed with that and write my howto accordingly. Victor On Thu, Apr 10, 2008 at 9:01 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 10 Apr 2008 14:04:43 -0300, Victor Subervi > <[EMAIL PROTE

Re: String Literal to Blob

2008-04-11 Thread Victor Subervi
. Victor On Fri, Apr 11, 2008 at 8:55 AM, Steve Holden <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > Nope. Do not see it. My ugly stupid way works. I guess I will just > > proceed with that and write my howto accordingly. > > Victor > > > OK, but be prepar

Re: String Literal to Blob

2008-04-12 Thread Victor Subervi
in line... On Fri, Apr 11, 2008 at 2:05 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > I have worked on this many hours a day for two weeks. If there is an > > easier way to do it, just take a minute or two and point it out. Have > > you hear

Re: String Literal to Blob

2008-04-14 Thread Victor Subervi
e how calling a separate script like that would work! Again, you should have shared that before. How was I to think of that clever trick from the bare information you gave me earlier?? Steve, thank you for all your help, but do overcome your temper :)) Victor On Sun, Apr 13, 2008 at 7:05 AM, Steve H

Re: String Literal to Blob

2008-04-15 Thread Victor Subervi
it simply isn't out there. At all. There are nice howto's in php. Please post this for those interested in python, somewhere like the cookbook. Thanks, Victor On Tue, Apr 15, 2008 at 3:23 AM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Mon, 14 Apr 2008 11:03:5

Re: String Literal to Blob

2008-04-16 Thread Victor Subervi
The _keywords_ are _essential_. It is currently published at the end of a long and exhaustive thread. This is not good. It should be republished correctly, and with the kw people will use to search. For example, I would never have thought to search for a photo album. Victor On Tue, Apr 15, 2008

Importing My Own Script

2008-04-17 Thread Victor Subervi
Hi: How do I import my own script from a second script? That is, I have script x and I want to import script y. How? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

More Fun With MySQL and Images

2008-04-17 Thread Victor Subervi
x27; % len(content) print '\n' print content print '\n' cursor.close() test() Now, when I surf to the url of this script, it prints out garbage that is a literal of the image, but not the image itself. However, if I surf to ¨somefile.jpg¨, I see the image!! Am I losing my mind?? What´s wrong here? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Importing My Own Script

2008-04-17 Thread Victor Subervi
[error] [client 190.166.0.245] PythonHandler mod_python.cgihandler: ImportError: No module named test2 I´m running through Plesk, if that makes a difference. TIA, Victor > > - Original Message > From: Victor Subervi <[EMAIL PROTECTED]> > To: python-list@python.org > Sen

Re: More Fun With MySQL and Images

2008-04-17 Thread Victor Subervi
Never mind. Apparently, these tags throw it for that loop: print '\n' I´m surprised they would, but gratified I found the problem. Victor On Thu, Apr 17, 2008 at 9:42 AM, Victor Subervi <[EMAIL PROTECTED]> wrote: > Hi again: > Here is my code, an edit of Gabriel´s: >

Re: More Fun With MySQL and Images

2008-04-17 Thread Victor Subervi
Yeah, I figured that out between posts ;) On Thu, Apr 17, 2008 at 10:39 AM, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > On Thu, 2008-04-17 at 09:52 -0500, Victor Subervi wrote: > > Never mind. Apparently, these tags throw it for that loop: > > print '\n' &g

Prob. w/ Script Posting Last Value

2008-04-17 Thread Victor Subervi
print content I need to make it so that it will show all my images, not just the last one. Suggestions, please. TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Prob. w/ Script Posting Last Value

2008-04-17 Thread Victor Subervi
On Thu, Apr 17, 2008 at 1:07 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Victor Subervi wrote: > > > Hi; > > Gabriel provided a lovely script for showing images which I am modifying > > for my needs. I have the following line: > > print '\n' % (

Error Handling

2008-04-17 Thread Victor Subervi
nstead, I get more garbage: [Thu Apr 17 12:10:38 2008] [error] [client 190.166.0.245] PythonHandler mod_python.cgihandler: NameError: global name 'OperationalError' is not defined, referer: http://livestocksling.com/bre/iud.py What do? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Importing My Own Script

2008-04-17 Thread Victor Subervi
That worked. Thanks. Victor On Thu, Apr 17, 2008 at 2:18 PM, Raúl Gómez C. <[EMAIL PROTECTED]> wrote: > Victor, you can do this in order to load your own modules: > > import sys,os > sys.path.append(os.getcwd()) > > import your_module > > > > On Fri,

Another MySQL Images Question

2008-04-18 Thread Victor Subervi
and try and re-insert it thus: cursor.execute('update products set pic1="%s" where id="%s", ;', (pic1, id)) it tells me I have an error in my MySQL syntax. What is the error? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Another MySQL Images Question

2008-04-18 Thread Victor Subervi
Thank you. That worked. Victor On Fri, Apr 18, 2008 at 10:48 AM, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > There are several problems with your SQL, but not all of them would be > caught by the computer. Your SELECT statement is not parameterized. > This is a security pr

Re: Error Handling

2008-04-22 Thread Victor Subervi
That worked. Thanks! Victor On Sun, Apr 20, 2008 at 11:02 PM, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 17 Apr 2008 16:19:12 -0300, Victor Subervi < > [EMAIL PROTECTED]> escribió: > > > try: > > cursor.execute(sql) > > print

Goodbying Spaces

2008-04-25 Thread Victor Subervi
d = id[0:len(id) - 1] except: pass which is a nuisance. Is there a better way to do this? I have tried id.strip() with no luck. What do? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Goodbying Spaces

2008-04-29 Thread Victor Subervi
he last character >id = id[:-1] # Again, a slice with only one argument > except: > pass Oh, yeah. Forgot about that. Thanks! Victor -- http://mail.python.org/mailman/listinfo/python-list

Colors for Rows

2008-04-29 Thread Victor Subervi
print '\n' It never increments z! Yet, if I print z, it will increment and change the bgcolor! Why?! Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Colors for Rows

2008-04-29 Thread Victor Subervi
On Tue, Apr 29, 2008 at 11:11 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Tue, 29 Apr 2008 09:33:32 -0500 > "Victor Subervi" <[EMAIL PROTECTED]> wrote: > > why doesn't this work? > > First, let me remove some blank lines to reduce sc

Re: Colors for Rows

2008-04-30 Thread Victor Subervi
Thank you all. You helped clean up my code. The stupid mistake was in where I set the initial value of the variable z. Victor On Tue, Apr 29, 2008 at 3:20 PM, J. Cliff Dyer <[EMAIL PROTECTED]> wrote: > On Tue, 2008-04-29 at 15:39 -0400, D'Arcy J.M. Cain wrote: > > On Tue,

Custom Classes?

2008-04-30 Thread Victor Subervi
t " + pic + " from products where id='" + str(picid) + "';" cursor.execute(sql) content = cursor.fetchall()[0][0].tostring() cursor.close() print 'Content-Type: image/jpeg' print print content """ script = open(getpic, "w") script.write(code) print '' % pic print '\n' % (getpic, d, y) TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Colors for Rows

2008-04-30 Thread Victor Subervi
The problem was that z was not incrementing. It kept getting reset to 3, then incremented to 4 immediately, and reset back to 3. Stupid :/ On Wed, Apr 30, 2008 at 11:01 AM, D'Arcy J.M. Cain <[EMAIL PROTECTED]> wrote: > On Wed, 30 Apr 2008 10:57:44 -0500 > "Victor Sube

Re: Custom Classes?

2008-05-01 Thread Victor Subervi
te(sql) content = cursor.fetchall()[0][0].tostring() cursor.close() print 'Content-Type: image/jpeg' print print content """ script = open(getpic, "w") script.write(code) print '' % pic print '\n' % (getpic, d, y) except: pass TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Custom Classes?

2008-05-02 Thread Victor Subervi
d, y) print '\n' Now, on those last 3 lines, I am having trouble with this error being thrown that I don´t understand: ValueError: unpack list of wrong size If I surf to the given url, the image appears! So what gives?? Furthermore, the code works just fine from where it was lifted. TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Custom Classes?

2008-05-08 Thread Victor Subervi
ect %s from products where id='%s';" % (pic, str(picid)) cursor.execute(sql) content = cursor.fetchall()[0][0].tostring() cursor.close() print 'Content-Type: image/jpeg' print print content """ script = open(getpic, "w") script.write(code) script.close() and then surf to: http://whatever.url/getpic20.py?id=6&x=1 Also, please re-send the link on how to post good questions to the list. I cannot find it. TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython beginners problem

2008-08-15 Thread Brian Victor
Ivan Reborin wrote: > win.Show This line isn't doing anything. It needs to be: win.Show() # note the parentheses -- Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is slow?

2008-09-29 Thread Victor Prosolin
>Gnuplot is freeware in the sense that you don't have to pay for it. > However >it is not freeware in the sense that you would be allowed to > distribute a >modified version of your gnuplot freely. [...] Yes, I did read this prior to posting. Victor. -- http://mail.python.org/mailman/listinfo/python-list

Re: Meetup in "Rapid prototyping in business & social networking in python"

2008-10-01 Thread Victor Bay
"BayVictor" -- which I use at gmail. Thanks and wish python can bite your way out, :) Victor. -- http://mail.python.org/mailman/listinfo/python-list

OpenGL on Intel Mac

2006-04-06 Thread Brian Victor
I am attempting to build PyOpenGL on my Intel iMac. The transcript of the build failure is here: http://brianhv.org/temp/pyopengl-build.log I'm using the universal MacPython 2.4.3 and PyOpenGL-2.0.1.09. The highlight of the build log is: /System/Library/Frameworks/Kernel.framework/Headers/sys/s

Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
On Thu, Nov 26, 2009 at 5:08 PM, Dennis Lee Bieber wrote: > On Thu, 26 Nov 2009 13:32:12 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > > A problem occurred in a Python script. Here is the sequence of function > > calls leading up

Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
On Fri, Nov 27, 2009 at 9:02 AM, Rami Chowdhury wrote: > On Fri, Nov 27, 2009 at 02:59, Victor Subervi > wrote: > > On Thu, Nov 26, 2009 at 5:08 PM, Dennis Lee Bieber < > wlfr...@ix.netcom.com> > > wrote: > >> Nothing hinting at having > >> op

Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
On Fri, Nov 27, 2009 at 12:13 PM, Carsten Haese wrote: > Victor Subervi wrote: > > The difficulty I am having is that for > > some reason it's not inserting. The form inserts the first image but not > > the second. > > My guess is that you're not calling db.

Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
On Fri, Nov 27, 2009 at 1:43 PM, Dennis Lee Bieber wrote: > On Fri, 27 Nov 2009 05:59:39 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > > > > > > The following complained that there weren't enough arguments: > >

Re: Can't Encode Pic

2009-11-27 Thread Victor Subervi
> > > > > > > > > The problem here is that only one of the images prints on the said page! > > However, if I surf to those URLs, the images appear! > > Are you sure that you're surfing to *exactly* those URLs? When I go to > http://www.angrynates.com/cart/getpic.py?pic=2&id=1, I get an image, but

Exec Statement Question

2009-11-29 Thread Victor Subervi
...) or var = exec(...) but of course those options don't work. Suggestions? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Exec Statement Question

2009-11-30 Thread Victor Subervi
On Sun, Nov 29, 2009 at 10:23 PM, Dave Angel wrote: > exec is a statement, and statements don't have "return values." It's not > a function, so there are no parentheses in its syntax, either. exec is also > a technique of last resort; there's nearly always a better/safer/faster way > to accom

Completely OT

2009-11-30 Thread Victor Subervi
m all at once to a table in a database, and move on to the next page. I believe this is achieved through JSON and AJAX; however, I haven't been able to google any demonstrations of this sort. Am I correct, or should I use some other sort of technology? TIA, Victor -- http://mail.python.o

Re: Exec Statement Question

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 12:25 PM, Carsten Haese wrote: > Victor Subervi wrote: > > Taking out the parenthesis did it! Thanks. Now, you state this is an > > option of last resort. Although this does indeed achieve my desired aim, > > here is a complete example of what I am t

Re: Completely OT

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 1:15 PM, Rami Chowdhury wrote: > On Mon, Nov 30, 2009 at 04:26, Victor Subervi > wrote: > > Hi; > > I need a recommendation. I want to print out data like this: > > > > blue > > red > > > > and enable the user to selec

Re: Exec Statement Question

2009-11-30 Thread Victor Subervi
On Mon, Nov 30, 2009 at 1:12 PM, Dave Angel wrote: > Victor Subervi wrote: > >> On Sun, Nov 29, 2009 at 10:23 PM, Dave Angel wrote: >> >> >> >>> exec is a statement, and statements don't have "return values." It's >>> n

Re: Completely OT

2009-11-30 Thread Victor Subervi
that won't help me actually print to screen the user's choices as he selects them, which in my application, is important. Please advise. TIA, V > > On Mon, Nov 30, 2009 at 7:26 AM, Victor Subervi > wrote: > > Hi; > > I need a recommendation. I want to print out data

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
he permissions: -rwxr-xr-x 1 root root 455 Nov 28 05:58 particulars.py When I go into the python interpreter and execute that statement, it succeeds. What have I missed? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

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 > >

<    1   2   3   4   5   6   7   8   >