Re: [PSF-Community] Unable to login | fbchat.Client

2020-07-06 Thread rami . chowdhury
Hi Shivam, Please be aware this mailing list is for PSF community-focused discussions -- see the list's purpose described at https://mail.python.org/mailman/listinfo/psf-community. I might suggest you participate in the discussion on on the `fbchat` project repository on GitHub -- the issue

Re: nesting context managers

2011-12-20 Thread Rami Chowdhury
and reorganize your code so that you can use the @contextmanager decorator, for instance? That having been said, it doesn't seem that difficult to me to code your own simple __exit__ method if you're already coding up __enter__ ? HTH, Rami -- Rami Chowdhury "Never assume malice w

Re: nesting context managers

2011-12-20 Thread Rami Chowdhury
n > implicitly assuming a specific implementation? I'm no expert but I believe the basic garbage collection behavior is part of the language, and it's only details of breaking cycles that are specific to CPython -- can anyone correct me if I'm wrong? -- Rami Chowdhury "Ne

Re: Spanish Accents

2011-12-22 Thread Rami Chowdhury
position > 20: truncated data > args = ('utf16', '\r\n', 20, 21, 'truncated > data') > encoding = 'utf16' > end = 21 > object = '\r\n' > reason = 'truncated data' > start = 20 > > Tried it with utf-16 with same results. > > TIA, > > Stan > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor +44-7581-430-517 / +1-408-597-7068 / +88-0189-245544 -- http://mail.python.org/mailman/listinfo/python-list

Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error

2011-12-22 Thread Rami Chowdhury
can you please post the complete traceback so we can all see it? -- Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor +44-7581-430-517 / +1-408-597-7068 / +88-0189-245544 -- http://mail.python.org/mailman/listinfo/python-list

Re: Errors installing mod_python with apache

2011-12-27 Thread Rami Chowdhury
_python.c:54: > > and a lot more.  Can anyone help? Is there a reason you're not using the system package manager? Does "yum install mod_python" not find anything? How about "yum provides */mod_python.so"? -- Rami Chowdhury "A mind all logic is like a knife all blade - it makes the hand bleed that uses it." -- Rabindranath Tagore +44-7581-430-517 / +1-408-597-7068 / +88-0189-245544 -- http://mail.python.org/mailman/listinfo/python-list

Re: Spamming PyPI with stupid packages

2012-01-04 Thread Rami Chowdhury
lready been > retracted by its author. I'm making a fuss about allowing and, worse, > defending such jokes as a tacitly-accepted norm of our community. And I > hope those of us who prefer to think of ourselves as not-sexist will act > to clean up our house more. A hearty +1 t

Re: Can't Encode Pic

2009-11-27 Thread Rami Chowdhury
On Fri, Nov 27, 2009 at 02:59, Victor Subervi wrote: > On Thu, Nov 26, 2009 at 5:08 PM, Dennis Lee Bieber > wrote: >> Nothing hinting at having >> opened an interactive Python console and typing statements into it as an >> experiment to see what may work, or what changes may break something. > >

Re: Variables with cross-module usage

2009-11-28 Thread Rami Chowdhury
Hi Nitin, On Sat, Nov 28, 2009 at 14:36, MRAB wrote: > Nitin Changlani. wrote: >> three.py >> >> import one >> import two >> >> def argFunc(): >>    one.x = 'place_no_x' >>    one.a = 'place_no_a' >>    one.b = 'place_no_b' >> I think this is what is biting you. You might expect tha

Re: Variables with cross-module usage

2009-11-28 Thread Rami Chowdhury
Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) On Sat, Nov 28, 2009 at 14:57, Matt Nordhoff wrote: > Rami Chowdhury wrote: >> Hi Nitin, >> >> On Sat

Re: Completely OT

2009-11-30 Thread Rami Chowdhury
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 select the various colors he wants to add to a list > that would populate itself on the same page where the selections are, and > then

Re: New to python

2009-11-30 Thread Rami Chowdhury
On Mon, Nov 30, 2009 at 08:20, Ronn Ross wrote: > I have recently come across something called a struct. I have googled this, > but have note found a good explanation. Can someone give me a good > definition or point me to a page that has one. > Where did you come across a "struct"? Depending on

Re: High-performance Python websites

