Re: passing command line arguments to executable

2010-04-04 Thread Joshua
On 4/3/10 12:09 PM, mcanjo wrote: I have an executable (I don't have access to the source code) that processes some data. I double click on the icon and a Command prompt window pops up. The program asks me for the input file, I hit enter, and then it asks me for and output filename, I hit enter a

Re: New Tkinter windows don't get focus on OS X

2009-09-14 Thread Joshua Bronson
On Sep 11, 3:53 am, eb303 wrote: > For the OP: the problem comes from the tcl/tk level. Running a tcl > script just opening a window from the terminal shows the same > behaviour. You might want to forward the question to the tcl guys. Done: https://sourceforge.net/mailarchive/forum.php?thread_nam

Re: sftp login without password

2009-10-06 Thread Joshua Kugler
David wrote: > transport.connect(username = username, pkey = mykey) > > I get a "AuthenticationException: Authentication failed." exception. > > > My ~/.ssh/id_rsa is correct because if, at console, I type > > bags...@bagvapp:~$ sftp bags...@192.168.92.129 > Connecting to 192.168.92.129... > sf

Re: Is pythonic version of scanf() or sscanf() planned?

2009-10-09 Thread Joshua Kugler
ryniek90 wrote: > So maybe someone, someday decide to > put in Python an alternative, really great implementation of scanf() ? My idea of a "great scanf() function" would be a clever combination of re.match(), int(), and float(). j -- http://mail.python.org/mailman/listinfo/python-list

Re: What IDE has good git and python support?

2009-10-27 Thread Joshua Kugler
Aweks wrote: > what do you use? WingIDE has excellent Python support (it's a Python IDE, after all), and the latest version has full support for git. j -- http://mail.python.org/mailman/listinfo/python-list

python bijection

2009-11-20 Thread Joshua Bronson
I couldn't find a library providing a bijective map data structure (allowing for constant-time lookups by value) in the few minutes I looked, so I took a few more minutes to code one up: http://bitbucket.org/jab/toys/src/tip/bijection.py Is this at all worth releasing? Comments and suggestions wel

Re: python bijection

2009-11-20 Thread Joshua Bronson
On Nov 19, 7:05 pm, Steven D'Aprano wrote: > If I want a mapping a <-> b, I generally just create a dict {a:b, b:a}. > What is the advantages or disadvantages of your code over the simplicity > of the dict approach? Well for one, you don't have to manually update the mapping from b -> a if ever t

Re: python bijection

2009-11-20 Thread Joshua Bronson
On Nov 19, 9:17 pm, Carl Banks wrote: > Apart from the GPL what Ben said :) > it seems perfectly fine to release, and looks like > an interesting strategy. I've wanted one of those once in a while, > never enough to bother looking for one or writing one myself. glad to hear it! i'll release it

Re: python bijection

2009-11-20 Thread Joshua Bronson
On Nov 20, 3:09 pm, Terry Reedy wrote: > Joshua Bronson wrote: > > Anyone have any other feedback? For instance, is offering the __call__ > > syntax for the inverse mapping wonderful or terrible, or maybe both? > > Terrible ;-) > > Use standard subscripting with slices,

Re: python bijection

2009-11-20 Thread Joshua Bronson
On Nov 20, 3:09 pm, Terry Reedy wrote: > Use standard subscripting with slices, and only that, to both get and set. i did this for __delitem__ too, so you can do e.g. del m[:'abc']. > In fact, to emphasize the symmetry of the bijective map, consider > disallowing m[key] as ambiguous and require

Re: IDE+hg

2009-11-23 Thread Joshua Kugler
NiklasRTZ wrote: > If you > know > a good light IDE with hg, please inform. Topic handled earlier, still > undecided > http://groups.google.com/group/google-appengine-python/browse_thread/... > Thanks in advance > Niklas Rosencrantz WingIDE support Hg, as well as svn, git, and many others. j --

Re: python bijection

