Re: surprise - byte in set

2015-01-03 Thread Jason Friedman
sys.version > '3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit > (Intel)]' 'b' in 'abc' > True b'b' in b'abc' > True 'b' in set('abc') > True b'b' in set(b'abc') > False > > I was surprised by the last result. What happened? > (Examples simplified; I w

Re: Begginer Question , what i need for web app and site

2015-01-09 Thread Jason Friedman
> Hello all > coming from java and c++ now going with python > what setup do i need to run full python stack for web application . > what i need is web framework and back-end . > what usually be in the java world tomcat and servlets or jsp and pure java > backend for processing data . > what will

Re: Array of hash table

2015-01-12 Thread Jason Friedman
>Can any one tell me how to create >graph={ > "nodes": [ > { > "id": "n0", > "label": "A node", > "x": 0, [ ... elided ... ] > } > ] > } Taking a guess and guessing that graphviz might be useful for you: https://code.google.com/p/pydot/. -- https://mail.pyth

Python 3 regex?

2015-01-12 Thread Jason Bailey
Hi all, I'm working on a Python _3_ project that will be used to parse ISC DHCPD configuration files for statistics and alarming purposes (IP address pools, etc). Anyway, I'm hung up on this one section and was hoping someone could provide me with some insight. My script first reads the DHCP

Python 3 regex woes (parsing ISC DHCPD config)

2015-01-12 Thread Jason Bailey
Hi all, I'm working on a Python _3_ project that will be used to parse ISC DHCPD configuration files for statistics and alarming purposes (IP address pools, etc). Anyway, I'm hung up on this one section and was hoping someone could provide me with some insight. My script first reads the DHCP

Re: Track down SIGABRT

2015-01-12 Thread Jason Friedman
> I have a long-running python/CherryPy Web App server process that I am > running on Mac OS X 10.8.5. Python 2.7.2 running in 32-bit mode (for now, I > have the code in place to change over to 64 bit, but need to schedule the > downtime to do it). On the 6th of this month, during normal operation

Re: Hello World

2015-01-18 Thread Jason Friedman
> > > Password maximum age is the wrong solution to a few problems, and is > itself a problem. Don't do it. > > Bruce Schneier (mostly) agrees with you: https://www.schneier.com/blog/archives/2010/11/changing_passwo.html. -- https://mail.python.org/mailman/listinfo/python-list

Re: Storing dataset from Condtional FreqDist

2015-01-19 Thread Jason Friedman
> Hello i have trying to store information in arff file but i has been really. > Any ideas of how can i do that? > > > with open('fileids3.txt', 'r') as f: > > genres=[word.strip() for word in f.next().split(',')] > > with open('adjectifs2.txt', 'r') as g: > adj = [word.strip() for

Check for running DHCP daemon?

2015-01-21 Thread Jason Bailey
So I've got this python 3 script that needs to know if there is a running DHCP daemon (ISC DHCP server) on the local system. Is there a clean way to do this that (1) doesn't require me to do syscalls to local utilities (like ps, top, etc), and (2) doesn't require any custom modules (stock only)

Re: Check for running DHCP daemon?

2015-01-21 Thread Jason Bailey
How would I get a list of running processes with the subprocess module? The documentation wasn't clear to me. On Jan 21, 2015 7:21 PM, Dan Stromberg wrote: On Wed, Jan 21, 2015 at 3:06 PM, Jason Bailey wrote: > So I've got this python 3 script that needs to know if there is a r

Re: Check for running DHCP daemon?

2015-01-23 Thread Jason Bailey
shouldn't have). Can anyone steer me in the right direction on port status? Jason Bailey Network Technician Emery Telcom Office: (435) 636-0052 jbai...@emerytelcom.com On 01/21/2015 09:39 PM, Chris Angelico wrote: On Thu, Jan 22, 2015 at 2:58 PM, Jason Bailey wrote: How would I get a

Re: Check for running DHCP daemon?

2015-01-23 Thread Jason Bailey
Is there a way to do it without calling external utilities (i.e. a Python module, etc)? I'd rather stay within the realm of Python if possible. Jason On 01/23/2015 10:04 AM, Chris Angelico wrote: On Sat, Jan 24, 2015 at 3:02 AM, Jason Bailey wrote: I'm actually wondering if i

Re: Create dictionary based of x items per key from two lists

2015-01-31 Thread Jason Friedman
> I have two lists > > l1 = ["a","b","c","d","e","f","g","h","i","j"] > l2 = ["aR","bR","cR"] > > l2 will always be smaller or equal to l1 > > numL1PerL2 = len(l1)/len(l2) > > I want to create a dictionary that has key from l1 and value from l2 based on > numL1PerL2 > > So > > { > a:aR, > b:aR, >

What behavior would you expect?

2015-02-18 Thread Jason Friedman
I have need to search a directory and return the name of the most recent file matching a given pattern. Given a directory with these files and timestamps, q.pattern1.abc Feb 13 r.pattern1.cdf Feb 12 s.pattern1.efg Feb 10 t.pattern2.abc Feb 13 u.pattern2.xyz Feb 14 v.pattern2.efg Feb 10 calli

Re: A question about how plot from matplotlib works

2015-02-19 Thread Jason Swails
ctive functions (like dir() and id()) and "help" function in the interpreter, I rarely have to consult StackOverflow or even the API documentation online to do what I need. For instance, you want to change the color or thickness of the error bar hats on error bars in your plot? Either sa

Re: What behavior would you expect?

2015-02-19 Thread Jason Friedman
I have need to search a directory and return the name of the most recent file matching a given pattern. Given a directory with these files and timestamps, > > q.pattern1.abc Feb 13 > r.pattern1.cdf Feb 12 > s.pattern1.efg Feb 10 > t.pattern2.abc Feb 13 > u.pattern2.xyz Feb 14 > v.pattern2.efg

Re: What behavior would you expect?

2015-02-19 Thread Jason Friedman
> def order_matching_files(a_path, a_glob="*"): > """Search a path for files whose names match a_glob > and return a list of the full path to such files, in descending > order of modification time. Ignore directories.""" > previous_dir = os.getcwd() > os.chdir(a_path) > retu

Re: What behavior would you expect?

2015-02-19 Thread Jason Friedman
I think I came in a little late, and saw "2. no files match the given > pattern," in which case I'm sticking to my story and returning an empty > list. > > The original problem was "to search a directory and return the name of > the most recent file matching a given pattern." I'd still prefer an >

Re: What behavior would you expect?

2015-02-19 Thread Jason Friedman
> > I'd still advise using my_list.sort() rather than sorted(), as you > don't need to retain the original. > > Hmm. Trying to figure out what that looks like. If I understand correctly, list.sort() returns None. What would I return to the caller? > If you're going to call listdir, you probably

Re: What behavior would you expect?

2015-02-22 Thread Jason Friedman
> If you're going to call listdir, you probably want to use fnmatch directly. > > fnmatch seems to be silent on non-existent directories: python -c 'import fnmatch; fnmatch.fnmatch("/no/such/path", "*")' -- https://mail.python.org/mailman/listinfo/python-list

Re: Parallelization of Python on GPU?

2015-02-26 Thread Jason Swails
ed. If you're worried about performance, you get at least an order of magnitude performance boost by going to numpy or writing the kernel directly in C or Fortran. CPython itself just isn't structured to run on a GPU... maybe pypy will tackle that at some point in the probably-distant future. All the best, Jason -- Jason M. Swails BioMaPS, Rutgers University Postdoctoral Researcher -- https://mail.python.org/mailman/listinfo/python-list

Re: Parallelization of Python on GPU?

2015-02-26 Thread Jason Swails
e past 6 years through the introduction of GPU computing and improvements in GPU hardware. All the best, Jason -- Jason M. Swails BioMaPS, Rutgers University Postdoctoral Researcher -- https://mail.python.org/mailman/listinfo/python-list

Re: How to extract contents of inner text of html tag?

2014-03-08 Thread Jason Friedman
> for line in all_kbd: >if line.string == None: I modified your code slightly: for line in all_kbd: print(line) sys.exit() if line.string == None: Running the new script yields: $ python shibly.py cp -v --remove-destination /usr/share/zoneinfo/ \ /etc/localtim

Re: writing reading from a csv or txt file

2014-03-30 Thread Jason Friedman
> > I am trying to compare the files. cutting out items in list list. ie:- > first file (rainfall2012.csv)rainfall, duration,time of day,wind > speed,date. > first file (rainfall2013.csv)rainfall, duration,time of day,wind > speed,date. > I would like to pick out maybe rainfalls and duration's and

Re: realtime plot

2014-04-01 Thread Jason Friedman
> > I want to plot serial data from Arduino by Chaco. Could you help me and > guide me about that. > I found this: http://www.blendedtechnologies.com/realtime-plot-of-arduino-serial-data-using-python/231 . -- https://mail.python.org/mailman/listinfo/python-list

Re: writing reading from a csv or txt file

2014-04-01 Thread Jason Friedman
> > Hi jason thanks for replying.Below is a typical file return.To you I've no > doubt this is a simple problem but,to a beginner like me it just seems I > lack the understanding of how to split out the items in a list.Thanks again > for looking at it. > Rainfall,duration,T

Re: Switching between cmd.CMD instances

2014-04-02 Thread Jason Swails
onCmd(self) subcmd.cmdloop() if self.exit_on_return: return True Untested and incomplete, but you get the idea. HTH, Jason -- Jason M. Swails BioMaPS, Rutgers University Postdoctoral Researcher -- https://mail.python.org/mailman/listinfo/python-list

Re: [OFF-TOPIC] How do I find a mentor when no one I work with knows what they are doing?

2014-04-08 Thread Jason Swails
e you become more experienced and knowledgeable about the project you've chosen, you can start contributing back to it. Everybody wins. At least I've learned a lot doing that. Good luck, Jason -- https://mail.python.org/mailman/listinfo/python-list

Common issue but unable to find common solution (ez_setup.py on PC)

2014-05-07 Thread Jason Mellone
dist.run_commands() File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "c:\docume~1\jason\locals~1\temp\tmpqpn4qe\setuptools-3.5.1\setu

Re: Common issue but unable to find common solution (ez_setup.py on PC)

2014-05-07 Thread Jason Mellone
On Wednesday, May 7, 2014 9:44:14 AM UTC-4, Jurko Gospodnetić wrote: > Hi. > > > > On 7.5.2014. 13:55, Jason Mellone wrote: > > > By way of google I realize I am having what appears to be > > > a pretty common issue install ez_setup.py on a PC (Windows XP, P

Re: Adding R squared value to scatter plot

2014-05-21 Thread Jason Swails
tp://matplotlib.org/1.3.1/users/text_intro.html(information specifically regarding the text call is here: http://matplotlib.org/1.3.1/api/pyplot_api.html#matplotlib.pyplot.text) You can also use LaTeX typesetting here, so you can make the text something like r'$R^2$' to display R^2 with "nice" typesetting. (I typically use raw strings for matplotlib text strings with LaTeX formulas in them since LaTeX makes extensive use of the \ character.) The onus is on you, the programmer, to determine _where_ on the plot you want the text to appear. Since you know what you are plotting, you can write a quick helper function that will compute the optimal (to you) location for the label to occur based on where things are drawn on the canvas. There is a _lot_ of flexibility here so you should be able to get your text looking exactly how (and where) you want it. Hope this helps, Jason -- Jason M. Swails BioMaPS, Rutgers University Postdoctoral Researcher -- https://mail.python.org/mailman/listinfo/python-list

Elegant compare

2013-08-10 Thread Jason Friedman
class my_class: def __init__(self, attr1, attr2): self.attr1 = attr1 #string self.attr2 = attr2 #string def __lt__(self, other): if self.attr1 < other.attr1: return True else: return self.attr2 < other.attr2 I will run into problems i

Re: Elegant compare

2013-08-11 Thread Jason Friedman
> This is a hard question to answer, because your code snippet isn't > clearly extensible to the case where you have ten attributes. What's the > rule for combining them? If instance A has five attributes less than > those of instance B, and five attributes greater than those of instance > B, which

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-12 Thread Jason Friedman
>>> I've always wondered if the 160 character limit or whatever it is is a >>> hard limit in their system, or if it's just a variable they could tweak >>> if they felt like it. I thought it was 140 characters? https://twitter.com/about -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 450 Adding a statistics module to Python

2013-08-17 Thread Jason Friedman
> NumPy and SciPy are not available for many Python users, including those > using a Python implementation for which there is no Numpy support > http://new.scipy.org/faq.html#python-version-support> and those for > whom large, dependency-heavy third-party packages are too much burden. > > See the R

Re: Python and mysql 3 tier programming

2013-08-23 Thread Jason Friedman
> System Debian Wheezy Linux > Python 2.7 > Mysql 5.5.31 > Apache Server > > I am somewhat conversant with html, css, SQL, mysql, Apache and Debian > Linux. Actually I have been using Debian for over 10 year. I spent over 5 > year, prior to retirement, programming database based applications in > F

Weighted choices

2013-09-07 Thread Jason Friedman
choices = dict() choices["apple"] = 10 choices["pear"] = 20 choices["banana"] = 15 choices["orange"] = 25 choices["kiwi"] = 30 I want to pick sets of fruit, three in a set, where the chance of selecting a given fruit is proportional to its weight. In the example above, pears should appear twice a

Re: Weighted choices

2013-09-09 Thread Jason Friedman
>> I coach a flag football team of 11-year-olds. A stated goal of the >> league is that every player should get nearly equal playing time and >> that winning is of secondary importance. That said, some players just >> can't throw the ball at all, and having a quarterback who cannot throw >> is no

Re: How to make Tkinter Listbox entry insensitive?

2013-10-10 Thread Jason Swails
e proper callbacks that implement various actions of your custom widgets using what Tkinter is capable of doing. Personally I prefer to subclass Frame since it allows me the maximum flexibility (I think 90+% of the widgets I've written for my own Tkinter-based programs do this). A

Inter-process locking

2013-10-11 Thread Jason Friedman
I have a 3rd-party process that runs for about a minute and supports only a single execution at a time. $ deploy If I want to launch a second process I have to wait until the first finishes. Having two users wanting to run at the same time might happen a few times a day. But, these users will n

OT: looking for best solutions for tracking projects and skills

2013-10-11 Thread Jason Hsu
I realize this is off-topic, but I'm not sure what forum is best for asking about this. I figure that at least a few of you are involved in civic hacking groups. I recently joined a group that does civic hacking. (Adopt-A-Hydrant is an example of civic hacking.) We need a solution for trackin

Re: Inter-process locking

2013-10-12 Thread Jason Friedman
The lockfile solution seems to be working, thank you. On Fri, Oct 11, 2013 at 10:15 PM, Piet van Oostrum wrote: > Jason Friedman writes: > >> I have a 3rd-party process that runs for about a minute and supports >> only a single execution at a time. >> >> $ depl

Re: OT: looking for best solutions for tracking projects and skills

2013-10-13 Thread Jason Friedman
I highly recommend JIRA, free for non-profit use: https://www.atlassian.com/software/jira. On Fri, Oct 11, 2013 at 9:09 PM, Jason Hsu wrote: > I realize this is off-topic, but I'm not sure what forum is best for asking > about this. I figure that at least a few of you are involv

Re: Inter-process locking

2013-10-18 Thread Jason Friedman
> There is one caveat, however. If a process that has the lock crashes without > releasing the lock, the lock file will stay around and prevent other > processes to acquire it. Then you will have to manually remove it. I > generally prefer a solution where the pid of the locking process is writt

Mail client wrapping

2013-10-29 Thread Jason Friedman
I am receiving lines like this: Accordingly, this element has largely given way in modern cases to a less = rigid formulation: that the evidence eliminates, to a sufficient degree, = other responsible causes (including the conduct of the plaintiff and third= parties). For example, in New York Sta

Re: Debugging decorator

2013-11-03 Thread Jason Friedman
y", line 3, in @debugger.debugging File "/home/jason/python/debugger.py", line 41, in debugging new_function_body.append(make_print_node("function %s called" % func.__name__)) File "/home/jason/python/debugger.py", line 6, in make_print_node return as

Re: Parsing multiple lines from text file using regex

2013-11-03 Thread Jason Friedman
> Hi, > I am having an issue with something that would seem to have an easy > solution, but which escapes me. I have configuration files that I would > like to parse. The data I am having issue with is a multi-line attribute > that has the following structure: > > banner > Banner text > Banner

Re: Building C++ modules for python using GNU autotools, automake, whatever

2015-02-26 Thread Jason Swails
me way as a *.so? To libtool, yes... provided that you *also* have the .so with the same base name as the .la. I don't think compilers themselves make any use of .la files, though. HTH, Jason -- Jason M. Swails BioMaPS, Rutgers University Postdoctoral Researcher -- https://mail.python.org/mailman/listinfo/python-list

Re: Parallelization of Python on GPU?

2015-02-26 Thread Jason Swails
worked around, but the frequent GPU->CPU xfers involved if you can't fit everything on the GPU can be painstaking to limit its potentially devastating effects on performance. > > For Python the easiest solution is to use Numba Pro. Agreed, although I've never actually tried PyCUDA

Re: Parallelization of Python on GPU?

2015-02-26 Thread Jason Swails
On Thu, Feb 26, 2015 at 4:10 PM, Sturla Molden wrote: > On 26/02/15 18:48, Jason Swails wrote: > >> On Thu, 2015-02-26 at 16:53 +, Sturla Molden wrote: >> >>> GPU computing is great if you have the following: >>> >>> 1. Your data structures ar

Re: requesting you all to please guide me , which tutorials is best to learn redis database

2015-02-27 Thread Jason Friedman
> i want to learn redis database and its use via python , please guide me > which tutorials i should be study, so that i can learn it in good way How about https://pypi.python.org/pypi/redis/? -- https://mail.python.org/mailman/listinfo/python-list

Re: Sort list of dictionaries

2015-03-02 Thread Jason Friedman
>> This is what I was trying but LooseVersion() was not sorting version numbers >> like I thought it would. You will notice that Chrome version "40.0.2214.111" >> is higher than "40.0.2214.91" but in the end result it's not sorting it that >> way. > > Because it's a string they're sorted lexicog

Re: Sort list of dictionaries

2015-03-03 Thread Jason Friedman
On Tue, Mar 3, 2015 at 12:07 AM, Chris Angelico wrote: > Heh, I think that mght be a bit abusive :) I'm not sure that > you want to depend on the version numbers fitting inside the rules for > IP addresses, especially given that the example has a component of > "2214". > Indeed, I was mi

Append a file

2015-03-06 Thread Jason Venneri
Hello, I'm using the urllib.urlretrieve command to retrieve a couple of lines of data. I want to combine the two results into one file not two. Any suggestions? Sample urllib.urlretrieve('http://www.airplanes.com/data/boeing1.html','B747A.txt') urllib.urlretrieve('http://www.airplanes.com/dat

Re: Append a file

2015-03-06 Thread Jason Friedman
On Fri, Mar 6, 2015 at 2:55 PM, Jason Venneri wrote: > Hello, I'm using the urllib.urlretrieve command to retrieve a couple of lines > of data. I want to combine the two results into one file not two. > > Any suggestions? > > Sample > urllib.urlretrieve('http:/

Re: Adding a 'struct' into new python type

2015-03-07 Thread Jason Swails
es, like char, double, float, int, and long into their Python equivalents; but it can't handle something as potentially complicated as an arbitrary struct. Of course, if all you want to do is access t1 from C, then I think what you have is fine. ​Good luck, Jason -- https://mail.python.org/mailman/listinfo/python-list

Re: Append a file

2015-03-08 Thread Jason Venneri
Jason; Thank you for your response. I’m just starting out with Python and the tutorials I have done are on 2.7.9. I will looking on to python3. It is preloaded on Mac :-). Jason ___ jv92...@gmail.com 619-227-0927 > On Mar 6, 2015, at 9:37 PM, Jason Fried

Module/lib for controlling a terminal program using redrawing?

2015-03-14 Thread Jason Heeris
e both fine, external packages are fine, but it has to work on Linux (eg. Ubuntu 14.04 or later, Debian Wheezy or later). Any pointers appreciated. Cheers, Jason -- https://mail.python.org/mailman/listinfo/python-list

Re: Module/lib for controlling a terminal program using redrawing?

2015-03-14 Thread Jason Heeris
ream (a 24 x 80 array) on the screen. Searching 'python terminal emulation' returns these Thanks for those results. I also discovered that someone wrote a Python ANSI terminal scraper originally for use with Nethack: https://github.com/helgefmi/ansiterm (although it seems generic en

Setuptools: no module named 'html.entities'

2015-03-15 Thread Jason Friedman
Hello, This is Python 3.3.2 on Linux. I downloaded Setuptools ( https://pypi.python.org/packages/source/s/setuptools/setuptools-14.3.tar.gz), exploded the tarball, and I get: python setup.py build Traceback (most recent call last): File "", line 1521, in _find_and_load_unlocked AttributeError:

Re: Setuptools: no module named 'html.entities'

2015-03-16 Thread Jason Friedman
On Mon, Mar 16, 2015 at 7:10 AM, Wolfgang Maier < wolfgang.ma...@biologie.uni-freiburg.de> wrote: > On 03/16/2015 12:53 AM, Jason Friedman wrote: > >> Hello, >> >> This is Python 3.3.2 on Linux. >> I downloaded Setuptools >> (https://pypi.python.org/p

Re: Python+Glade+Gtk tutorial?

2015-03-16 Thread Jason Heeris
you learn the lesson that it's not going to give you 100% control over your UI — there are some things you are better off doing in your app setup code. And yes, I'd recommend ignoring anything labelled PyGTK. — Jason -- https://mail.python.org/mailman/listinfo/python-list

Re: Brilliant or insane code?

2015-03-18 Thread Jason Swails
0 loops, best of 3: 307 µs per loop So the iter-magic is really about 10-100x slower than an equivalent numpy (and 1x slower than an optimized numpy) variant, and only ~2x faster than the more explicit option. But it's still a nice trick (and one I may make use of in the future :)). Th

Re: Best way to calculate fraction part of x?

2015-03-24 Thread Jason Swails
On Mon, Mar 23, 2015 at 8:38 PM, Emile van Sebille wrote: > On 3/23/2015 5:52 AM, Steven D'Aprano wrote: > > Are there any other, possibly better, ways to calculate the fractional >> part >> of a number? >> > > float (("%6.3f" % x)[-4:]) ​In general you lose a lot of precision this way...​ --

Re: How to deploy a custom common module?

2015-05-16 Thread Jason Friedman
> When I deploy test.py on another computer, I put (rsync) both test.py and > cmn_funcs.py in the same remote directory. > > If I create another python project (test2.py) in new directory, that needs > common functions, what should I do with cmn_funcs.py? I put my shared code in a separate folde

decorators and alarms

2015-05-22 Thread Jason Friedman
I have the following code to run a shell command and kill it if it does not return within a certain amount of time: def run_with_time_limit(command, limit): """Run the given command via a shell. Kill the command, and raise an exception, if the execution time exceeds seconds. Else

Re: decorators and alarms

2015-05-22 Thread Jason Friedman
> But, I'd like to expand this to take some generic code, not just a > shell command, and terminate it if it does not return quickly. > > @time_limiter > def generic_function(arg1, arg2, time_limit=10): > do_some_stuff() > do_some_other_stuff() > return val1, val2 > > If generic_functio

Re: What is considered an "advanced" topic in Python?

2015-05-29 Thread Jason Swails
n Py3 than they are in Py2).​ ​ They are cool ideas, and I've used them in my own code, but they do have a kind of magic-ness to them -- especially in codes that you didn't write but are working on. As a result, I've recently started to prefer alternatives, but in some rare cases (like Enum, for example), they are just the best solution. All the best, Jason -- https://mail.python.org/mailman/listinfo/python-list

Re: Memory error while using pandas dataframe

2015-06-10 Thread Jason Swails
l "seek(0)" on that instead. That might work. Otherwise, you should be more specific with your question and provide a full segment of code that is as small as possible to reproduce the error you're seeing. HTH, Jason -- https://mail.python.org/mailman/listinfo/python-list

Classic OOP in Python

2015-06-17 Thread Jason P.
Hello Python community. I come from a classic background in what refers to OOP. Mostly Java and PHP (> 5.3). I'm used to abstract classes, interfaces, access modifiers and so on. Don't get me wrong. I know that despite the differences Python is fully object oriented. My point is, do you know an

Re: Classic OOP in Python

2015-06-18 Thread Jason P.
El miércoles, 17 de junio de 2015, 21:44:51 (UTC+2), Ned Batchelder escribió: > On Wednesday, June 17, 2015 at 3:21:32 PM UTC-4, Jason P. wrote: > > Hello Python community. > > > > I come from a classic background in what refers to OOP. Mostly Java and PHP > > (&

Re: Classic OOP in Python

2015-06-18 Thread Jason P.
El miércoles, 17 de junio de 2015, 21:44:51 (UTC+2), Ned Batchelder escribió: > On Wednesday, June 17, 2015 at 3:21:32 PM UTC-4, Jason P. wrote: > > Hello Python community. > > > > I come from a classic background in what refers to OOP. Mostly Java and PHP > > (&

Re: Classic OOP in Python

2015-06-18 Thread Jason P.
El miércoles, 17 de junio de 2015, 22:39:31 (UTC+2), Marko Rauhamaa escribió: > Ned Batchelder : > > > TDD is about writing tests as a way to design the best system, and > > putting testing at the center of your development workflow. It works > > great with Python even without interfaces. > > I

Re: Bug in floating point multiplication

2015-07-02 Thread Jason Swails
hs.c swails@batman ~/test $ ./a.out swails@batman ~/test $ gcc -m32 maths.c swails@batman ~/test $ ./a.out 2049 That this happens at the C level in 32-bit mode is highly suggestive, I think, since I believe these are the actual machine ops that CPython float maths execute under the hood. All the best, Jason -- https://mail.python.org/mailman/listinfo/python-list

Re: Bug in floating point multiplication

2015-07-03 Thread Jason Swails
On Fri, Jul 3, 2015 at 11:13 AM, Oscar Benjamin wrote: > On 2 July 2015 at 18:29, Jason Swails wrote: > > > > As others have suggested, this is almost certainly a 32-bit vs. 64-bit > > issue. Consider the following C program: > > > > // maths.h > > #

Re: Should iPython Notebook replace Idle

2015-07-03 Thread Jason Swails
trictions on a library. If the IPython team agreed to release their tools with the stdlib instead of IDLE, they'd have to give up a lot of control over their project: - License - Release schedule - Development environment Everything gets swallowed into Python. I can't imagine this ever

Re: Bug in floating point multiplication

2015-07-06 Thread Jason Swails
On Mon, Jul 6, 2015 at 11:44 AM, Oscar Benjamin wrote: > On Sat, 4 Jul 2015 at 02:12 Jason Swails wrote: > >> On Fri, Jul 3, 2015 at 11:13 AM, Oscar Benjamin < >> oscar.j.benja...@gmail.com> wrote: >> >>> On 2 July 2015 at 18:29, Jason Swails wrote: >

Re: bottle app "crashes"

2015-07-06 Thread Jason Friedman
> Last summer I fumbled together a small appplication that calculates both LASK > and Elo ratings for chess. I managed to "webify" it using Bottle. This works > nicely on my laptop for testing. > > Once I log off (or my user session times out) my server where I've started the > application with pyt

Noob in Python. Problem with fairly simple test case

2015-07-15 Thread Jason P.
Hi all! I'm working in a little Python exercise with testing since the beginning. So far I'm with my first end to end test (not even finished yet) trying to: 1) Launch a development web server linked to a demo app that just returns 'Hello World!' 2) Make a GET request successfully I can't un

linux os.rename() not an actual rename?

2015-07-20 Thread Jason H
I have a server process that looks (watches via inotify) for files to be moved (renamed) into a particular directory from elsewhere on the same filesystem. We do this because it is an atomic operation, and our server process can see the modify events of the file being written before it is close

Re: linux os.rename() not an actual rename?

2015-07-20 Thread Jason H
> From: "Christian Heimes" > On 2015-07-20 20:50, Marko Rauhamaa wrote: > > "Jason H" : > > > >> I have a server process that looks (watches via inotify) for files to > >> be moved (renamed) into a particular directory from elsewhere

Re: Noob in Python. Problem with fairly simple test case

2015-07-21 Thread Jason P.
El miércoles, 15 de julio de 2015, 14:12:08 (UTC+2), Chris Angelico escribió: > On Wed, Jul 15, 2015 at 9:44 PM, Jason P. wrote: > > I can't understand very well what's happening. It seems that the main > > thread gets blocked listening to the web server. My intent

Address field [was: Integers with leading zeroes]

2015-07-21 Thread Jason Friedman
> Of course, most of the > time, I advocate a single multi-line text field "Address", and let > people key them in free-form. No postcode field whatsoever. I'm curious about that statement. I could see accepting input as you describe above, but I'm thinking you'd want to *store* a postcode field.

Re: Should non-security 2.7 bugs be fixed?

2015-07-22 Thread Jason Swails
#x27;t switch" are not only wrong, but in actuality counter-productive. Apologies for the novel, Jason On Sat, Jul 18, 2015 at 7:36 PM, Terry Reedy wrote: > I asked the following as an off-topic aside in a reply on another thread. > I got one response which presented a point I had

Re: Is there a way to install ALL Python packages?

2015-07-22 Thread Jason Swails
and even Fortran libraries), conda blows pip out of the water.​ There are other solutions (like Enthought's Canopy distribution, for example), but conda is so nice that I really have little incentive to try others. All the best, Jason -- https://mail.python.org/mailman/listinfo/python-list

Re: How Do I ............?

2015-07-31 Thread Jason Swails
wer your question, then provide enough information so that someone can actually figure out what went wrong ;).​ HTH, Jason -- https://mail.python.org/mailman/listinfo/python-list

Re: problem with netCDF4 OpenDAP

2015-08-13 Thread Jason Swails
URLs are not files and cannot be opened like normal files. netCDF4 *requires* a local file as far as I can tell. All the best, Jason -- Jason M. Swails BioMaPS, Rutgers University Postdoctoral Researcher -- https://mail.python.org/mailman/listinfo/python-list

Re: problem with netCDF4 OpenDAP

2015-08-14 Thread Jason Swails
uffix for some reason (not sure if the server redirected the request there or not). But this looks like a netCDF4 issue. Perhaps you can go to their project page on Github and file an issue there -- they will be more likely to have your answer than people here. HTH, Jason > > an

Re: netcdf read

2015-09-01 Thread Jason Swails
tcdf4' is not defined > > > > > > What can I do to solve this. > > My crystal ball tells me you're probably running Windows. > ​Or Mac OS X. Unless you go out of your way to specify otherwise, the default OS X filesystem is case-insensitive. All the best, Jason -- https://mail.python.org/mailman/listinfo/python-list

Re: Script To Remove Files Made Either By Python Or Git

2015-10-09 Thread Jason Swails
t directory of a git repo (and recursively all subdirectories). You can optionally specify a directory at the end of that command. Careful with this sledgehammer, though, as it will also trash any untracked source code files as well (and you may never get them back). HTH, Jason -- https://mai

Re: Strong typing implementation for Python

2015-10-12 Thread Jason Swails
he most computationally intensive kernels do (which themselves are small portions of the main simulation engines!). Performance only matters when it allows you to do something that you otherwise couldn't. pypy makes some things possible that otherwise wasn't, but there's a reas

Stylistic question regarding no-op code and tests

2015-10-14 Thread Jason Swails
ou are not >100% sure is well-covered in your test suite, but that your first instinct should be to avoid such code. What do you think? Thanks! Jason -- Jason M. Swails BioMaPS, Rutgers University Postdoctoral Researcher -- https://mail.python.org/mailman/listinfo/python-list

Re: Stylistic question regarding no-op code and tests

2015-10-15 Thread Jason Swails
On Wed, Oct 14, 2015 at 10:07 PM, Ben Finney wrote: > Jason Swails writes: > > > What I recently realized, though, that what this construct allows is > > for the coverage testing package (which I have recently started > > employing for my project... thanks Ned and ot

Re: teacher need help!

2015-10-18 Thread Jason Friedman
> Can I suggest you find the turtle.py module in c:\windows\system32, move it > to somewhere more suitable and try the code again? Or, copy it, rather than move it? It may be that for some students turtle.py is in a terrific place already. -- https://mail.python.org/mailman/listinfo/python-list

Re: What is the meaning of Py_INCREF a static PyTypeObject?

2015-11-12 Thread Jason Swails
ing NoddyType from the noddy namespace and Py_DECREFing it. Alternatively, doing import noddy noddy.NoddyType = 10 # rebind the name Then the original object NoddyType was pointing to will be DECREFed and NoddyType will point to an object taking the value of 10. HTH, Jason -- https://mail.python.org/mailman/listinfo/python-list

Re: Matplotlib Colouring outline of histogram

2014-06-20 Thread Jason Swails
This is a large part of what makes matplotlib nice to me -- it has a "simple" mode as well as a predictable API for customizing a plot in almost any way you could possibly want. HTH, Jason -- Jason M. Swails BioMaPS, Rutgers University Postdoctoral Researcher -- https://mail.python.org/mailman/listinfo/python-list

Re: Matplotlib Colouring outline of histogram

2014-06-20 Thread Jason Swails
On Fri, Jun 20, 2014 at 10:27 AM, Jamie Mitchell < jamiemitchell1...@gmail.com> wrote: > > That's great Jason thanks for the detailed response, I went with the > easier option 1! > > I am also trying to put hatches on my histograms like so: > > plt.hist(dataset,

Ubuntu "3" (was Adding thread module support to Ubuntu 3 for Python3)

2014-06-23 Thread Jason Friedman
>> OT and FWIW: I gave up on Ubuntu when they switched to Unity -- I find that >> very awkward to use. Just personal opinion, of course, and I know there are >> others who like it -- that's fine with me as well. (But I switched to >> Mint.) > > Likewise, though with me it was Debian I went to, w

Re: subprocess can not kill when app exit()

2014-06-25 Thread Jason Friedman
> code in below, when close the app window. the two ping process can not kill > auto and keep in the windows 7 task list. > > During running, ping process under Python.exe as two thread. When app exit, > this two process move the system process and keep running there. > > could someone help to

Re: finditer

2014-07-07 Thread Jason Friedman
On Mon, Jul 7, 2014 at 1:19 AM, gintare wrote: > If smbd has time, maybe you could advice how to accomplish this task in > faster way. > > I have a text = """ word{vb} > wordtransl {vb} > > sent1. > > sent1trans. > > sent2 > > sent2trans... """ > > I need to match once wordtransl, and than many t

<    1   2   3   4   5   6   7   8   9   10   >