2009-12-01 Thread Rami Chowdhury
e is loaded a new instance of php is loaded to run the > page, AFAIK that's only the case for PHP-CGI, and Python as a CGI scripting language is used the same way. Apache is very often run with mod_php, though, which embeds the PHP interpreter; mod_python does something similar fo

Re: memory error

2009-12-03 Thread Rami Chowdhury
27;re closing the program? I don't know anything about Pythonwin, so I won't comment further, but IME Python scripts rarely get direct memory access errors so I would suspect a problem in Pythonwin. Rami Chowdhury -BEGIN GEEK CODE BLOCK- Version: 3.1 GO d-(+++) s-:++ a-- C++

Re: Are routine objects guaranteed mutable & with dictionary?

2009-12-04 Thread Rami Chowdhury
o calling them 'routines' is likely to confuse anyone in a discussion of Python features. Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: read from standard input

2009-12-05 Thread Rami Chowdhury
n.read() from inside IDLE on Linux, and it gives me the same error. Rami Chowdhury "Any sufficiently advanced incompetence is indistinguishable from malice." -- Grey's Law 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

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

2009-12-07 Thread Rami Chowdhury
> English, which further confuses the issue. Yes, I would like to understand > this code. Coming from PHP, I can see why you might be confused. Python is not PHP -- Python has namespaces and uses them, unlike PHP which IIRC shoves nearly everything into the default namespace. So you n

Re: When will Python 3 be fully deployed

2009-12-09 Thread Rami Chowdhury
ASCII-compatibility be damned). > > But on Unix, it's a square-peg-round-hole situation. I dunno, I find it rather useful not to have to faff about with encoding to/from when working with non-ASCII files (with non-ASCII filenames) on Linux. Rami Chowdhury "Never assume ma

Re: When will Python 3 be fully deployed

2009-12-09 Thread Rami Chowdhury
On Wed, Dec 9, 2009 at 11:25, Nobody wrote: > On Wed, 09 Dec 2009 10:28:40 -0800, Rami Chowdhury wrote: > >>> But on Unix, it's a square-peg-round-hole situation. >> >> I dunno, I find it rather useful not to have to faff about with >> encoding to/from when

Re: expat having problems with entities (&)

2009-12-11 Thread Rami Chowdhury
n 2.5+) I'd use ElementTree... -- Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: md5 strange error

2009-12-14 Thread Rami Chowdhury
ecated, and you should use the hashlib module instead. I believe md5 is deprecated from Python 2.6 onwards, which may be why you have not seen this message before (Fedora 12 is the first Fedora to ship with Python 2.6). Rami Chowdhury "Never assume malice when stupidity will suffice.&

Re: pyZui - anyone know about this?

2009-12-14 Thread Rami Chowdhury
and pretty good Python bindings, but I know very little about them other than that they exist. Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling Cookie Values

2009-12-15 Thread Rami Chowdhury
nt cookie['lastvisit']['expires'].value What does cookie contain, at this point, in the else branch? Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Apple Mac OS X 10.6 support & compatability with Python 3 ?

2009-12-16 Thread Rami Chowdhury
ke OSes. I believe OS X is sufficiently Unix-like that curses will do the job. -- Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: How Do I...?

2009-12-18 Thread Rami Chowdhury
a is that through every iteration of option, I can create a new > variable such as 'optionNo0', 'optionNo1' etc and assign values such as '0', > '1' etc to them. What are you expecting to do with those variables and values later? -- Rami Chowdhury &q

Re: How Do I...?

2009-12-19 Thread Rami Chowdhury
On Dec 19, 2009, at 08:50 , Victor Subervi wrote: > 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 all lik

Re: numpy performance and random numbers

2009-12-20 Thread Rami Chowdhury
treams of random numbers. What was "unsolved" was the "pseudo-" part of >> the random number generation, which guarantee perfect replayability in >> all conditions. > > Why not use a good cipher, such as AES, to generate a pseudorandom > bit stream by encry

Re: How to pass a global variable to a module?

2009-09-29 Thread Rami Chowdhury
dvise that you think about whether your variable needs to be global, or whether you could (or should) simply pass the variable to the function as a parameter. HTH, Rami -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Raz

Re: Partial directory search question

