How many times does unittest run each test?

2013-08-10 Thread Josh English
f SimpleChecker - DEBUG - calling f -- Ran 2 tests in 0.013s OK Exit code: False Why am I seeing those extra debugging lines? In the script I'm really trying to debug, I see 12-13 debug messages repeated, making actual debugging difficult. Josh English -- http://mail.python.org/mailman/listinfo/python-list

Re: How many times does unittest run each test?

2013-08-10 Thread Josh English
On Saturday, August 10, 2013 1:40:43 PM UTC-7, Roy Smith wrote: > In article , > > Josh English wrote: > The first thing to do is get this down to some minimal amount of code > that demonstrates the problem. > > > > For example, you drag in the logging modul

Re: How many times does unittest run each test?

2013-08-10 Thread Josh English
Aha. Thanks, Ned. This is the answer I was looking for. I use logging in the real classes, and thought that turning setting the level to logging.DEBUG once was easier than hunting down four score of print statements. Josh On Sat, Aug 10, 2013 at 3:52 PM, Ned Batchelder wrote: > On 8/10/13 4

Re: How many times does unittest run each test?

2013-08-10 Thread Josh English
. I'm working a feature that allows the checker to call a function to get acceptable values, instead of defining them at the start of the program. I included all of that because it's the shape of the script I'm working with. The real problem was setting additional handlers where they shouldn't be. Josh -- http://mail.python.org/mailman/listinfo/python-list

Re: How many times does unittest run each test?

2013-08-10 Thread Josh English
ebugging, because it is pretty straightforward and can be activated for a small section of the module. My modules run long (3,000 lines or so) and finding all those dastardly print statements is a pain, and littering my code with "if debug: print message" clauses. Logging just makes it simple. Josh -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a function that applies list of functions to a value?

2013-08-28 Thread Josh English
Reduce tricks are nice, but I prefer clarity sometimes: def double(x): return x*2 def add3(x): return x+3 def compose(*funcs): for func in funcs: if not callable(func): raise ValueError('Must pass callable functions') def inner(value): for func in fu

Re: Understanding how is a function evaluated using recursion

2013-09-25 Thread Josh English
ted, what value does it returns? > In this case, flatten always returns a list. When it hits the recursion, it calls itself to get another list, that it uses to extend the current list. Josh -- https://mail.python.org/mailman/listinfo/python-list

Google Code Shutting Down

2015-03-12 Thread Josh English
I've been hosting Python projects on Google Code, and they're shutting down. Damn. What is the recommended replacement for Code Hosting that works reliably with PyPi and pip? -- https://mail.python.org/mailman/listinfo/python-list

Re: Google Code Shutting Down

2015-03-13 Thread Josh English
Thanks for the discussion. I found my original concern was supposedly about sourceforge. PyPi, according to a post over on pypubsub-dev that pip installs had anecdotal problems with sourcforge-hosted projects. I guess I wanted some more anecdotes and opinions before I tried moving anything. I

Re: Most pythonic way of rotating a circular list to a canonical point

2015-08-01 Thread Josh English
examples all look like sorting to me. I think the collections.deque object has a rotate method, and rotating through the possibilities looking for matches may work, or take any deque, rotate so the minimum value is at the first place in the deque, and then compare. Or am I not understanding what you mean? Josh -- https://mail.python.org/mailman/listinfo/python-list

os.startfile hanging onto the launched app, or my IDE?

2014-06-06 Thread Josh English
DE is keeping track of things created by the os.startfile call, but the docs imply this doesn't happen. Is this a quirk of os.startfile? Is there a cleaner way to get Windows to open files without tying back to my program? Thanks, Josh -- https://mail.python.org/mailman/listinfo/python-list

Re: os.startfile hanging onto the launched app, or my IDE?

2014-06-09 Thread Josh English
access the file (because it is currently open). I even left it open and ran another script that also creates and launches an Excel workbook, and it again did not close Excel. So this quirk is coming from PyScripter, which is a shame, because I don't think it's under development, so it won't be fixed. Josh -- https://mail.python.org/mailman/listinfo/python-list

Storing instances using jsonpickle

2014-09-03 Thread Josh English
I am using jsonpickle to store instances of an object into separate data files. If I make any changes to the original class definition of the object, when I recreate my stored instances, they are recreated using the original class definition, so any new attributes, methods, or properties, are lo