2009-11-24 Thread Joshua Bronson
Hey Raymond, Thanks for your thoughtful reply! I think your idea for a class- generation approach in the spirit of namedtuple is brilliant; looking forward to coding this up and seeing how it feels to use it. (By the way, it occurred to me that "bijection" is perhaps the wrong term to use for thi

Re: python bijection

2009-11-24 Thread Joshua Bronson
On Nov 24, 6:49 pm, Gregory Ewing wrote: > Joshua Bronson wrote: > > So I'm > > thinking of renaming the class injectivedict or idict instead of > > bijection. Is that crazy?) > > I think you'd be better off calling it something more > down-to-earth

Re: python bijection

2009-11-26 Thread Joshua Bronson
On Nov 24, 10:28 pm, Joshua Bronson wrote: > bidict it is! now available at http://bitbucket.org/jab/toys/src/tip/bidict.py and now featuring new shiny namedbidict goodness! as always, feedback welcome. josh -- http://mail.python.org/mailman/listinfo/python-list

Re: python bijection

2009-11-28 Thread Joshua Bronson
On Nov 27, 9:36 pm, "Gabriel Genellina" wrote: > En Fri, 27 Nov 2009 15:12:36 -0300, Francis Carr   > escribió: > > > I was really inspired by this discussion thread! :-) > > > After much tinkering, I think I have a simpler solution.  Just make > > the inverse mapping accessible via an attribute,

Re: python bijection

2009-12-01 Thread Joshua Bronson
On Nov 27, 1:12 pm, Francis Carr wrote: > I was really inspired by this discussion thread! :-) > > After much tinkering, I think I have a simpler solution.  Just make > the inverse mapping accessible via an attribute, -AND- bind the > inverse of -THAT- mapping back to the original.  The result is

Re: python bijection

2009-12-01 Thread Joshua Bronson
On Dec 1, 2:11 pm, Raymond Hettinger wrote: > [Joshua Bronson] > > > Raymond, do you think there might be any future in including a built- > > in bidict data structure in Python? > > I don't think so.  There are several forces working against it: > > * the recip

Re: python bijection

2009-12-02 Thread Joshua Bronson
On Dec 1, 8:17 pm, a...@pythoncraft.com (Aahz) wrote: > In article > <85100df7-a8b0-47e9-a854-ba8a8a2f3...@r31g2000vbi.googlegroups.com>, > Joshua Bronson   wrote: > >I noticed the phonebook example in your ActiveState recipe and thought > >you might consider ch

Re: python bijection

2009-12-02 Thread Joshua Bronson
On Dec 1, 9:03 pm, Chris Rebert wrote: > Reminds me of this quite funny blog post: > "Gay marriage: the database engineering perspective" > http://qntm.org/?gay amazing -- http://mail.python.org/mailman/listinfo/python-list

ANNOUNCE: awstats_reader 0.5

2009-12-19 Thread Joshua Kugler
script for merging AWStats Cache files. Download: http://azariah.com/open_source.html ABOUT THE AUTHOR Joshua Kugler (jos...@azariah.com) is a programmer and system administator with over 10 years of industory experience. He is currently looking for a job. Happen to have one you

from datetime.datetime import today not working. python2.6.4 on windows

2010-01-06 Thread Joshua Kordani
Greetings all! So I'm reading through the manual and I get to the point where it talks about packages and how to import them. namely section 6.4 in the tutorial. I wont repeat the section here, but I want to understand whats going on in the following (as typed on my computer). Python 2.6.4

Re: from datetime.datetime import today not working. python2.6.4 on windows

2010-01-06 Thread Joshua Kordani
Gary Herron wrote: Joshua Kordani wrote: Greetings all! So I'm reading through the manual and I get to the point where it talks about packages and how to import them. namely section 6.4 in the tutorial. I wont repeat the section here, but I want to understand whats going on i

heapq._siftdown / decrease-key support?

2010-01-13 Thread Joshua Bronson
I recently implemented A* search in Python using the heapq module and in my first pass, to accomplish the decrease-key operation I resorted to doing a linear scan of the list to find the position of the key in the heap, and then calling the private undocumented method heapq._siftdown at this positi

Re: heapq._siftdown / decrease-key support?

2010-01-14 Thread Joshua Bronson
Thanks for the responses! On Thu, Jan 14, 2010 at 12:23 AM, Daniel Stutzbach wrote: > Your guess is correct. Someday I'd like to rewrite HeapDict in C for speed, > but I haven't been able to find the time (and no one has offered to pay me to > make the time ;) ). Daniel, did you realize you c

Re: heapq._siftdown / decrease-key support?

2010-01-18 Thread Joshua Bronson
On Sun, Jan 17, 2010 at 11:30 PM, Raymond Hettinger wrote: > > > Raymond, do you think this technique is worth documenting in the heapq > > module? It'd be too bad if any future users incorrectly think that it > > won't meet their needs the way I did. > > Yes.  Please assign a tracker issue to me

Re: "/a" is not "/a" ?