2009-09-30 Thread Rami Chowdhury
Rami Chowdhury "Never attributed to malice that which can be attributed to stupidity." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) On Tuesday 29 September 2009 19:54:17 chad wrote: > On Sep 29, 7:52 pm, chad wrote: > > On Sep 29, 7

Re: unicode issue

2009-10-01 Thread Rami Chowdhury
.decode("ascii") Servus, Walter As I understand it, the "ignore" argument to str.encode *removes* the undecodable characters, rather than replacing them with an ASCII approximation. Is that correct? If so, wouldn't that rather defeat the purpose? -- Rami

Re: unicode issue

2009-10-01 Thread Rami Chowdhury
be possible to replace .encode("ascii", "ignore").decode("ascii") with something like this: u"".join(c for c in name if unicodedata.category(c) == "Mn") Servus, Walter Thank you for the clarification! -- Rami Chowdhury "Ne

Re: accessing dictionary keys

2009-10-01 Thread Rami Chowdhury
http://code.activestate.com/recipes/500261/)? HTH, Rami -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple Select

2009-10-02 Thread Rami Chowdhury
s in the script to which it posts. Only one of them gets associated with the variable in the . What do? TIA Victor How are you retrieving the values in the CGI script? -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-

Re: organizing your scripts, with plenty of re-use

2009-10-05 Thread Rami Chowdhury
t again because it was too complicated. I could fix the error message to tell them exactly what to do, but at that point I might as well re-write the above boilerplate code. I'm overstating my case here for emphasis, but it's essentially true. --Buck -- Rami Chowdhury "Never attribu

Re: Problem Displaying Pics

2009-10-06 Thread Rami Chowdhury
;pic4',5:'pic5',6:'pic6'} pic = pics[x] print 'Content-Type: text/html' ^^^ I believe this is the problem line. It's telling the browser to expect HTML, not an image. Remove this, and the later Content-Type header that's being printed ("Con

Re: Problem Displaying Pics

2009-10-06 Thread Rami Chowdhury
as changed? Have you upgraded the version of Python on the server? Have you changed the webserver serving your scripts? Have you changed the back-end database at all? -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-59

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
arbage" that should translate into an image (you can look: http://13gems.com/stxresort/cart/getpic1.py?id=1&x=1 ). Any more ideas would be helpful. Going to that URL, my browser now tries to render an HTML page, and I can now see the 'Content-Type: image/jpeg' stri

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
d the image or any alt text for it, so it's just using the image URL. Are you certain the image data (i.e. the 'content' string) is correct, and being encoded correctly in the output? On Tue, Oct 6, 2009 at 3:40 PM, Rami Chowdhury wrote: On Tue, 06 Oct 2009 13:26:19 -

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
rint content.encode('base64') HTH, Rami On Wed, Oct 7, 2009 at 10:03 AM, Rami Chowdhury wrote: On Wed, 07 Oct 2009 06:37:08 -0700, Victor Subervi < victorsube...@gmail.com> wrote: I took out the line in question (with text/html). Now it prints to screen the url. It did

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
nvalid syntax Ideas? TIA, V I'm sorry, I don't understand how the code is being auto-generated? Is there no way to place the 'Content-Encoding' header inside the triple-quoted string, where it should go? -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
th Content-Type, before the newlines. So print '''Content-Type: image/jpeg Content-Encoding: base64 ''' HTH, Rami On Wed, Oct 7, 2009 at 12:56 PM, Rami Chowdhury wrote: On Wed, 07 Oct 2009 10:50:00 -0700, Victor Subervi < victorsube...@gmail.com> wrote:

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
t '''Content-Type: image/jpeg > > ''' > print > print content On Wed, Oct 7, 2009 at 9:51 AM, Gabriel Genellina wrote: > That's still wrong. The output should be: > > - a line containing Content-Type: image/jpeg > - a blank line (no more!)

Re: Problem Displaying Pics

2009-10-07 Thread Rami Chowdhury
ld be able to use Python to decode that, and then use any image viewer to verify that the JPEG is sound. Can you remind us of the URL where that code (with the text/plain content type) is running? On Wed, Oct 7, 2009 at 3:52 PM, Rami Chowdhury wrote: On Wed, 07 Oct 2009 13:24:28 -0700, Vict