Re: Storing instances using jsonpickle

2014-09-03 Thread Josh English
cade trying to make an XML-based database work, in part because of this limitation. Some days I get so frustrated I think the only data structure I should ever use is a dictionary. I suppose to make this sort of thing work, I should look at creating custom json encoders and decoders.

protocol.py, brine.py, and compat.py causing trouble

2014-09-13 Thread Josh English
s is where I managed to send a keybord interrupt. I was working just fine, tweaking a line, running the code, tweaking a line, running the code, until this point. I'm on Windows 7 using Python 2.7.5. I should upgrade, and will do so, but what are these files and why are they suddenly crashi

Re: Storing instances using jsonpickle

2014-09-15 Thread Josh English
#x27;s __dict__ is serializable, but that's not so tough. I need to add a version number, though. Good idea, that. Josh -- https://mail.python.org/mailman/listinfo/python-list

Re: protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Josh English
out to be part of PyScripter, my IDE. Oddly enough, once I fixed the actual problem (minutes after posting) it still makes no sense... I had a list of things that I processed and returned, but some refactoring left out filling the return list with anything. I'm not sure what h

Re: protocol.py, brine.py, and compat.py causing trouble

2014-09-15 Thread Josh English
On Sunday, September 14, 2014 10:59:07 AM UTC-7, Terry Reedy wrote: > On 9/14/2014 2:44 AM, Josh English wrote: > > > To the best of my knowledge, protocol.py, brine.py, compat.py, are not > part of the stdlib. What have you installed other than Python? What > editor/IDE are

Deleting files on a shared server

2011-10-06 Thread Josh English
to the wxPython Application object) that hunts down .lock files and deletes them. Is there a better command than os.unlink to delete a file on Windows 2003 server? Josh -- http://mail.python.org/mailman/listinfo/python-list

Re: Deleting files on a shared server

2011-10-06 Thread Josh English
The problem shows up when the application starts. It tries to read the file but the lock mechanism times out because the file is still around after the last time the application ran. It's a wxPython program. The code to unlink the .lock files is run in the wxApp.OnInit method (before any code t

Is len() restricted to (positive) 32-bit values?

2005-12-29 Thread Josh Taylor
lt;<70) >>> class LenTest: ... def __len__(self): ... return 490 ... >>> x = LenTest() >>> x.__len__() 490 >>> len(x) 1755359744 Is this a bug, a design decision, or do I have something misconfigured in my Python build? -Josh -- http://mail.python.org/mailman/listinfo/python-list

Debugging question: Print out program state (Variables)

2006-10-06 Thread Josh Bloom
to do is write out the state of my script when an error is encountered. I've been looking at the traceback module and think Im on the right track, but I haven't figured out a way to write out all of the programs current variables. Is there a handy module that can do something like that? T

Re: help on pickle tool

2006-10-06 Thread Josh Bloom
If you must build your web ui in Java, then Jython is probably the best way for you to go. Inside of your java code you need to create a Jython instance. Then you can use the Jython pickle module to deserialize the data you are receiving. Last I remember Jython was equivalent to about CPython 2.2

Re: MP3 files and Python...

2006-10-11 Thread Josh Bloom
Dive Into Python also has a little tutorial/code for reading and editing mp3 tags. http://www.diveintopython.org/object_oriented_framework/index.html -JBOn 10/10/06, Max Erickson <[EMAIL PROTECTED]> wrote: Karlo Lozovina <[EMAIL PROTECTED]> wrote:> I'm looking for a Python lib which can read and _w

Re: What's the best IDE?

2006-10-25 Thread Josh Bloom
I'm not going to call it the 'best' ide as thats just silly. But if your developing on Windows pyscripter http://mmm-experts.com/Products.aspx?ProductId=4 is a great IDE. -JoshOn 10/25/06, Bruno Desthuilliers <[EMAIL PROTECTED] > wrote:[EMAIL PROTECTED] a écrit :> Recently I've had some problems w

Looking for a way to stop execution of script, in the script

2006-11-14 Thread Josh Bloom
way to do something like this?doFirstThing()doSecondThing()if something:     diedoThirdThing()Thanks for the help, Josh -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for a way to stop execution of script, in the script