2009-03-06 Thread Joshua Kugler
Emanuele D'Arrigo wrote: c = "/a" d = "/a" c == d > True # all good so far c is d > False # ek! > > Why c and d point to two different objects with an identical string > content rather than the same object? Because you instantiated two difference

Re: VMware and pywin32 error...

2009-03-13 Thread Joshua Kugler
dot wrote: > has anyone experience with installing Python and pywin32 to Windows XP > Pro running in a VMware environment? > > At the end of installing pywin32 I get following error: > > > Traceback (most recent call last):

Re: Why is it that *dbm modules don't provide an iterator? (Language design question)

2009-04-09 Thread Joshua Kugler
Akira Kitada wrote: > The loop has to be: > """ k = d.firstkey() while k != None: > ...print k > ...k = d.nextkey(k) > key2 > key1 > """ Why not for key in d.keys(): print key That worked for me. j -- http://mail.python.org/mailman/listinfo/python-list

Re: Compile python extensions under windows/cygwin

2009-05-26 Thread Joshua Kugler
Joana wrote: > I mantain Python on Windows, all installed packages are under c: > \Python25\Lib\site-packages. Now I have to build C libraries used by > python extensions and I am using cygwin, but I don't know how to > install the module in Windows directory. I have used MingW to do this. Might

Re: How does Python's OOP feel?

2009-05-28 Thread Joshua Kugler
> The good thing about python is : it 'tastes' like what it was being > advertised +1 QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: multi-core software

2009-06-07 Thread Joshua Cranmer
Jon Harrop wrote: No. Most programmers still care about performance and performance means mutable state. [ Citation needed ]. Most programmers I've met could care less about performance. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth --

Re: Opening a SQLite database in readonly mode

2009-07-06 Thread Joshua Kugler
Paul Moore wrote: > The SQLite documentation mentions a flag, SQLITE_OPEN_READONLY, to > open a database read only. I can't find any equivalent documented in > the Python standard library documentation for the sqlite3 module (or, > for that matter, on the pysqlite library's website). > > Is it pos

Re: Opening a SQLite database in readonly mode

2009-07-07 Thread Joshua Kugler
Roger Binns wrote: > Joshua Kugler wrote: >> BTW, APSW is written by the same author as pysqlite. > Not even remotely true :-) Sorry about that...since pysqlite and APSW are both discusses on the pysqlite list, I had made an incorrect assumption. Oops. j -- http://mail.python

Re: Opening a SQLite database in readonly mode

2009-07-09 Thread Joshua Kugler
Joshua Kugler wrote: > Sorry about that...since pysqlite and APSW are both discusses on the > pysqlite list, I had made an incorrect assumption. Oops. "are both discusses?" Yeef, I must have been out of it. Discussed, thank you. :) j -- http://mail.python.org/mailman/listinfo/python-list

Re: len() should always return something

