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: 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: 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: 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: 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: 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: 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: 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: Ugh! Python 3.1.x and MySQL

2010-09-10 Thread Rami Chowdhury
1.x? > Have you tried OurSQL (http://packages.python.org/oursql/)? > > Ideally, I'd like to be able to this from both x86 and x64 systems (if > that makes any difference). > > Thanks for any input you may have!!! > -- > http://mail.python.org/mailman/listinfo/python-list >

Re: Help needed - function apparently global cannot be called.

2010-09-07 Thread Rami Chowdhury
e to move a 4 line function into its own file and import it again > and again and again? > The short answer is yes. If you have this and similar functions that you call from various modules, then it's ideal to put them in a utility module of their own. However, as imported modules ar

Re: Newby Needs Help with Python code

2010-09-01 Thread Rami Chowdhury
now if the UpdateCursor object supports the iterator protocol, but the normal Python way of looping through all rows would be a for loop: for row in cur: # code For example, you are calling cur.Next() twice inside the loop -- is that what you want? Hope that helps, Rami > > > &g

Re: Problem checking an existing browser cookie

2010-08-30 Thread Rami Chowdhury
. Try inserting the following line at the top of your script: print "Content-type:text/html\r\n\r\n", os.environ.get('HTTP_COOKIE', 'NO COOKIE DATA') That should give you the value of the cookie, which might help you debug why it is not being loaded. -- 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: Reading the access attributes of directories in Windows

2010-08-28 Thread Rami Chowdhury
On Sat, Aug 28, 2010 at 05:07, Lawrence D'Oliveiro wrote: > In message , Rami > Chowdhury wrote: > >> On Wed, Aug 25, 2010 at 05:04, Lawrence D'Oliveiro >> wrote: >> >>> In message , Nobody wrote: >>> >>>> Having this as a separ

Re: Reading the access attributes of directories in Windows

2010-08-28 Thread Rami Chowdhury
On Fri, Aug 27, 2010 at 14:16, Nobody wrote: > On Fri, 27 Aug 2010 13:28:46 +0600, Rami Chowdhury wrote: > >>>> Having this as a separate permission allows normal users to add entries >>>> to log files but not to erase existing entries. >>> >>> Unix

Re: String substitution VS proper mysql escaping

2010-08-28 Thread Rami Chowdhury
t you mean? > > All those special format strign identifiers will grab their values out > of the tuple? Yes, that's exactly right -- they'll try to grab values out of the tuple, and since in that particular code snippet the tuple doesn't contain enough items, you'll get

Re: Reading the access attributes of directories in Windows

2010-08-27 Thread Rami Chowdhury
h, I didn't know that -- what combination of permissions would I have to use to get such an effect? -- 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: Looking for an appropriate encoding standard that supports all languages

2010-08-20 Thread Rami Chowdhury
s:\ > > Traceback (most recent call last): >  File "", line 1, in >  File "z.py", line 2 > SyntaxError: UTF-16 stream does not start with BOM Which encoding are you saving your script in? Very few of the text editors I've used save to UTF-16 by default. -- 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: A question to experienced Pythoneers

2010-08-20 Thread Rami Chowdhury
have you considered C / C++ GUI frameworks like GTK, WxWidgets, or Qt? Porting your GUI to those might be a better use of time than porting the software to Python... -- 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: OpenCV_Problem

2010-08-20 Thread Rami Chowdhury
nstallation went correctly, or if you've added the right paths. However, as I'm not an OpenCV expert, I don't know where to look next. If no one on the Python mailing list can help, you could also try the OpenCV mailing list: http://tech.groups.yahoo.com/group/OpenCV/ HTH, Rami -- 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: OpenCV_Problem

2010-08-15 Thread Rami Chowdhury
in', 'C:\\Python27\\lib\\lib-tk', > 'C:\\Python27 > ', 'C:\\Python27\\lib\\site-packages', > 'C:\\OpenCV2.0\\Python2.6\\Lib\\site-pack > ages'] Can you let us know if a file called '_cv.dll' is in 'C: \OpenCV2.0\Python2.6\Lib\site-

Re: OpenCV_Problem

2010-08-14 Thread Rami Chowdhury
On Sun, Aug 15, 2010 at 12:22, arihant nahata wrote: > Hi, >     I m new to python and openCV. I think you meant to send this to the list ;-) > i installed openCV and python and copied > the necessary folder. and even appended the sys.path. but then too the same > error. > > from opencv import

Re: convert time to UTC seconds since epoch

2010-07-20 Thread Rami Chowdhury
ciently recent version of Python, have you considered time.strptime: http://docs.python.org/library/time.html#time.strptime ? HTH, Rami ----- Rami Chowdhury "Never assume malice when stupidity will suffice." -- Hanlon's Razor 408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544