Re: It Doesn't Add Up!

2009-10-12 Thread Rami Chowdhury
On Mon, 12 Oct 2009 11:33:31 -0700, Victor Subervi wrote: Hi; I have the following code: for row in data: i += 1 total = 0 [snip] As you can see, the total doesn't accumulate! There are two rows. The second "Total 1:" should show "1.98", not 0! What gives? You are sett

Re: What is Islam?-1

2009-10-13 Thread Rami Chowdhury
On Oct 13, 2009, at 17:51 , J wrote: On Tue, Oct 13, 2009 at 20:05, Aahz wrote: There's no point in trying to reason with a Muslim. That's not funny, and if you were being serious, that was incredibly rude. Not as much as posting in comp.lang.python. What exactly are you claiming is r

Re: What is Islam?-1

2009-10-13 Thread Rami Chowdhury
On Oct 13, 2009, at 19:15 , Mensanator wrote: On Oct 13, 8:47�pm, Rami Chowdhury wrote: On Oct 13, 2009, at 17:51 , J wrote: On Tue, Oct 13, 2009 at 20:05, Aahz wrote: There's no point in trying to reason with a Muslim. That's not funny, and if you were being serious

Re: set using alternative hash function?

2009-10-15 Thread Rami Chowdhury
for internal storage, and use that? You'd still have uniqueness (by dict key, which your class would define as object name) and as a bonus, retrievability by name, which set wouldn't give you. -- Rami Chowdhury "Never attribute to malice that which can be attributed to stup

Re: The Never-Ending Saga Continues

2009-10-19 Thread Rami Chowdhury
ng to achieve with it? -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: The Never-Ending Saga Continues

2009-10-19 Thread Rami Chowdhury
care of adding data to the database or filesystem as appropriate -- no need for FTP. 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 upload data into MySQL *and

Re: The Never-Ending Saga Continues

2009-10-19 Thread Rami Chowdhury
when (which can be a bit frustrating). 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). 2) I want to

Re: Dll in python

2009-10-23 Thread Rami Chowdhury
On Fri, 23 Oct 2009 14:08:58 -0700, Aahz wrote: In article , snonca wrote: [...] Was I the only person who read the Subject: line and thought, "How do you roll D11, anyway?" Surely it's just like a slightly unbalanced D12? -- Rami Chowdhury "Never attribute to m

Re: Web development with Python 3.1

2009-10-28 Thread Rami Chowdhury
f "middle.php" in the following PHP example: Is that what you are after? -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Web development with Python 3.1

2009-10-28 Thread Rami Chowdhury
l of the web, where URLs represent files on a server. (In the case of PHP, Python Server Pages, or CGI scripts, these are augmented files which are executed by the server, but it's the same concept). Instead, they typically map URLs to arbitrary code. -- Rami Chowdhury "Never attrib

Re: datetime question

2009-10-30 Thread Rami Chowdhury
er of days in the current month using the calendar module ;-) -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Freezing python files into executables

2009-11-03 Thread Rami Chowdhury
/lib/python2.4/config not found I don't know anything about freeze.py but on 64-bit Red Hat distros (RHEL, Fedora, etc) it should be /usr/lib64/python2.4/config :-) -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Raz

Re: self.__dict__ tricks

2009-11-03 Thread Rami Chowdhury
y stupid. ;-) Are there any fish in the Dead Sea? Depends on how you define fish, surely ;-)? -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Freezing python files into executables

2009-11-03 Thread Rami Chowdhury
or-Loeh-Str.48    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg           Registered at Amtsgericht Duesseldorf: HRB 46611               http://www.egenix.com/company/contact/ -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" --

Re: Serious Privileges Problem: Please Help

2009-11-07 Thread Rami Chowdhury
r: http://angrynates.com/global_solutions/ > [Fri Nov 06 13:52:52 2009] [error] [client 208.84.198.58] File does not > exist: /var/www/html/angrynates.com/favicon.ico > [Fri Nov 06 13:52:53 2009] [error] [client 208.84.198.58] File does not > exist: /var/www/html/angrynates.com/favicon.i

Re: Serious Privileges Problem: Please Help

2009-11-07 Thread Rami Chowdhury
nt something like 'unconfined_u:object_r:httpd_sys_content_t' for Apache content). > > 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