2009-07-27 Thread Joshua Kugler
Dr. Phillip M. Feldman wrote: > > "As far as I know, there is no programming language which treats scalars > like ints as if they were > vectors of length 1" > > Actually, Matlab does: > >>> length(5) > ans = > 1 >>> Oddly enough, so does Perl: $ print length(44) 2 (that's in the Zoidb

Re: Help understanding the decisions *behind* python?

2009-07-31 Thread Joshua Bronson
On Jul 22, 7:55 am, Duncan Booth wrote: > I find it interesting that the heapq functions tell you in the > documentation that they aren't suitable for use where n==1 or where n is > near the total size of the sequence whereas random.sample() chooses what it > thinks is the best algorithm based on

heapq "key" arguments

2009-07-31 Thread Joshua Bronson
According to http://docs.python.org/library/heapq.html, Python 2.5 added an optional "key" argument to heapq.nsmallest and heapq.nlargest. I could never understand why they didn't also add a "key" argument to the other relevant functions (heapify, heappush, etc). Say I want to maintain a heap of (x

Re: heapq "key" arguments

2009-07-31 Thread Joshua Bronson
On Jul 31, 2:02 pm, Jonathan Gardner wrote: > On Jul 31, 10:44 am, Joshua Bronson wrote: > > > Say I want to maintain a heap of (x, y) pairs sorted only by > > first coordinate. Without being able to pass key=itemgetter(0), won't > > heapifying a list of such pai

Re: Subclassing Python's dict

2009-08-05 Thread Joshua Kugler
Xavier Ho wrote: > On Thu, Aug 6, 2009 at 11:51 AM, Sergey Simonenko > wrote: > >> I subclass builtin 'dict' in my application and experience some problems >> with it. >> > > You should subclass collections.UserDict, and not the default dict class. > Refer to the collections module. Are you ref

Re: Do anyone here use Python *embedded* in a database?

2009-08-05 Thread Joshua Kugler
Jonathan Fine wrote: > Hi > > I'm writing a talk that compares embed and extend, and wondered if > anyone here ever used the Python *embedded* in a database server. > http://twistedmatrix.com/users/glyph/rant/extendit.html > > Web frameworks (such as Django) use extend, to import an extensi

Re: heapq "key" arguments

2009-08-06 Thread Joshua Bronson
On Aug 3, 1:36 pm, Raymond Hettinger wrote: > [Joshua Bronson]: > > > According tohttp://docs.python.org/library/heapq.html, Python 2.5 > > added an optional "key" argument to heapq.nsmallest and > > heapq.nlargest. I could never understand why they didn'

New Tkinter windows don't get focus on OS X

2009-09-09 Thread Joshua Bronson
If you try something like: $ python -m Tkinter -c 'Tkinter._test()' in Terminal on OS X, you'll notice that the window that is spawned does not get focus, rather focus remains in Terminal. Furthermore, if you hit Command+Tab to switch focus to the Python process, you'll notice that for some reaso

Re: New Tkinter windows don't get focus on OS X

2009-09-10 Thread Joshua Bronson
Hey Kevin, Thanks for your quick reply. On Sep 10, 10:12 am, Kevin Walzer wrote: > On 9/10/09 1:27 AM, Joshua Bronson wrote: > > If you try something like: > > > $ python -m Tkinter -c 'Tkinter._test()' > > > in Terminal on OS X, you'll notice that t

Re: GUIs - A Modest Proposal

2010-06-06 Thread Joshua Kordani
"Yo dawg I heard you like browsers, so we put a browser in your browser so you can browse while you browse!" -- Xibit On 6/6/2010 8:52 AM, Irmen de Jong wrote: On 6-6-2010 14:32, Lie Ryan wrote: On 06/06/10 22:09, Petite Abeille wrote: On Jun 6, 2010, at 12:52 PM, Steven D'Aprano wrote: Y

Re: Removing anti-Jewish postings from Python list

2010-06-16 Thread Joshua Kordani
Benjamin Kaplan wrote: On Wed, Jun 16, 2010 at 12:21 PM, Mark Lawrence wrote: On 16/06/2010 18:56, Alan Harris-Reid wrote: Any idea how we get rid of this 'noise'? Will it eventually go away if we ignore it, or is there anything the moderators can do to clean-up this (normally) wonder

Pyglet being extremely slow

2010-07-19 Thread Joshua Landau
I've just tried Pyglet on my computer, a lower-end laptop at that, and going though the Pyglet tutorials I've tried this: import pyglet > window = pyglet.window.Window() > @window.event def on_key_press(symbol, modifiers): print 'A key was pressed' > @window.event def on_draw():

Re: Download Microsoft C/C++ compiler for use with Python 2.6/2.7 ASAP

2010-07-29 Thread Joshua Kordani
Jean-Michel Pichavant wrote: Robert Kern wrote: On 7/23/10 7:08 PM, Lawrence D'Oliveiro wrote: In message, Robert Kern wrote: There are also utilities for mounting ISOs directly without burning them to a physical disk. You need special utilities to do this?? On at least some versions of

Re: Multiprocessing taking too much time

2010-07-29 Thread Joshua Kordani
The first thing that is generically tried when wishing to measure how long certain parts take is to record your own time snapshots in the code yourself. take the current time before an operation, take it after, subract, report it to yourself. Also, try working with an array that is actually b

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-25 Thread Joshua Maurice
On Aug 25, 1:44 pm, John Passaniti wrote: > On Aug 24, 9:05 pm, Hugh Aguilar wrote: > > > What about using what I learned to write programs that work? > > Does that count for anything? > > It obviously counts, but it's not the only thing that matters.  Where > I'm employed, I am currently managin

Re: How far can stack [LIFO] solve do automatic garbage collection and prevent memory leak ?

2010-08-25 Thread Joshua Maurice
On Aug 25, 4:01 pm, John Passaniti wrote: > On Aug 25, 5:01 pm, Joshua Maurice wrote: > > > I agree. Sadly, with managers, especially non-technical > > managers, it's hard to make this case when the weasel > > guy says "See! It's working.". &

Re: pydoc and imported modules

2007-04-25 Thread Joshua Schpok
I see. To make sure all my modules imported * are included in the pydocs, I'll add: __all__ = dir() to the end of my __init__.py file. Sometimes I implement a module with submodules, and flatten them out in __init__.py so the user sees it all as one single module. For example, module 'foobar' may

Raw string fu

2005-10-26 Thread Joshua Ginsberg
>>> r'\' File "", line 1 r'\' ^ SyntaxError: EOL while scanning single-quoted string >>> r'\\' '' Does that seem wrong to anybody else? Shouldn't the first one be syntactically correct? -jag -- http://mail.python.org/mailman/listinfo/python-list

Re: why not datetime.strptime() ?

2005-01-10 Thread Joshua Spoerri
Skip Montanaro pobox.com> writes: > josh> Shouldn't datetime have strptime? > If someone wants to get their feet wet with extension module > programming > this might be a good place to start. Mostly, I think nobody who has > needed/wanted it so far has the round tuits available to spend on the >

Lambda with copy.deepcopy()

2005-08-30 Thread Joshua Ginsberg
Howdy -- I have a class that has an attribute that is a dictionary that contains an object that has a kword argument that is a lambda. Confused yet? Simplified example: import copy class Foo: def __init__(self, fn=None): self.fn = fn class Bar: d = {'foobar':

Lambda evaluation

2005-10-06 Thread Joshua Ginsberg
So this part makes total sense to me: >>> d = {} >>> for x in [1,2,3]: ... d[x] = lambda y: y*x ... >>> d[1](3) 9 Because x in the lambda definition isn't evaluated until the lambda is executed, at which point x is 3. Is there a way to specifically hard code into that lambda definition the c

Re: Lambda evaluation

2005-10-06 Thread Joshua Ginsberg
lambda is going to have to take arbitrary arguments, so I can't specify x=x before the arbitrary arguments (otherwise, it gets overridden) and I can't specify it afterward (syntax error). :-/ Thanks! -jag On Thu, 2005-10-06 at 16:27 -0400, Jp Calderone wrote: > On Thu, 06 Oct 2005 16:1

Iterators from urllib2

2005-07-22 Thread Joshua Ginsberg
I'm a bit baffled by something... In a script I wrote, I have defined a function that runs urllib2.urlopen() on a urllib2.Request object and returns the file-like object. The code that calls this function attempts to build a csv.DictReader object based on that file-like object, but an error

mixins that don't down-call?

2005-08-10 Thread Joshua Spoerri
Anybody have an idea for how to do python mixins that don't down-call? Thanks ( Mixins from different vendors might use the same method names for unrelated features, but should continue to work sensibly. It's fine to have one mixin method override another in its "public" interface, but overridin

Strange python behavior with modules on an emt64 box

2006-01-20 Thread Joshua Luben
I thought I would post this here first before seeking more experienced ears for this particular strangness.   I have Python 2.4.2 installed from source on a dual processor dell server. These are x86_64 processors (verified by /bin/arch) (aka emt64 extensions).   uname -a gives Linux eps-li

RE: Strange python behavior with modules on an emt64 box

2006-01-23 Thread Joshua Luben
, January 20, 2006 4:00 PM To: python-list@python.org Subject: Re: Strange python behavior with modules on an emt64 box [Joshua Luben] > I thought I would post this here first before seeking more experienced > ears for this particular strangness. > > I have Python 2.4.2 installed from

PPC OSX vs. x86 Linux

2005-04-08 Thread Joshua Ginsberg
, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin and Python 2.3.3 (#1, May 7 2004, 10:31:40) [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2 <>Joshua Ginsberg -- [EMAIL PROTECTED] Brainstorm Internet Network Operations 970-247-1442 x131-- http://mail.python.o

Re: redirect stdout

2005-04-08 Thread Joshua Ginsberg
Use *NIX magic. Make a named pipe to a python program that pushes stdin to syslog and when you execute your program, redirect stdout to the named pipe. -jag <>Joshua Ginsberg -- [EMAIL PROTECTED] Brainstorm Internet Network Operations 970-247-1442 x131 On Apr 8, 2005, at 10:52 AM, Neal

Re: Equivalent string.find method for a list of strings

2005-04-08 Thread Joshua Ginsberg
Try: filter(lambda x: x.find(searchstring) != -1, lines) <>Joshua Ginsberg -- [EMAIL PROTECTED] Brainstorm Internet Network Operations 970-247-1442 x131 On Apr 8, 2005, at 12:17 PM, jeremit0 wrote: I have read a text file using the command lines = myfile.readlines() and now I want to seach

Re: Equivalent string.find method for a list of strings

2005-04-08 Thread Joshua Ginsberg
try: filter(lambda x: lines[x].find(searchstring) != -1, range(len(lines))) That will return a list with the indices of every line containing a hit for your search string. -jag <>Joshua Ginsberg -- [EMAIL PROTECTED] Brainstorm Internet Network Operations 970-247-1442 x131 On Apr 8, 2005, a

Re: Https Form Page

2005-04-08 Thread Joshua Ginsberg
ps_headers = fs.info().headers https_mimetype = fs.info().type -jag <>Joshua Ginsberg -- [EMAIL PROTECTED] Brainstorm Internet Network Operations 970-247-1442 x131 On Apr 8, 2005, at 2:13 PM, Hasan D wrote: I'm new on this httplib and urllib. Actually I dont know what should i use. I wa

Re: Exception Handling

2005-04-08 Thread Joshua Ginsberg
rror class inherits from the generic Exception class). -jag <>Joshua Ginsberg -- [EMAIL PROTECTED] Brainstorm Internet Network Operations 970-247-1442 x131 On Apr 8, 2005, at 3:29 PM, SuperJared wrote: I'm new to Python, well versed in PHP and a bit of Perl. I've written a simple back

Re: Https Form Page

2005-04-10 Thread Joshua Ginsberg
It all really, really, really depends on your script processing the form. My suggestion is to use the openssl s_client program, manually submit your data, and see what your server is responding with. -jag <>Joshua Ginsberg -- [EMAIL PROTECTED] Brainstorm Internet Network Operations 970-24

Weird...

2005-04-11 Thread Joshua Ginsberg
>>> {'a':1,'b':'2','c':[3,4]}.keys() ['a', 'c', 'b'] How come? :-) -jag Python 2.3.3 (#1, May 7 2004, 10:31:40) [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2 <>Joshua Ginsberg -- [EMAIL PROTECTED] Brain

Re: [Pythonmac-SIG] Fwd: PPC OSX vs. x86 Linux

2005-04-11 Thread Joshua Ginsberg
Well, I compiled a fresh version of Python 2.3.5 from python.org to test the datetime theory... and I'm still getting 150sec execution times. :-/ I'm gonna test the string vs. strop now... -jag <>Joshua Ginsberg -- [EMAIL PROTECTED] Brainstorm Internet Network Operations 970-

Re: More mod_wsgi weirdness: process restarts on redirect

2009-01-29 Thread Joshua Kugler
Ron Garret wrote: > My question is: is this supposed to be happening? Or is this an > indication that something is wrong, and if so, what? You are probably just hitting a different instance of Apache, thus the different process ID. j -- http://mail.python.org/mailman/listinfo/python-list

Re: Change in cgi module's handling of POST requests

2009-02-12 Thread Joshua Kugler
Bob Kline wrote: > [Didn't realize the mirror didn't work both ways] > > We just upgraded Python to 2.6 on some of our servers and a number of our > CGI scripts broke because the cgi module has changed the way it handles > POST requests. > When the 'action' attribute was not present in the form

Re: urllib2 login help

2009-02-23 Thread Joshua Kugler
You also might want to look at http://wwwsearch.sourceforge.net/mechanize/ It will do most of the hard stuff for you (sending form elements, keeping track of cookies, etc.). j john.weather...@gmail.com wrote: > Hello, > > I'm having trouble using urllib2 (maybe) when trying to log into a web >

Re: what's so difficult about namespace?

2008-11-26 Thread Joshua Cranmer
Xah Lee wrote: In many languages, they don't have namespace and is often a well known sour point for the lang. For example, Scheme has this problem up till R6RS last year. PHP didn't have namespace for the past decade till about this year. Javascript, which i only have working expertise, didn't h

Disputing Cookie.py's definition of valid characters

2008-12-11 Thread Joshua Kugler
Some investigation today revealed that Cookie.py thinks these are valid characters for names and values of cookies: _LegalCharsPatt = r"[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]" The rest, presumably being encoded via %NN. I notice that (), {}, and others made the list, but not []. Is the

Re: Parsing Excel spreadsheets

2009-01-01 Thread Joshua Moore
On Dec 30 2008, 8:07 am, "andyh...@gmail.com" wrote: > Hi, > > Can anybody recommend an approach for loading and parsing Excel > spreadsheets in Python. Any well known/recommended libraries for this? > > The only thing I found in a brief search > washttp://www.lexicon.net/sjmachin/xlrd.htm, > but

Using vObject

2008-09-22 Thread Joshua Gardner
I'm brand new to USENET so please bear with me. I'm writing a specialized to-do list app. I'm using Django but this is not a question about Django. It has to have recurring tasks set by the managers for the employees to then check off. I've got pretty much everything in the app worked out, except

Re: Access to Google Calendar

2008-10-09 Thread Joshua Kugler
pepitovadecurt wrote: > Hi I need to access to the Google Calendar under python. > Is posible? You mean this? http://code.google.com/apis/calendar/developers_guide_python.html j -- http://mail.python.org/mailman/listinfo/python-list

Re: PYTHON WORKING WITH PERL ??

2008-10-16 Thread Joshua Kugler
Pat wrote: >> Rewrite everything in python. Save yourself now...while you still >> can. >> >> ~Sean > > Trust me. Sean is absolutely correct. I'm currently in the process of > converting a large Perl project to Python (and learning Python at the > same time) and the improvement in code is incred

Re: fcgi.py on windows?

2008-10-20 Thread Joshua Kugler
bryan rasmussen wrote: > As per the subject, anyone know of a version of fcgi.py out there > somewhere that works on windows yet. They might have ported a version for Python 2.6. Versions <= 2.5 didn't have a socket.fromfd() on Windows, so FCGI and SCGI wouldn't work. j -- http://mail.python.o

Re: Possible read()/readline() bug?

2008-10-23 Thread Joshua Kugler
Mike Kent wrote: > To followup on this: > > Terry: Yes, I did in fact miss the 'buffer' parameter to open. > Setting the buffer parameter to 0 did in fact fix the test code that I > gave above, but oddly, did not fix my actual production code; it > continues to get the data as first read, rather

Re: Python and binary compatibility

2008-01-25 Thread Joshua Kugler
Christian Heimes wrote: > You can use MinGW32 to compile the extension, too. Or use the free > toolchain as described at > http://wiki.python.org/moin/Building_Python_with_the_free_MS_C_Toolkit That page has a link to the Microsoft Visual C++ Toolkit 2003 page, which then says it's been discontinu

Re: Trying to understand Python web-development

2008-01-29 Thread Joshua Kugler
walterbyrd wrote: > Python also seems to require some sort of "long running processes" I > guess that the python interpretor has to running all of time. What you probably don't realize, is that in 99.9% of the situations you've come across, PHP is already a process running all the time. It's call

Re: SimpleXMLRPCServer to fastcgi via WSGI?

2008-02-01 Thread Joshua Kugler
Ivan Voras wrote: > Is there a straightforward way to convert an XML-RPC server application > (written for SimpleXMLRPCServer) to use WSGI so that it can be used as s > fastcgi server? By "straightforward" I mean something simple, without > using some external framework. > > Alternatively, I don't

Re: embedded python in c++ packaging

2008-02-07 Thread Joshua Kugler
Furkan Kuru wrote: > Hello, > > I have been developing an application in C++ that embeds Python > interpreter. It takes advantage of too many modules from Python. > When I want to package this application, I need to add too many files > (.pyc) from Python/lib folder together with Python25.dll. > I

Using Cookie and Proxy handler with urllib2

2008-02-09 Thread Joshua Gilman
Hello, here is my current code: import urllib, urllib2, cookielib class wrapper: def __init__(self): self.setupCookies() def request(self, address, postData=None, headers={ }): if not postData == None: postData = urllib.urlencode(postData) req = urllib

Re: No Module Named pstats

2008-02-13 Thread Joshua Kugler
Chris wrote: > On Feb 13, 11:20 am, "Juha S." <[EMAIL PROTECTED]> wrote: >> Hi, >> >> I'm trying to use the Python profilers to test my code, but I get the >> following output for cProfile.run() at the interpreter: >> >> Traceback (most recent call last): >> File "", line 1, in >> File "/usr/

Re: problem with mod_python

2008-02-19 Thread Joshua Kugler
Pradnyesh Sawant wrote: > Hello, > I have a small program which does 'import hashlib'. This program runs fine > with python2.5. But when I try running the same program through > mod_python, I get the error: 'ImportError: No module named hashlib' in the > apache2 error.log > > Searching online sug

Re: How to import custom python file in python server page (psp) ?

2008-03-14 Thread Joshua Kugler
James Yu wrote: > Hi folks, > > I prepared a python script for dynamically get the absolute paths of the > files in certain folder. > Then I tried to invoke that function from my web server in a .psp file > like this: > > 1 > 2 > 3 asdfasdfasdfa > 4 > 5 <% >

Re: Is __import__ known to be slow in windows?

2007-11-30 Thread Joshua Kugler
> What modules are you __import__ing, and what is platform-dependent in > each? The only thing we're importing __import__ are some modules of ours, with no sytem dependent code in them at all. Some of them are even empty modules, as was suggested by one response (for benchmarking purposes). Turn

(More) Re: Is __import__ known to be slow in windows?

2007-11-30 Thread Joshua Kugler
Ok, so we have this code: t = timeit.Timer(stmt='r()', setup='from __main__ import r') sys.path.insert(0,'/path/to/code') def r(): for m in ['three','module','names']: try: x = __import__(m) except ImportError, e: if not e.message.startswith('No module

Is __import__ known to be slow in windows?

2007-11-30 Thread Joshua Kugler
[I tried googling for this, didn't find anything relevant.] We've recently been doing some profiling on a project of ours. It runs quite fast on Linux but *really* bogs down on Windows 2003. We initially thought it was the simplejson libraries (we don't use the C extensions) but profiling proved

Re: (More) Re: Is __import__ known to be slow in windows?

2007-12-01 Thread Joshua Kugler
John Machin wrote: > On Dec 1, 2:12 pm, Joshua Kugler <[EMAIL PROTECTED]> wrote: >> x = __import__(m) > > Have you ever tried print m, x.__file__ here to check that the modules > are being found where you expect them to be found? No, I haven't, but I do

Re: which configparse?

2007-12-06 Thread Joshua Kugler
Shane Geiger wrote: > Best, is naturally, a somewhat subjective evaluation. That being said, > configparser is well regarded. I have also seen these two options that > you might want to check out: > > http://wiki.woodpecker.org.cn/moin/Dict4Ini > http://www.voidspace.org.uk/python/configobj.htm

Re: JSON

2007-12-06 Thread Joshua Kugler
[EMAIL PROTECTED] wrote: > i tried a couple python json libraries. i used simplejson on the > server and was using cjson on the client, but i ran into this issue. > i'm now using simplejson on both sides, but i'm still interested in > this issue. did i do something wrong? is there a bug in one of

Re: Capture DOS error???

2007-12-06 Thread Joshua Kugler
Tangen, Erik wrote: > Did you ever get a solution to this? > I am also in need of this solution. > Thanks, > Erik Can you clarify? What is a DOS error? You mean an error in reading or writing a file? That would be an IOError exception. If a file is not found, or you can't read it, that's an O

Re: reading cookies from PHP

2007-12-10 Thread Joshua Kugler
Jack Holt wrote: > Hello there. > I'm a PHP fan but a Python newbie. I wrote anapplication in Python > that needs to read a cookie setup from a PHP page. Is itpossible to do it? > > If not, what if I create a TXT file - as well as a cookie - thatcontains > the cookie's data? Will python be able to

Handling cookies without urllib2 and cookielib

2007-12-14 Thread Joshua Kugler
Standard disclaimer: read, googled, read some more. If you have a link, please free free to point me there. I'm using HTTPlib to construct some functional tests for a web app we're writing. We're not using urllib2 because we need support for PUT and DELETE methods, which urllib2 does not do. We

Re: why this error?

2007-12-16 Thread Joshua Kugler
python.jiang wrote: > hello friends, the question had show bellow, any friend can tell me why. > thanks. > > list: > def test(): > exec "import sys" > a=range(15) > b=[13,3] > c=filter(lambda x: x not in b,a) > return c > print test() > > run result: > File "a.py", line 2 > exe

Re: Handling cookies without urllib2 and cookielib

2007-12-17 Thread Joshua Kugler
Gabriel Genellina wrote: > On 14 dic, 23:44, Joshua Kugler <[EMAIL PROTECTED]> wrote: > >> I'm using HTTPlib to construct some functional tests for a web app we're >> writing. We're not using urllib2 because we need support for PUT and >> DELETE meth

Re: .NET and Python Integration Problem and PDF Library (Need Help and Suggestions)

2007-12-18 Thread Joshua Kugler
Ravi Kumar wrote: > - your opinion with available PDF Libraries, that are best among. Also > which library to use for Windows server platform (there is limitation > on installing long chain libraries that include other deep > dependencies too). A pure python PDF library would be good, but which > o

  1   2   3   4   5   6   7   >