2006-11-14 Thread Josh Bloom
Thanks Fredrik, yeah the while loop for single run is pretty stupid. sys.exit() thats the call I was looking for. -JoshOn 11/14/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: Josh Bloom wrote:> Hi everyone, I'm looking for a way to stop execution of a script from> within the scrip

Re: XSLT speed comparisons

2006-09-28 Thread Josh Bloom
Hey Damian, I suggest you take a look at http://mmm-experts.com/Products.aspx?ProductId=4 which is a nice open source Python IDE for windows. After you've installed the version from that page, you should go to http://groups.google.com/group/PyScripter?lnk=oa and get the more recent unofficial rele

Re: python html rendering

2006-10-03 Thread Josh Bloom
Hey Pierre,I'm using this plug-in for wordpress to display Python code. http://blog.igeek.info/wp-plugins/igsyntax-hiliter/It works pretty well and can display a lot of other languages as well. -JoshOn 10/3/06, Pierre Imbaud <[EMAIL PROTECTED]> wrote: Hi, Im looking for a way to display some pytho

Re: client/server design and advice

2006-12-01 Thread Josh Bloom
You may also want to take a look at Erlang http://www.erlang.org/ for some ideas of how to do distributed programming. -- http://mail.python.org/mailman/listinfo/python-list

Re: detecting that a SQL db is running

2006-12-01 Thread Josh Bloom
supposed to run as. -Josh On 12/1/06, bill ramsay <[EMAIL PROTECTED]> wrote: Dennis none of this matters, all i am trying to find out is whether or not the local MSDE is actually running. I put all the other bits in there to try and put some background to it. kind regards bill -

re behaving strangely

2005-06-09 Thread Josh Close
This is not returning a match re.compile( r'b' ).search( 'back', re.I ) Anyone know why this is? -- -Josh -- http://mail.python.org/mailman/listinfo/python-list

Re: re behaving strangely

2005-06-09 Thread Josh Close
Thanks for pointing out my utter stupidity :) It's been a long day. -Josh On 6/9/05, Peter Hansen <[EMAIL PROTECTED]> wrote: > Josh Close wrote: > > This is not returning a match > > > > re.compile( r'b' ).search( 'back', re.I ) > &g

Re: Create a new class on the fly

2007-06-04 Thread Josh West
Alex Martelli wrote: > > Thanks for snipping all the actual helpful stuff I posted, it makes SO > much easier for me to be snide! > > You can find a few examples of me demonstrating the subject of your > interest by searching for my name e.g. on video.google.com; searching > for my name on Amazon w

Python 2.5.1 - sqlite3.dll issue

2007-06-07 Thread Josh Ritter
//www.sqlite.org and this fixes the problem. (This dll isn't stripped) -Josh Ritter President Prairie Games, Inc http://www.prairiegames.com -- http://mail.python.org/mailman/listinfo/python-list

Multiline lamba implementation in python.