Re: Serious Privileges Problem: Please Help

2009-11-08 Thread Rami Chowdhury
I'm not certain -- have you tried confirming through programs such as system- config-securitylevel that it's off? > Furthermore, > [r...@13gems global_solutions]# ps wax|grep selinux > 17645 pts/0S+ 0:00 grep selinux SELinux is a kernel subsystem -- it won't show up

Re: Serious Privileges Problem: Please Help

2009-11-08 Thread Rami Chowdhury
tail /var/log/httpd/error_log HTH, Rami Rami Chowdhury "As an online discussion grows longer, the probability of a comparison involving Nazis or Hitler approaches one." -- Godwin's Law 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Rami Chowdhury
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: > [r...@13gems angrynates.com]# chcon -u unconfined_u -r object_r -t > httpd_sys_content_t global_solutions > chcon: can't apply

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Rami Chowdhury
eplies *below* the text you are replying to. Putting your replies above the last email, or "top-posting" makes reading long email threads with lots of text distracting and frustrating. -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity

Re: Serious Privileges Problem: Please Help

2009-11-09 Thread Rami Chowdhury
On Mon, 09 Nov 2009 11:24:33 -0800, Victor Subervi wrote: 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 h

Re: Create object from variable indirect reference?

2009-11-10 Thread Rami Chowdhury
So getattr(ephem, "Moon") should give you the class object ephem.Moon, which you can then instantiate... -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't Write File

2009-11-10 Thread Rami Chowdhury
On Tue, 10 Nov 2009 12:57:30 -0800, Victor Subervi wrote: 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

Re: Can't Write File

2009-11-10 Thread Rami Chowdhury
1 start.py What am I doing wrong? TIA, Victor ...and where's the file denoted by getpic? -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't Write File

2009-11-11 Thread Rami Chowdhury
t: clause *may* be acceptable in production code, where you may *want* to silently ignore all errors, but if you're trying to debug something then it's really not helpful. -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon&

Re: Can't Write File

2009-11-11 Thread Rami Chowdhury
On Wed, 11 Nov 2009 08:42:27 -0800, Victor Subervi wrote: 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:

Re: Can't Write File

2009-11-11 Thread Rami Chowdhury
ting is being properly sent as a JPEG, but it *doesn't contain valid JPEG data*, so the browser can't render it. What the URL you pointed me at seems to contain is the 'readable' representation of an array object. -- Rami Chowdhury "Never attribute to malice that wh

Re: python simply not scaleable enough for google?

2009-11-12 Thread Rami Chowdhury
see why you're conflating interpreted and dynamic here? Javascript is unarguably a dynamic language, yet Chrome / Safari 4 / Firefox 3.5 all typically JIT it. Does that make Javascript non-dynamic, because it's compiled? What about Common Lisp, which is a compiled language when i

Re: python simply not scaleable enough for google?

2009-11-12 Thread Rami Chowdhury
On Thu, 12 Nov 2009 11:24:18 -0800, Alf P. Steinbach wrote: * Rami Chowdhury: On Thu, 12 Nov 2009 09:32:28 -0800, Alf P. Steinbach wrote: This also seems religious. It's like in Norway it became illegal to market lemon soda, since umpteen years ago it's soda with lemon

Re: python simply not scaleable enough for google?

2009-11-12 Thread Rami Chowdhury
be nonsense, wasn't it? Which IMO is fair -- a physicist friend of mine works with a C++ interpreter which is relatively sluggish, but that doesn't mean C++ is slow... -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon&#

Re: python simply not scaleable enough for google?