Re: Identify the Color of an Image

2010-07-16 Thread Rami Chowdhury
the web page in any browser. but I should be able > to capture the attributes of the image/Text displayed. Rami Chowdhury "Ninety percent of everything is crap." -- Sturgeon's Law +1-408-597-7068 / +44-7875-841-046 / +88-01819-245544 -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: Python 3 and MySQL???

2010-07-15 Thread Rami Chowdhury
hon 3? I believe OurSQL supports Python 3.x -- http://packages.python.org/oursql/ HTH, Rami ----- 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: Easy questions from a python beginner

2010-07-12 Thread Rami Chowdhury
On Jul 12, 2010, at 15:55 , Alf P. Steinbach /Usenet wrote: > * Rami Chowdhury, on 13.07.2010 00:14: >> Perhaps I'm misunderstanding, but ... >> >> On Jul 12, 2010, at 13:57 , Alf P. Steinbach /Usenet wrote: >>> >>> Existence of a variable means, amon

Re: Easy questions from a python beginner

2010-07-12 Thread Rami Chowdhury
erves local names and produces UnboundLocalErrors. The language semantics don't call for it, and another implementation might choose to handle function locals the same way as globals, through a namespace dictionary -- in which case the variable *wouldn't* exist in any way, shape, or form unti

Re: Web page special characters encoding

2010-07-10 Thread Rami Chowdhury
On Jul 10, 2010, at 09:24 , mattia wrote: > Hi all, I'm using py3k and the urllib package to download web pages. Can > you suggest me a package that can translate reserved characters in html > like "è", "ò", "é" in the corresponding correct > encoding? It won't do the whole job for you but you

Re: Argh! Name collision!

2010-07-07 Thread Rami Chowdhury
r "pynee", or > "pynie" ... considering those are not taken either? Pynie's taken too -- it's the Python implementation on the Parrot VM. Rami Chowdhury "As an online discussion grows longer, the probability of a comparison involving Nazis o

Re: delegation pattern via descriptor

2010-07-05 Thread Rami Chowdhury
; > > Yuck. > > what's so 'Yuck' about it? ;) > i guess i need a strong stmt: is descriptor a kind of delegation? or > is it not? Thanks for posting the code sample -- it makes your meaning a great deal clearer. No, descriptors are not delegation as in your sample**,

Re: Lua is faster than Fortran???

2010-07-04 Thread Rami Chowdhury
> soon. And LuaJIT 2 is rumoured to be much faster than the current... > > Looking at median runtimes, here is what I got: [snip] > The only comfort for CPython is that Ruby and Perl did even worse. Out of curiosity, does anyone know how the Unladen Swallow version of Python does

Re: Why are String Formatted Queries Considered So Magical?

2010-07-03 Thread Rami Chowdhury
” of which you speak? I looked here > <http://docs.python.org/library/>, but can find nothing that sounds like > that, that is relevant to HTML. > The Document Object Model - I don't think the standard library has an HTML DOM module but there's certainly one for XML (and XHTML)

Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-07-02 Thread Rami Chowdhury
On Friday 02 July 2010 19:20:26 Lawrence D'Oliveiro wrote: > In message , Rami > Chowdhury wrote: > > On Thursday 01 July 2010 16:50:59 Lawrence D'Oliveiro wrote: > >> Nevertheless, it it at least self-consistent. To return to my original > >> > >&

Re: [farther OT] Re: Why Is Escaping Data Considered So Magical?

2010-07-01 Thread Rami Chowdhury
27; [-pedantic] snprintf(Descr(buf), "%d + %d = %d\n", a, b, a + b); ^~ example.c:4:18: note: instantiated from: #define Descr(v) &v, sizeof v ^~~~ <

Re: Python dynamic attribute creation

2010-07-01 Thread Rami Chowdhury
the "less pure" solution wins. > > "Understandable" is hard to define, it differs so much from person to > person. "Perfect" is a strong sense for which I enjoy programming and > learn programming languages. > > Thanks much for your detailed answer

Re: pyc runtime error

2010-06-30 Thread Rami Chowdhury
On 2010-06-30 01:06, Baris CUHADAR wrote: > Can anyone explain this unexpected behavior? I'm sorry -- can you let us know what behavior you're expecting? > all files chmod 755, i've compiled x.py with py_compilefiles, > also tried within python console with "import x" > > system: centos 5.4 32b

Re: Python profiler usage with objects

2010-06-30 Thread Rami Chowdhury
On 2010-06-30 06:39, rik wrote: > Ben Kaplan case.edu> writes: > > > > > Let's take this code as an example: > > > > def foo() : > > return None > > > > import profile > > profile.run(foo()) > > > > What does the profile.run call do? > > > > First thin it does is evaluate foo(), which r

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

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

  1   2   >