2007-06-11 Thread Josh Gilbert
7;\n print x\n return(x**2)''')(x) for x in range(3)] 0 1 2 [0, 1, 4] There are a few tricks with the indenting, no question. myLambda should be more intelligent than it is, I'm thinking of using regular expressions to do simple indentation checking. Lexical variable scoping wou

Re: Multiline lamba implementation in python.

2007-06-12 Thread Josh Gilbert
On 6/12/07, Facundo Batista <[EMAIL PROTECTED]> wrote: Josh Gilbert wrote: > I don't expect multiline lambdas to be added to Python. I'm not so sure that > that's a bad thing. Regardless, isn't it possible to write your own Yes, it is a bad thing. Why? Be

Re: Questions about mathematical and statistical functionality in Python

2007-06-14 Thread Josh Gilbert
e Software equivalent to Spotfire. The closest I've found (and they're nowhere near as good) are Orange (http://www.ailab.si/orange) and WEKA (http://www.cs.waikato.ac.nz/ml/weka/). Orange is written in Python, but its tied to QT 2.x as the 3.x series was not available on Windows under the GPL. Josh Gilbert -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiline lamba implementation in python.

2007-06-15 Thread Josh Gilbert
On Wednesday 13 June 2007 4:04 am, Duncan Booth wrote: > "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > But you already have "multiline" lambdas right now in that sense, no > > need to add anything. I think you were talking about lambdas *with* > > statements inside. > > > > bin = lambda x:((

Re: Do U have anything to share with this students

2007-06-16 Thread Josh Hill
of students. > >Your link doesn't work. Hope you're protected against malware. -- Josh "Paranoia results from a proper perception of the food chain." - Boots -- http://mail.python.org/mailman/listinfo/python-list

Re: how to find a lable quickly?

2007-05-04 Thread Josh Bloom
esultsFile.readlines() for line in testLines: label = line.split( ) etc.. Another option is to use a Regular Expression which may speed this up for you. http://docs.python.org/lib/module-re.html -Josh On 5/4/07, wang frank <[EMAIL PROTECTED]> wrote: Hi, I am a new user on Python and I rea

Re: progress indicator in a mod_python script

2007-05-17 Thread Josh Bloom
if the job is done, if the job is done, return the results, if its not return keeps checking until its. Here's some info about making an HTML Page refresh itself automatically. http://en.wikipedia.org/wiki/Meta_refresh -Josh On 17 May 2007 07:46:28 -0700, Rajarshi <[EMAIL PROTECTED]>

Proxying every function in a module

2007-05-25 Thread Josh West
Hello I've got a web application with the following structure: 1) module of 100 functions corresponding to user actions (e.g. "update_profile()", "organisations_list()") 2) a wsgi callable which maps urls to functions eg /organisations/list/?sort=date_created is mapped to organisations_list("date

Proxying every function in a module

2007-05-25 Thread Josh West
Kind and wise fellows, I've got a web application with the following structure: 1) module of 100 functions corresponding to user actions (e.g. "update_profile()", "organisations_list()") 2) a wsgi callable which maps urls to functions eg /organisations/list/?sort=date_created is mapped to orga

Re: Proxying every function in a module

2007-05-25 Thread Josh West
> > First off, don't attempt to start a new thread by replying to a previous > one. Many newsreaders will merge the two, confusing the hell out of > everyone and generally not helping. > Ahh, yes. I see what you mean. Explains why it didn't appear the first time I posted (until later..). So

Re: Python memory handling

2007-05-31 Thread Josh Bloom
If the memory usage is that important to you, you could break this out into 2 programs, one that starts the jobs when needed, the other that does the processing and then quits. As long as the python startup time isn't an issue for you. On 31 May 2007 04:40:04 -0700, [EMAIL PROTECTED] <[EMAIL PROT

ensuring GNU readline isn't used

2007-08-07 Thread Josh Paetzel
Unfortunately, I can't control if the Python interpreter my customers may be using has readline compiled in. So, I'm wondering if there is anyway to tell Python libraries like "cmd" to not use GNU's readline? Alternatively, could we just include pyreadline as readline

Error with long running web spider

2007-08-22 Thread Josh Volz
Hi everyone: I have a spider that is relatively long running (somewhere between 12-24 hours). My problem is that I keep having an issue where the program appears to freeze. Once this freezing happens the activity of the program drops to zero. No exception is thrown or caught. The program simpl

Re: Error with long running web spider

2007-08-22 Thread Josh Volz
On Aug 22, 10:58 am, Josh Volz <[EMAIL PROTECTED]> wrote: I'm running this program on Windows XP, using Python 2.5. I'm using Active State Komodo IDE 4.0 as the run environment. Thanks, J. > Hi everyone: > > I have a spider that is relatively long running (somewh

Re: IronPython with Apache

2007-03-08 Thread Josh Bloom
Hi Ed, Some more info about your environment will be helpful here. What OS version, apache version, etc. -Josh On 7 Mar 2007 15:05:54 -0800, edfialk <[EMAIL PROTECTED]> wrote: Hi all, I'm completely new to Python, but fairly experienced in PHP and few other languages. Long story

Re: Server-side script takes way too long to launch

2007-03-13 Thread Josh Bloom
Teresa, when you call a python script this way, the server needs to load the python interpreter for each call. If you need faster execution you should look into having a server process running already. Something like mod_python for apache or CherryPy will help you speed this up. -Josh On 3/13

Re: Python & Oracle

2007-03-14 Thread Josh Bloom
I would suggest using cx_Oracle as I have had good experience with it. http://www.cxtools.net/default.aspx?nav=cxorlb -Josh On 3/14/07, Facundo Batista <[EMAIL PROTECTED]> wrote: Hi! I need to connect to Oracle. I found this binding, http://www.zope.org/Members/matt/dco2 that

Re: List to string

2007-03-20 Thread Josh Bloom
That's pretty funny :) On 3/20/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: On Tue, 20 Mar 2007 13:01:36 +0100, Bruno Desthuilliers wrote: > Steven D'Aprano a écrit : >> On Mon, 19 Mar 2007 13:11:09 +0100, Bruno Desthuilliers wrote: >> >>> There's no "cast" in Python. It would make no sens i

Re: writing dictionaries to a file

2007-03-21 Thread Josh Bloom
append(somey3) for dict in dictList: #Iterate over the lists print ("%s, %s") % (somex['unit'], dict['code']) #Print just the info that you want I'll leave writing it to a file as an exercise in Googling. -Josh On 3/21/07, kavitha thankaian <[EMAIL PROTECTE

Re: Printing __doc__

2007-03-21 Thread Josh Bloom
ply a string containing the name of the function. You'll need the actual function itself to get its docstring. -Josh On 21 Mar 2007 12:47:06 -0700, gtb <[EMAIL PROTECTED]> wrote: Greetings, Don't know the daily limit for dumb questions so I will ask one or more. In a

Re: grabbing Pictures from the web

2007-04-10 Thread Josh Bloom
writing a binary file. newPic.writelines(picture) newPic.close() -Josh On 4/10/07, Juan Vazquez < [EMAIL PROTECTED]> wrote: I am new to python (2 weeks old) and I would like to write a script that grabs pictures from the web (specifically flickr) and put them on a Tk Canvas for a slide s

Re: How to create a file on users XP desktop

2007-10-06 Thread Josh Bloom
I believe you can use something like '%USERPROFILE%\DESKTOP' as the path on a windows machine to get to the current users desktop directory. I'm not sure if the python open() command will expand that correctly, but give it a shot. -Josh On 10/6/07, goldtech <[EMAIL PROTECTE

Re: Cannibals For The Presidency! Meet, The Candidates!

2007-10-11 Thread Josh Hill
nest post I've seen here all year. BTW, it's "Morlock," not "Warlock." -- Josh "Playing 'Bop' is like playing Scrabble with all the vowels missing." - Duke Ellington -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursive zipping of Directories in Windows

2007-02-04 Thread Josh Bloom
eve you'll need to set the archive name for the nested files to something like \\temp\\file.ext etc. -Josh On 4 Feb 2007 11:42:23 -0800, Jandre <[EMAIL PROTECTED]> wrote: On Feb 1, 9:39 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > Jandre wrote: > > Hi > > > I

Re: Python design project

2007-02-05 Thread Josh Bloom
olid programming language behind it to write in your rules logic. Best, Josh On 5 Feb 2007 03:09:33 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: I think I need to explain the things better I think, so I do; First answering the questions above; I think i have to explain the project more

Developing a Package with Sub Packages

2008-02-17 Thread Josh English
__init__.py module to use relative paths to its own module, and not the current working directory the os module provides? This could also solve the problem with Config.py, I think. Thanks Josh English http://joshenglish.livejournal.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Developing a Package with Sub Packages

2008-02-18 Thread Josh English
When testing the package in idle, this results in C:\Python25\Lib\idlelib instead of the file. The Data folder is created in this folder now. On 2/18/08, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Sun, 17 Feb 2008 22:34:27 -0200, Josh English > <[EMAIL PROTECTED]> escr

bool evaluations of generators vs lists

2009-02-10 Thread Josh Dukes
first value is detected*. I'd really expect it to act more like... def has_values(g): for i in g: return True return False So what's going on here? Am I using the wrong function or is this actually just a bug? -- Josh Dukes MicroVu IT Department -- http://mail.

Re: bool evaluations of generators vs lists

2009-02-10 Thread Josh Dukes
ation that someone else might also want to do the same thing in real-world code. Is there another list I should be asking these questions on? -- Josh Dukes MicroVu IT Department#!/usr/bin/env python from datetime import datetime def has_values(g): for i in g: return True return

Re: bool evaluations of generators vs lists

2009-02-10 Thread Josh Dukes
ahhh any! ok, yeah, I guess that's what I was looking for. Thanks. On 10 Feb 2009 21:57:56 GMT Steven D'Aprano wrote: > On Tue, 10 Feb 2009 12:50:02 -0800, Josh Dukes wrote: > > > The thing I don't understand is why a generator that has no iterable > > value

Re: how can this iterator be optimized?

2009-02-12 Thread josh logan
On Feb 11, 8:22 pm, Basilisk96 wrote: > Hello all, > > I have the following function that uses an intermediate iterator > "rawPairs": > > def MakePairs(path): >     import os >     import operator >     join = os.path.join >     rawPairs = ( >         (join(path, s), func(s)) >         for s in os

Re: Read Only attributes, auto properties and getters and setters

2009-02-12 Thread josh logan
On Feb 12, 10:58 am, TechieInsights wrote: > Oh... one other thing that would be really cool is to do this with AOP/ > descriptors!  I just haven't been able to get that to work either. > Basics... > > @readonly > class MyClass(object): >         def __init__(self, x): >                 self.set_x

Re: Read Only attributes, auto properties and getters and setters

2009-02-12 Thread josh logan
On Feb 12, 12:27 pm, TechieInsights wrote: > Ok... for some closure I have written a class to automate the > process.  It takes getters and setters and deleters and then sets the > property automatically.  Sweet! > > class AutoProperty(type): >         def __new__(cls, name, bases, methoddict): >

Re: how can this iterator be optimized?

2009-02-14 Thread josh logan
On Feb 13, 7:44 pm, Basilisk96 wrote: > On Feb 12, 1:15 am, Steven D'Aprano > > wrote: > > > I usually strive > > > for comprehensions if a for loop can be reduced to such. > > > Any particular reason? > > Only two. > 1.) I was impressed by their clarity and conciseness when I first > discovered

Re: Scanning a file character by character

2009-02-17 Thread Josh Dukes
7;fox', 'jumps,', 'and', 'falls', > 'over.'] > > Note the difference in "jumps" vs. "jumps," (extra comma in the > string.split() version) and likewise the period after "over". > Thus not quite "the exact same thing as line.split()". > > I think an easier-to-read variant would be > >>>> re.findall(r"\w+", s) >['The', 'quick', 'brown', 'fox', 'jumps', 'and', 'falls', 'over'] > > which just finds words. One could also just limit it to letters with > >re.findall("[a-zA-Z]", s) > > as "\w" is a little more encompassing (letters and underscores) > if that's a problem. > > -tkc > > > > > -- > http://mail.python.org/mailman/listinfo/python-list -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Putting asterisks around text

2009-02-17 Thread Josh Dukes
ate variables as True or False without a verbose test. e.g.: while not understand_problem: study("textbook") complete("homework") if want_help: study("http://www.catb.org/~esr/faqs/smart-questions.html";) Just fyi... -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-02-17 Thread Josh Dukes
ve. > > In any case, your project sounds interesting, and I'll > be happy to discuss ideas if you want. > -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-02-18 Thread Josh Dukes
cy. Another interesting project is FreeCAD, which is written in C++ but compiled against python, http://juergen-riegel.net/FreeCAD/Docu/index.php?title=Main_Page might be worth looking at. I look forward to joining your mailing list. On Wed, 18 Feb 2009 01:02:22 -0800 (PST) r wrote: > Hel

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-03-17 Thread Josh Dukes
any legal standing. On Thu, 5 Mar 2009 08:15:44 + (UTC) jelle feringa wrote: > > Hi Josh, > > > http://www.pythonocc.org/ However, I'm > > not entirely clear on the license for this so that might be an > > issue. > > We're using a French licen

Re: How to do this in Python?

2009-03-17 Thread Josh Holland
ore like C than pseudocode to me... Someone's been spending far too much time on C-like languages, if that's what your idea of simply readable code looks like. Thank heavens you found Python before it was too late! -- Josh Holland http://joshh.co.uk madmartian on irc.freenode.net

Re: Where's the documentation to support the following behavior...

2009-03-17 Thread Josh Holland
strings that look like identifiers and small integers. This has been discussed here a lot; have a look at the archives. -- Josh Holland http://joshh.co.uk madmartian on irc.freenode.net -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-03-18 Thread Josh Dukes
> VNC style remote control of other seats of the same software so parts > can be discussed with ease over the phone etc. It seems like project verse would be really cool to have for this. http://verse.blender.org/ -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/li

Re: How to do this in Python?

2009-03-21 Thread Josh Holland
y reply (about his pseudocode looking like C), I hope you realise that it was tongue-in-cheek. For the record, I intend to learn C in the near future and know it is a very powerful language. How people would write a kernel in Python? -- Josh Holland http://joshh.co.uk madmartian on irc.freenode.

Re: How to do this in Python?

2009-03-21 Thread Josh Holland
Sorry, I meant to write "How *many* people ..." -- Josh Holland http://joshh.co.uk madmartian on irc.freenode.net -- http://mail.python.org/mailman/listinfo/python-list

iteration without storing a variable

2009-03-25 Thread Josh Dukes
s essentially zero cost (sound right?). $ time python -c 'for r in xrange(100): pass' real0m0.210s user0m0.210s sys 0m0.000s $ time ruby -e '100.times { }' real0m0.259s user0m0.250s sys 0m0.000s Anyone see anything I missed? Any additional info? Anyone get different results? -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: iteration without storing a variable

2009-03-25 Thread Josh Dukes
I was more talking about the speed differences between ruby and python. On Wed, 25 Mar 2009 20:13:13 +0100 Stefan Behnel wrote: > Josh Dukes wrote: > > $ time python -c 'a = "A"; > > for r in xrange(10): a += "A" ' > > > > real0m0.

Re: What way is the best to check an empty list?

2009-03-25 Thread Josh Dukes
Go to > http://messenger.yahoo.com/invite/ -- > http://mail.python.org/mailman/listinfo/python-list -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Find duplicates in a list and count them ...

2009-03-26 Thread Josh Dukes
8): > > > l.append(randint(0,10)) > > ^^^ > > should have been: > > l.append(randint(0,9)) > > Or even: > > l = [randint(0,9) for x in xrange(8)] > -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting Binary content in files

2009-03-31 Thread Josh Dukes
thon > script that will tell me whether the file is binary), so any pointers > will be appreciated. > > Thanks, > Ritu > -- > http://mail.python.org/mailman/listinfo/python-list -- Josh Dukes MicroVu IT Department -- http://mail.python.org/mailman/listinfo/python-list

Re: Detecting Binary content in files

2009-03-31 Thread Josh Dukes
s/if ord(b) > 127/if ord(b) > 127 or ord(b) < 32/ On Tue, 31 Mar 2009 10:19:44 -0700 Josh Dukes wrote: > There might be another way but off the top of my head: > > #!/usr/bin/env python > > def isbin(filename): >fd=open(filename,'rb') >for

Re: Detecting Binary content in files

2009-03-31 Thread Josh Dukes
', '/etc/passwd']: print "%s is binary: " %f, isbin(f) whatever... basically it's what everyone else said, every file is binary so it all depends on your definitiion of binary. On Tue, 31 Mar 2009 10:23:51 -0700 Josh Dukes wrote: > s/if ord(b) > 127/if ord(b

Collections.py -- any help?

2009-04-24 Thread Josh English
In my quest to learn more, I've been trying to get the collections.py module to do anything but look cool. So far, it's only a cool idea. How do they work? I can't find a tutorial on the web anywhere explaining how I would use them in my code. Any clues? Josh -- http://mail.pyt

Re: Collections.py -- any help?

2009-04-24 Thread Josh English
Sorry, I was referring to the abstract base classes defined there... mea culpa. I didn't get out of my head while posting. Josh On Apr 24, 4:15 pm, Jerry Hill wrote: > On Fri, Apr 24, 2009 at 6:56 PM, Josh English > > > Doug Hellmann wrote an article on the collections module

Re: learning unit testing in python

2008-06-23 Thread Josh English
A good starting point is Mark Pilgrim's Dive Into Python. http://www.diveintopython.org/unit_testing/index.html Josh On Jun 23, 7:55 am, Alex <[EMAIL PROTECTED]> wrote: > Hi all. > > I'd like learn some basic unit testing with python. > I red some articles about diff

Where is the correct round() method?

2008-07-27 Thread josh logan
Hello, I need a round function that _always_ rounds to the higher integer if the argument is equidistant between two integers. In Python 3.0, this is not the advertised behavior of the built-in function round() as seen below: >>> round(0.5) 0 >>> round(1.5) 2 >>> round(2.5) 2 I would think this

Re: Where is the correct round() method?

2008-07-27 Thread josh logan
On Jul 27, 7:58 pm, Gary Herron <[EMAIL PROTECTED]> wrote: > josh logan wrote: > > Hello, > > > I need a round function that _always_ rounds to the higher integer if > > the argument is equidistant between two integers. In Python 3.0, this > > is not the

Re: Where is the correct round() method?

2008-07-27 Thread josh logan
On Jul 27, 8:45 pm, pigmartian <[EMAIL PROTECTED]> wrote: > it could be that 3.0 is using "banker's rounding" --- rounding to the > even digit.  the idea behind it behind it being to reduce error > accumulation when working with large sets of values. > > > Works for me on Python 2.5 on Linux runnin

Re: Concise way to format list/array to custom(hex) string

2008-08-02 Thread josh logan
On Aug 2, 9:29 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-08-02, Zoltán Nagy <[EMAIL PROTECTED]> wrote: > > > > > > > Kurien Mathew írta: > >> Hello, > > >> What will be a concise & efficient way to convert a list/array.array of > >> n elements into a hex string? For e.g. given the byte

Re: Python + Some sort of Propel + Creole

2008-08-12 Thread Josh Bloom
http://sqlobject.org/ http://www.sqlalchemy.org/ Django's built in ORM is also quite good for web development tasks. -josh On Tue, Aug 12, 2008 at 3:18 PM, Samuel Morhaim <[EMAIL PROTECTED]>wrote: > Hi, I come from an extensive background developing webapps with Symfony...

Re: negative numbers are not equal...

2008-08-14 Thread Josh English
On Aug 14, 1:18 pm, ariel ledesma <[EMAIL PROTECTED]> wrote: > hello guys > > i just ran into this when comparing negative numbers, they start > returning False from -6 down, but only when comparing with 'is' > >  >>> m = -5 >  >>> a = -5 >  >>> m is a > True >  >>> m = -6 >  >>> a = -6 >  >>> m is

Re: How to ignore the first line of the text read from a file

2008-08-30 Thread josh logan
On Aug 28, 3:47 am, Santiago Romero <[EMAIL PROTECTED]> wrote: > > I want to read text line-by-line from a text file, but want to ignore > > only the first line. I know how to do it in Java (Java has been my > > primary language for the last couple of years) and following is what I > > have in Pyth

Re: How to check is something is a list or a dictionary or a string?

2008-08-30 Thread josh logan
But this changes with Python 3, right? On Aug 30, 7:15 am, Ken Starks <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > On Aug 29, 12:16 pm, [EMAIL PROTECTED] wrote: > >> Hi, > > >> How to check if something is a list or a dictionary or just a string? > >> Eg: > > >> for item in self.__libVerD

SAXReaderNotAvailble: No parsers found

2008-08-30 Thread josh logan
> Vincent Yau <[EMAIL PROTECTED]> writes: > > I am trying to use Python SAX API to parse XML files. I do see expat.py > > somewhere underneath my Python 2.1.1 installation (on Solaris). > > But I got this error when invoking the xml.sax.make_parser() call. Any > > tip/help much appreciated. > > Y

Python 3.0b2 cannot map '\u12b'

2008-08-31 Thread josh logan
Hello, I am using Python 3.0b2. I have an XML file that has the unicode character '\u012b' in it, which, when parsed, causes a UnicodeEncodeError: 'charmap' codec can't encode character '\u012b' in position 26: character maps to This happens even when I assign this character to a reference in t

Re: Python 3.0b2 cannot map '\u12b'

2008-09-01 Thread josh logan
On Sep 1, 8:19 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 01 Sep 2008 02:27:54 -0400, Terry Reedy wrote: > > I doubt the OP 'chose' cp437.  Why does Python using cp437 even when the > > default encoding is utf-8? > > > On WinXP > >  >>> sys.getdefaultencoding() > > 'utf-8' >

<    1   2   3   >