2009-11-12 Thread Rami Chowdhury
On Thu, 12 Nov 2009 12:44:00 -0800, Benjamin Kaplan wrote: Some one could even write an interpreter for C++ if they wanted to. Someone has (http://root.cern.ch/drupal/content/cint)! -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanl

Re: wsgi with separate css file

2009-11-13 Thread Rami Chowdhury
e simple_server from the wsgiref module? Where are the application and CSS files being stored and run? Cheers Rami -- Rami Chowdhury "Never attribute to malice that which can be attributed to stupidity" -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD

Re: wsgi with separate css file

2009-11-13 Thread Rami Chowdhury
return response_lines else: start_response('404 Not Found', []) return [] However, this method is fragile and very inefficient. If you want to eventually deploy this application somewhere, I would suggest starting with a different metho

Re: python simply not scaleable enough for google?

2009-11-14 Thread Rami Chowdhury
ister-based VM, there's Pynie (http://code.google.com/p/pynie/)... and there's even a JIT in the works for that (http://docs.parrot.org/parrot/1.0.0/html/docs/jit.pod.html)... Rami Chowdhury "A man with a watch knows what time it is. A man with two watches is never sure". --

Re: Changing the current directory (full post)

2009-11-16 Thread Rami Chowdhury
t; directory. This is what my problem is!!! 1. File -> Open 2. Navigate to file and choose it 3. Press F5 Cheers, Chris --http://blog.rebertia.com Say that you wanted to import a file in the test directory after just entering IDLE. How would you do it? http://docs.python.org/library/os.html#os.

Re: non-copy slices

2009-11-18 Thread Rami Chowdhury
lt;__main__.dummy object at 0x00A7E650>] > > > > In [9]: list2 = list1[1:3] > > In [10]: list2 > > Out[10]: > > [<__main__.dummy object at 0x013F1A50>, > > <__main__.dummy object at 0x00A854F0>] > > > > In [11]: list2[0] is list1[1] > >

Re: non-copy slices

2009-11-19 Thread Rami Chowdhury
3:00 AM, Rami Chowdhury wrote: I'm not sure you're understanding the point others have been making. A list item is merely another reference to an existing object -- it doesn't copy the object in any way. -- Rami Chowdhury "Never attribute to malice that which can b

Re: get line number and filename in a source file

2009-11-24 Thread Rami Chowdhury
On Nov 24, 2009, at 21:47 , Peng Yu wrote: > __LINE__ __FILE__ in C++ can give the current line number and > filename. Is there a similar thing in python that can give me the > current line number and filename? > Is there a similar thing to __PRETTY_FUNCTION__ (also from C++)? What do you want to

Re: Workaround To Add Value To TextArea

2009-11-25 Thread Rami Chowdhury
Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD) On Wed, Nov 25, 2009 at 07:19, Victor Subervi wrote: > Hi; > I've noticed that html doesn't support a "val

Re: Pure virtual functions in Python?

2010-02-20 Thread Rami Chowdhury
he dispatcher() not to call 'cb' > > if it was not implemented in one of the child classes. > > > > Please advise. > > There is nothing more beyond that what you already did. You can raise a > NotImplementedError for classes that don't implement the method. That's it. >

Re: importing libraries not working 2.6.4

2010-02-26 Thread Rami Chowdhury
n26\\lib\ > \site-packages'] > > >>> import cv > > Traceback (most recent call last): > File "", line 1, in > import cv > ImportError: DLL load failed: The specified module could not be found. > > > Any help would be greatly

Re: importing libraries not working 2.6.4

2010-02-26 Thread Rami Chowdhury
environment variables to try and import maya.standalone but > no dice on that either. > Sorry, you've still not told me where you expect it to be. Could you let us know what .py files you can see in C:\OpenCV2.0\Python2.6\Lib ? > > On Fri, Feb 26, 2010 at 4:30 PM, Rami Chowdhury wrot

Re: importing libraries not working 2.6.4

2010-02-26 Thread Rami Chowdhury
') and then doing: from opencv import cv ? > Did I still need to compile this even though it was a win 32 installer? I don't think so, no -- AFAIK the .pyd files are compiled CPython extension modules, so it looks like they're all compiled for you. - Rami Chow

Re: importing libraries not working 2.6.4

2010-02-27 Thread Rami Chowdhury
"C:\Python26\lib\site-packages\opencv\cv.py", line 25, in > > > > _cv = swig_import_helper() > > > > File "C:\Python26\lib\site-packages\opencv\cv.py", line 21, in > > > > swig_import_helper > > > > _mod = imp.load

Re: [newbie] - python list into a sql query

2010-03-01 Thread Rami Chowdhury
7;w+') % builder_path > data = cursor.fetchall() > > for row in data: > ip = row[0] > host = row[1] > dns = row[2] > if host == dns: > #tmn > if ip[0][:10] in ('140.254.30','10.13.74.') > group1_file =

Re: Problem with modules reloading

2010-03-04 Thread Rami Chowdhury
On Mar 4, 2010, at 18:10 , DSblizzard wrote: > I have had already following question: > "How to use *.py modules instead of *.pyc?" > > Last time I when asked that question I resolved problem by using one > big .py file. And answers doesn't work in my case. Now I ought to use > several files and

Re: Down casting Python objects

2010-03-09 Thread Rami Chowdhury
`x.__class__ = Bar' and expect > things to work OK in all major versions of CPython? Could you tell us *why* you need to down-cast x? Explicit type-casting is usually unnecessary in Python... - Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlo

Re: to pass self or not to pass self

2010-03-15 Thread Rami Chowdhury
n that a bit, note that in test2() you are doing: > > f = self.f1 > > f(6) > > > > f = self.F > > # why passing self is not needed? > > f(87) As I understand it, since you obtained the reference to 'f1&#x

Re: google token

2010-03-22 Thread Rami Chowdhury
here: http://pyrfeed.googlecode.com/svn/trunk/lib/web/web.py > > > thanks, > > Thufir Rami Chowdhury "Any sufficiently advanced incompetence is indistinguishable from malice." -- Grey's Law 408-597-7068 (US) / 07875-841-046 (UK) / 01819-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode blues in Python3

2010-03-23 Thread Rami Chowdhury
recent call last): > File "./nntst4.py", line 6, in > print(mychar) > File "Python-3.1.2/Lib/codecs.py", line 356, in write > self.stream.write(data) > TypeError: must be str, not bytes > > ..OK, this is not working either. > > Is there any way to write a value 253 to standard output? Rami Chowdhury "Ninety percent of everything is crap." -- Sturgeon's Law 408-597-7068 (US) / 07875-841-046 (UK) / 01819-245544 (BD) -- http://mail.python.org/mailman/listinfo/python-list

Re: the Python Foundation

2010-03-25 Thread Rami Chowdhury
On 2010-03-24 16:22, Paul Rubin wrote: > "Steve Holden, Chairman, PSF" writes: > > We have also registered the trademark "Python" for use in reference to > > computer programming languages, thereby ensuring that we can take action > > should some ill-advised individual or organization decide to pr

Re: sorting ascending/descending with operator.attrgetter

2010-03-31 Thread Rami Chowdhury
On Wednesday 31 March 2010 22:50:02 Steve Holden wrote: > "When I say 'use soap' "*use* soap"? Sounds awfully Perlish to me, perhaps you meant "import soap" ;-)? Rami Chowdhury "Ninety percent of everything is crap." -- Sturgeon's Law

Re: Interning own classes like strings for speed and size?

2010-12-28 Thread Rami Chowdhury
;_cache' is read-only Forgive me if I'm misunderstanding, but if you want to cache instances of a class, surely >> Example2()._cache = {} would defeat the purpose, at least for that instance of Example2? The slot seems writeable enough, after all >> Example2()._cache[&#

Re: MySQLDB - server has gone on blob insertion...

2010-06-02 Thread Rami Chowdhury
do this on a HostGator account? > HostGator servers run a program which kills long MySQL transactions > by executing MySQL "KILL" transactions. > This is reported to the user as 'MySQL server has gone away' I don't think HostGator is alone in this -- AFAIK seve

Re: N00b question: matching stuff with variables.

2010-06-28 Thread Rami Chowdhury
seek = sanitize(form["serial"].value) for line in file: match = re.search(seek, line) # re.search(pattern, string, flags) if match is not None: print "%s matches" % line One thing that certainly confused me when I learned Python (coming from, among

Re: C++/Python function call

2010-06-28 Thread Rami Chowdhury
give us a little more information? What do you need to use it for? > > > Cheers > > > Zoh > _ > http://clk.atdmt.com/UKM/go/19780/direct/01/ > Do you have a story that started on Hotmail? Tell us now Rami Ch

Re: C++/Python function call

2010-06-29 Thread Rami Chowdhury
-> bool""" > > > > > > > > > > > > it was generated to do the same function as the c++: > > > > > > set_time_at_next_pps(usrp2::time_spec_t(0, 0)) > > > > > > > > > I am new to python and

  1   2   >