Re: Cancel threads after timeout

2013-01-27 Thread Jason Ma
nient. Regards, Jason 2013/1/26 hyperboreean > Here's the use case I want to implement - I have to generate a report > from multiple database servers. This report should be generated every 2 > hours. Sometimes it happens that a query on one of the database servers > takes long

Re: Cancel threads after timeout

2013-01-26 Thread Jason Friedman
> Sometimes it happens that a query on one of the database servers > takes longer than expected and impedes the generation of this report > (that's right, the queries are ran sequential). What I am trying to > achieve is to parallelize the queries on each database server and to be > able to cancel

Slightly OT: What metro areas are best for a software development career?

2013-01-21 Thread Jason Hsu
I am looking for a position as a software development engineer. I'm currently learning to develop Android apps (http://www.jasonhsu.com/android-apps), and I use Python for implementing Doppler Value Investing (http://www.dopplervalueinvesting.com) and for developing Swift Linux (http://www.swi

Re: Parent module adsite.adsiteviews.mainhanlder does not exist

2013-01-20 Thread Jason Friedman
> I created a django project using django 1.4.2. There is one 'app'(adsite) in > this project. And It works. But when I copied some 'py' files into the 'app' > folder, I got "Parent module adsite.adsiteviews.mainhanlder does not exist." > Should I register the new files to __init__ in the 'app'?

Re: ANN: Python training "text movies"

2013-01-13 Thread Jason Friedman
> That is right; I would also add that it may be overwhelming for a newbie > to be reading through a large "wall of text" -- here you have blank > space after the current paragraph so the attention is focused even more > on the last few lines. > > Additionally, since instructions scroll automatical

Re: [Offtopic] Line fitting [was Re: Numpy outlier removal]

2013-01-08 Thread Jason Friedman
> Statistical analysis is a huge science. So is lying. And I'm not sure > most people can pick one from the other. Chris, your sentence causes me to think of Mr. Twain's sentence, or at least the one he popularized: http://www.twainquotes.com/Statistics.html. -- http://mail.python.org/mailman/lis

Re: [Offtopic] Line fitting [was Re: Numpy outlier removal]

2013-01-08 Thread Jason Friedman
> Statistical analysis is a huge science. So is lying. And I'm not sure > most people can pick one from the other. Chris, your sentence causes me to think of Mr. Twain's sentence, or at least the one he popularized: http://www.twainquotes.com/Statistics.html. -- http://mail.python.org/mailman/lis

OT: local technical community portals

2013-01-07 Thread Jason Hsu
For the Minneapolis/St. Paul area of Minnesota, there is a technical community portal at http://tech.mn/. You'll see that this portal has links to user groups, networking events, jobs, etc. No, I didn't start this thread to tout this site. MY QUESTION: What are the local technical community p

Re: How do you call a function several times in this context??

2013-01-06 Thread Jason Friedman
> def double(value): > result > return result > > number=input('type a number') > print (double(int(number))) > I think what was meant: def double(value): result = 2 * value return result -- http://mail.python.org/mailman/listinfo/python-list

ImportError: /usr/local/lib/python3.2/dist-packages/OpenSSL/SSL.cpython-32mu.so: undefined symbol: SSLv2_method

2012-12-27 Thread Jason Friedman
Hello, I downloaded: https://launchpad.net/pyopenssl/main/0.11/+download/pyOpenSSL-0.11.tar.gz Then: $ python3 setup.py build $ sudo python3 setup.py install Then: $ python3 -c "from OpenSSL import SSL" Traceback (most recent call last): File "", line 1, in File "OpenSSL/__init__.py", line 4

Re: Trying to make a basic Python score counter in a game... will not count.

2012-12-17 Thread Jason Friedman
> if you're interested in learning Python and/or game programming in > Python, you might want to take a look at http://inventwithpython.com/ And https://www.coursera.org/course/interactivepython. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE: Thesaurus - a recursive dictionary subclass using attributes

2012-12-10 Thread Jason Friedman
> Thesaurus is a new a dictionary subclass which allows calling keys as > if they are class attributes and will search through nested objects > recursively when __getitem__ is called. Good stuff. You might consider: 1) Licensing under an OSI-approved license (http://opensource.org/licenses/index.

Running a Python app on a remote server and displaying the output files

2012-12-08 Thread Jason Hsu
I have a Python 2.7 script at https://github.com/jhsu802701/dopplervalueinvesting . When I run the screen.py script locally, the end result is a new screen-output sub-directory (within the root directory) and a results.csv file within it. What I'm trying to do is put this script on a remote ser

Remote server: running a Python script and making *.csv files publicly available

2012-12-05 Thread Jason Hsu
I have a Python 2.7 script that produces *.csv files. I'd like to run this Python script on a remote server and make the *.csv files publicly available to read. Can this be done on Heroku? I've gone through the tutorial, but it seems to be geared towards people who want to create a whole web

Re: Using Xpath to parse a Yahoo Finance page

2012-12-02 Thread Jason Hsu
On Sunday, December 2, 2012 8:25:45 PM UTC-6, MRAB wrote: > > list_row2 = doc2.xpath(u'.//td[strong[contains(text(),"Total > > Assets")]]/following-sibling::td/strong/text()') > Thanks, MRAB. Your suggestion works! -- http://mail.python.org/mailman/listinfo/python-list

Using Xpath to parse a Yahoo Finance page

2012-12-02 Thread Jason Hsu
I'm trying to extract the data on "total assets" from Yahoo Finance using Python 2.7 and lxml. Here is a special test script I set up to work on this issue: import urllib import lxml import lxml.html url_local1 = "http://www.smartmoney.com/quote/FAST/?story=financials&timewin

Re: Migrate from Access 2010 / VBA

2012-11-22 Thread Jason Friedman
> I am the lone developer of db apps at a company of 350+ employees. Everything > is done in MS Access 2010 and VBA. I'm frustrated with the limitations of > this platform and have been considering switching to Python. I've been > experimenting with the language for a year or so, and feel comfor

Re: Proper place for everything

2012-11-02 Thread Jason Benjamin
Yeah, now that I take a look at the said old post on this group, I can see why the post was ignored: http://markmail.org/thread/mnxpzt4jzx3zjeio On 11/02/2012 01:05 PM, Tim Golden wrote: On 02/11/2012 18:51, Jason Benjamin wrote: On another note, it appears that Google (the only archive I

Re: Proper place for everything

2012-11-02 Thread Jason Benjamin
27;ve ever used. On 11/02/2012 10:31 AM, Dennis Lee Bieber wrote: On Fri, 02 Nov 2012 06:49:18 -0700, Jason Benjamin declaimed the following in gmane.comp.python.general: Yeah, alright. I've just found that if you mention anything about a library that has well established competitors, the po

Re: Proper place for everything

2012-11-02 Thread Jason Benjamin
d, but I stereotype. On 11/02/2012 10:31 AM, Dennis Lee Bieber wrote: On Fri, 02 Nov 2012 06:49:18 -0700, Jason Benjamin declaimed the following in gmane.comp.python.general: Yeah, alright. I've just found that if you mention anything about a library that has well established competitors,

Re: Proper place for everything

2012-11-02 Thread Jason Benjamin
Yeah, alright. I've just found that if you mention anything about a library that has well established competitors, the post will tend to get ignored here. On 11/02/2012 04:38 AM, Robert Kern wrote: On 11/2/12 11:20 AM, Jason Benjamin wrote: Anybody know of the appropriate place to trol

Proper place for everything

2012-11-02 Thread Jason Benjamin
Anybody know of the appropriate place to troll and flame about various Python related issues? I'm kind of mad about some Python stuff and I need a place to vent where people may or may not listen, but at at least respond. Thought this would be a strange question, but I might as well start som

Re: SSH Connection with Python

2012-10-25 Thread Jason Friedman
> how can i create a SSH-Connection with python? I have to send some commands > to the remote host and parse their answers. Consider also the sh module: http://amoffat.github.com/sh/tutorials/2-interacting_with_processes.html. -- http://mail.python.org/mailman/listinfo/python-list

Re: Split single file into multiple files based on patterns

2012-10-23 Thread Jason Friedman
On Tue, Oct 23, 2012 at 9:01 PM, satyam wrote: > I have a text file like this > > A1980JE3937 2732 4195 12.527000 > A1980JE3937 3465 9720 22.00 > A1980JE3937 1853 3278 12.50 > A1980JE3937 2732 2732 187.50 > A1980JE3937 19 4688 3.619000 > A1980KK18700010 30 186 1.285

Re: Split single file into multiple files based on patterns

2012-10-23 Thread Jason Friedman
> I have a text file like this > > A1980JE3937 2732 4195 12.527000 > A1980JE3937 3465 9720 22.00 > A1980KK18700010 186 3366 4.78 > A1980KK18700010 30 186 1.285000 > A1980KK18700010 30 185 4.395000 > A1980KK18700010 185 186 9.00 > A1980KK18700010 25 30 3.493000 > > I want to spli

Re: Tkinter Create/Destory Button

2012-10-22 Thread Jason Swails
earning how to do it is quite helpful. Good luck, Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Interest in seeing sh.py in the stdlib

2012-10-21 Thread Jason Friedman
> I'm interested in making sh.py more accessible to help bring Python forward > in the area of shell scripting, so I'm interested in seeing if sh would be > suitable for the standard library. Is there any other interest in something > like this? Pretty slick. My only concern is portability, are

Re: python game develop:framework?

2012-10-14 Thread Jason Benjamin
Pygame is my favorite. It's mature, has good documentation, and has lots of unfinished and finished games on its website. It also supports OpenGL. http://www.pygame.org/ On 10/14/2012 01:58 AM, nepaul wrote: Something good framwork? -- http://mail.python.org/mailman/listinfo/python-list

Re: notmm is dead!

2012-10-07 Thread Jason Friedman
>> It was a _joke_ referring to Michael Torrie's email addressing the >> 8 Dihedral bot _as if it was a person_. > > Well it would be useful to probe the bot's parameters... Five eights is a busy bot: http://www.velocityreviews.com/forums/t806110-p8-ok-lets-start-real-programming-in-c-for-prob

Re: parse an environment file

2012-10-06 Thread Jason Friedman
> The only canned solution for parsing a bash script is bash. Think > about it the other way around: If you wanted to have a Python variable > made available to a bash script, the obvious thing to do is to invoke > Python. It's the same thing. I scratched my own itch: http://code.activestate.com/r

Re: calendar from python to html

2012-10-05 Thread Jason Benjamin
Well, you need a web server, a webpage, a database (could just be a file), a cgi script, and the datetime module. Optionally, you can use a web framework like CherryPy or Django, which covers a lot of these by itself. I only know Python 2, but here are some examples: A basic web server: web

Re: parse an environment file

2012-10-02 Thread Jason Friedman
> Ah, fair enough. Well, since you're using the full range of bash > functionality, the only viable way to parse it is with bash itself. > I'd recommend going with the version you have above: > >> * * * * * . /path/to/export_file && /path/to/script.py > > Under what circumstances is this not an opt

Re: parse an environment file

2012-10-01 Thread Jason Friedman
> I want my python 3.2.2 script, called via cron, to know what those > additional variables are. How? Thank you for the feedback. A crontab line of * * * * * . /path/to/export_file && /path/to/script.py does indeed work, but for various reasons this approach will not always be available to me.

parse an environment file

2012-09-30 Thread Jason Friedman
$ crontab -l * * * * * env This produces mail with the following contents: HOME=/home/spjsf LOGNAME=spjsf PATH=/usr/bin:/bin PWD=/home/spjsf SHELL=/bin/sh SHLVL=1 USER=spjsf _=/usr/bin/env On the other hand $ env produces about 100 entries, most of which are provided by my .bashrc; cron provid

Re: Article on the future of Python

2012-09-27 Thread Jason Friedman
> Fair enough, but it's the M in the LAMP stack I object to. I'd much > rather have P. +1 -- http://mail.python.org/mailman/listinfo/python-list

Re: portable way of locating an executable (like which)

2012-09-20 Thread Jason Swails
ac OS X, but not sure about windows (since I don't know if PATH works the same way there). HTH, Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Programming Issues

2012-09-19 Thread Jason Friedman
> Ask the user for the amount of change expressed in cents. Your program must > compute and display the number of half-dollars, quarters, dimes, nickels, > and pennies to be returned. > Return as many half-dollars as possible, then quarters, dimes, nickels, and > pennies, in that order. > Your prog

Re: 'indent'ing Python in windows bat

2012-09-18 Thread Jason Friedman
> I'm converting windows bat files little by little to Python 3 as I find time > and learn Python. > The most efficient method for some lines is to call Python like: > python -c "import sys; sys.exit(3)" > > How do I "indent" if I have something like: > if (sR=='Cope'): sys.exit(1) elif (sR=='Perfo

Re: datetime issue

2012-09-15 Thread Jason Friedman
> # get some enviromental values > locale.setlocale(locale.LC_ALL, 'el_GR') > date = datetime.datetime.now().strftime( '%y-%m-%d %H:%M:%S' ) > > although iam setting greek as locale the time is 8 hours before, like in > texas, us > How can i change this to save the correct Greek time in variable

Re: using text file to get ip address from hostname

2012-09-12 Thread Jason Friedman
> i need to get an ip address from list of hostnames which are in a textfile. > > this is what i have so far > -- > #!/usr/bin/env python > #Get the IP Address > > import socket > hostname = 'need it to read from a text file' >

Re: submit jobs on multi-core

2012-09-12 Thread Jason Friedman
>>> I have a python script in which I have a list of files to input one by one >>> and for each file I get a number as an output. >>> I used for loop to submit the file to script. >>> My script uses one file at a time and returns the output. >>> >>> My computers has 8 cores. >>> Is there any way th

Re: simple client data base

2012-09-08 Thread Jason Friedman
>>Mark R Rivet wrote: >>> Hello all, I am learning to program in python. I have a need to make a >>> program that can store, retrieve, add, and delete client data such as >>> name, address, social, telephone number and similar information. This >>> would be a small client database for my wife who h

Re: Python newbie here! No module named settings

2012-09-07 Thread Jason Friedman
>> I was trying to use Python wrapper for Google Charts API and was >> tweaking the examples. >> https://github.com/gak/pygooglechart/raw/master/examples/pie.py >> >> This is the script which I was trying. >> >> And the python interpreter gives the following error: >> import settings >> ImportE

Basic python extension producing error: "dynamic module not initialized properly"

2012-08-31 Thread Jason Veldicott
"-IC:\\Python26\\include" -O0 -g3 -Wall -c -fmessage-length=0 -o myextension.o "..\\myextension.cpp" mingw32-g++ -LC:/Python26/libs -shared -o libTestExtnModule.pyd myextension.o -lpython26 Any suggestions as to why the dynamic module is not initialising properly, or as to how o

Re: Dumping all the sql statements as backup

2012-08-30 Thread Jason Friedman
>> I have some long running processes that do very long simulations which >> at the end need to write things on a database. >> >> At the moment sometimes there are network problems and we end up with >> half the data on the database. >> >> The half-data problem is probably solved easily with sessio

Re: Make error when installing Python 1.5

2012-08-28 Thread Jason Swails
;exc_info', 'exc_type', 'exec_prefix', 'executable', 'exit', 'getrefcount', 'hexversion', 'maxint', 'modules', 'path', 'platform', 'prefix', 'ps1', 'ps2', 'setcheckinterval', 'setprofile', 'settrace', 'stderr', 'stdin', 'stdout', 'version'] >>> sys.version '1.5.2 (#1, Aug 28 2012, 20:13:23) [GCC 4.5.3]' >>> Good luck, Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get initial absolute working dir reliably?

2012-08-18 Thread Jason Swails
Users' >>> os.getenv('PWD') '/Users/swails' Of course this environment variable can still be messed with, but there isn't much reason to do so generally (if I'm mistaken here, someone please correct me). Hopefully this is of some help, Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: consistent input() for Python 2 and 3

2012-08-02 Thread Jason Swails
ut I imagine it can be used in a way that easily supports Python 2 and 3. If you have only one or two places where you need user-input, this is probably overkill. HTH, Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Search and replace text in XML file?

2012-07-27 Thread Jason Friedman
> I'm looking to search an entire XML file for specific text and replace that > text, while maintaining the structure of the XML file. The text occurs within > multiple nodes throughout the file. > I basically need to replace every occurrence C:\Program Files with C:\Program > Files (x86), regar

Calling Java jar class with parameter from Python

2012-07-21 Thread Jason Veldicott
ol "C:\Users\Jason\Documents\antlr\java grammar\Java.g" This command works outside of Python at the command prompt. So I do the same using Python's os.system: os.system("C:\\Program Files (x86)\\Java\\jdk1.7.0_05\\bin\\java.exe -cp c:\\antlr\\antlr-3.4-complete.jar org.ant

Re: simpler increment of time values?

2012-07-04 Thread Jason Friedman
> Hi all, > I'd like to ask about the possibilities to do some basic manipulation > on timestamps - such as incrementing a given time (hour.minute - > string) by some minutes. > Very basic notion of "time" is assumed, i.e. dateless, > timezone-unaware, DST-less etc. > I first thought, it would be p

question about numpy, subclassing, and a DeprecationWarning

2012-06-27 Thread Jason Swails
ribute to the class, but I would rather subclass ndarray directly (not sure I have a good reason for it, though). Suggestions on what I should do? Thanks! Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Read STDIN as bytes rather than a string

2012-06-18 Thread Jason Friedman
Which leads me to another question ... how can I debug these things? $ echo 'hello' | python3 -m pdb ~/my-input.py > /home/jason/my-input.py(2)() -> import sys (Pdb) *** NameError: name 'hello' is not defined -- http://mail.python.org/mailman/listinfo/python-list

Re: Read STDIN as bytes rather than a string

2012-06-18 Thread Jason Friedman
> sys.stdin wraps a buffered reader which itself wraps a raw file reader. > sys.stdin > <_io.TextIOWrapper name='' mode='r' encoding='UTF-8'> sys.stdin.buffer > <_io.BufferedReader name=''> sys.stdin.buffer.raw > <_io.FileIO name='' mode='rb'> > > You should read from sys.stdin.buffe

Read STDIN as bytes rather than a string

2012-06-18 Thread Jason Friedman
I tried this: Python 3.2.2 (default, Feb 24 2012, 20:07:04) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> import io >>> fh = io.open(sys.stdin) Traceback (most recent call last): File "", line 1, in TypeError: invalid file: <_io.

Re: python3 raw strings and \u escapes

2012-06-15 Thread Jason Friedman
>> This is a related question. >> >> I perform an octal dump on a file: >> $ od -cx file >> 000   h   e   l   l   o       w   o   r   l   d  \n >>            6568    6c6c    206f    6f77    6c72    0a64 >> >> I want to output the names of those characters: >> $ python3 >> Python 3.2.3 (default,

Re: python3 raw strings and \u escapes

2012-06-15 Thread Jason Friedman
This is a related question. I perform an octal dump on a file: $ od -cx file 000 h e l l o w o r l d \n 65686c6c206f6f776c720a64 I want to output the names of those characters: $ python3 Python 3.2.3 (default, May 19 2012, 17:01:30) [GCC

Re: usenet reading

2012-05-25 Thread Jason Earl
. I have had good success with news.eternal-september.org . http://www.eternal-september.org/ Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Sharing Data in Python

2012-05-17 Thread Jason Friedman
> I have some Pickled data, which is stored on disk, and it is about 100 MB in > size. > > When my python program is executed, the picked data is loaded using the > cPickle module, and all that works fine. > > If I execute the python multiple times using python main.py for example, each > python

specify end of line character for readline

2012-05-14 Thread Jason
Is there any way to specify the end of line character to use in file.readline() ? I would like to use '\r\n' as the end of line and allow either \r or \n by itself within the line. Thanks, Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Jason Earl
ly getting ready to release Emacs 24). His criticism of git's documentation is also grossly misleading. kernel.org still has the empty directories, but git-scm.org has been the official home for git's documentation for years. I am sure that the rest of the examples are just as ridicul

Re: Why does this hang sometimes?

2012-04-07 Thread Jason Friedman
> I am just playing around with threading and subprocess and found that > the following program will hang up and never terminate every now and > again. > > import threading > import subprocess > import time > > def targ(): >    p = subprocess.Popen(["/bin/sleep", "2"]) >    while p.poll() is None:

Re: Will MySQL ever be supported for Python 3.x?

2012-04-02 Thread Jason
't handle MySQL's zeroed dates, but the latest release seems to be patched now (applied a year after the bug was reported with a small patch to fix it). -- Jason -- http://mail.python.org/mailman/listinfo/python-list

How do I use PyGTK to put text besides clickable buttons?

2012-04-02 Thread Jason Hsu, Mr. Swift Linux
I've decided to use PyGTK instead of gtkdialog for providing configuration menus/dialog boxes in Swift Linux, the Linux distro I started. The problem with gtkdialog is that the i386 version is no longer available in the Debian repository. Since a picture is worth a thousand words, I'll give you a

Re: argparse ConfigureAction problem

2012-03-26 Thread Jason Friedman
> ./plot_stuff2.py --plot stuff1 stuff2 > [...] > plot_stuff2.py: error: argument --plot/--with-plot/--enable-plot/--no-plot/-- > without-plot/--disable-plot: invalid boolean value: 'stuff1' > > Problem is --plot takes an optional argument, and so the positional arg is > assumed to be the arg to --

Re: Does ElementTree's Parent XPath actually work?

2012-03-09 Thread Jason Cooper
On Friday, March 9, 2012 12:24:04 PM UTC-5, Jason Cooper wrote: > I'm curious to know if anyone with ElementTree 1.3 has gotten the parent > XPath to work? According to http://effbot.org/zone/element-xpath.htm, you > should be able to do > > >>> impor

Does ElementTree's Parent XPath actually work?

2012-03-09 Thread Jason Cooper
.find('..') >>> but that always return None for me. Has anyone else seen this particular XPath work? Am I just doing something wrong? Thanks for you help! Jason PS. In case you're wondering, yes I know that lxml supports parent points and, yes, I'm aware of http

Re: Error importing __init__ declared variable from another package

2012-02-28 Thread Jason Veldicott
is as I mentioned (capitalised). Perhaps it is some issue in PyDev, maybe related to the version of Python I'm using. I'm in the process of trying to solve another related import problem, and wished to resolve this one in the hope that it might shed light on the other. But as it works beside the error icon appearing, I might just ignore it and spare the trouble of precise identification of cause. Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: Error importing __init__ declared variable from another package

2012-02-28 Thread Jason Veldicott
Accidentally hit post by mistake before msg completed. Any comments appreciated. It's a very simple scenario, but not sure what the mistake is. Thanks Jason On Tue, Feb 28, 2012 at 6:55 PM, Jason Veldicott wrote: > Hi, > > I have a simple configuration of modules as beneath,

Error importing __init__ declared variable from another package

2012-02-27 Thread Jason Veldicott
Hi, I have a simple configuration of modules as beneath, but an import error is reported: /engine (__init__ is empty here) engine.py /sim __init__.py The module engine.py imports a variable instantiated in sim.__init__ as follows: from sim import var_name var_name.func() The fo

SSL on 3.2.2

2012-02-24 Thread Jason Friedman
Hello, attempting to build from source on Ubuntu 11.10. Before running ./configure I had set this in Modules/Setup.dist: SSL=/usr/lib/ssl _ssl _ssl.c \ -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ -L$(SSL)/lib -lssl -lcrypto $ ll /usr/lib/ssl total 4 lrwxrwxrwx 1 root ro

HTTP logging

2012-02-20 Thread Jason Friedman
I am logging to HTTP: logger.addHandler(logging.handlers.HTTPHandler(host, url)) Works great, except if my HTTP server happens to be unavailable: socket.error: [Errno 111] Connection refused Other than wrapping all my logger.log() calls in try/except blocks, is there a way to skip logging to th

parse a profile

2012-02-18 Thread Jason Friedman
I have a file I use for shell scripts that looks like this: export VAR1=/path/to/dir export VAR2=7 export VAR3=${VAR1}/further/path # comment . /another/file And a file /another/file: export VAR4=database-name Is there an existing package that will read such a file and return a dictionary like t

Re: Use logging level across application and modules

2012-02-02 Thread Jason Friedman
> Base module:  http://pastebin.com/nQCG5CRC > Another module:  http://pastebin.com/FFzCCjwG > Application:  http://pastebin.com/370cWJtT > > I have a module that will provide base functionality, such as logging > and authentication. > I have other specialized modules that provide additional > func

Use logging level across application and modules

2012-02-02 Thread Jason Friedman
Base module: http://pastebin.com/nQCG5CRC Another module: http://pastebin.com/FFzCCjwG Application: http://pastebin.com/370cWJtT I have a module that will provide base functionality, such as logging and authentication. I have other specialized modules that provide additional functionality. One

FounderDating - Helping entrepreneurs find their co-founder & start companies!

2012-02-01 Thread Jason Demant
hanks! Jason http://www.FounderDating.com -- http://mail.python.org/mailman/listinfo/python-list

Installing pypi package twice

2012-01-31 Thread Jason Friedman
My system's default python is 2.6.5. I have also installed python3.2 at /opt/python. I installed a pypi package for 2.6.5 with: $ tar xzf package.tar.gz $ cd package $ python setup.py build $ sudo python setup.py install How can I also install this same package for 3.2? (I am assuming this packa

Installing pypi package twice

2012-01-31 Thread Jason Friedman
My system's default python is 2.6.5. I have separately installed 3.2.2 at /opt/python. I downloaded python-daemon-1.5.5 and installed with: $ tar xzf python-daemon-1.5.5 $ cd python-daemon-1.5.5 $ python setup.py build $ sudo python setup.py install How would I also install this package for 3.2.2

python zipfile v. native unzip

2012-01-31 Thread Jason Friedman
Does Python 2.7's zipfile module use its own algorithm or does it leverage the zip/unzip libraries that exist on the host? I ask because my host's native unzip program cannot handle files that, when unzipped, are larger than 2GB. Will using Python 2.7 get around this limitation? -- http://mail.p

Re: scientific notation in legend (pylab)

2012-01-18 Thread Jason Friedman
> thank you, I am trying to learn python, but I am having a hard to find > a good introduction to it. Try this: http://docs.python.org/py3k/tutorial/ -- http://mail.python.org/mailman/listinfo/python-list

Re: why i can get nothing?

2012-01-15 Thread Jason Friedman
> here is my code : > import urllib > import lxml.html > down='http://download.v.163.com/dl/open/00DL0QDR0QDS0QHH.html' > file=urllib.urlopen(down). > read() > root=lxml.html.document_fromstring(file) > tnodes = root.xpath("//a/@href[contains(string(),'mp4')]") > for i,add in enumerate(tnodes): >  

Re: scientific notation in legend (pylab)

2012-01-14 Thread Jason Friedman
> I I would like to have numbers expressed in scientific notation in > legend annotations. Does anybody know how to do that? > Not sure why legend annotations makes the problem different, but perhaps this is a start: $ python3 Python 3.2 (r32:88445, Jun 11 2011, 10:38:04) [GCC 4.4.3] on linux2 Ty

logging and httphandler

2012-01-13 Thread Jason Friedman
I am logging to my Apache web server, using this Apache format: LogFormat "%{%Y-%m-%d %H:%M:%S}t %U %q" scriptlog CustomLog /var/log/apache2/script.log scriptlog My code is as follows: #!/usr/bin/env python3 import logging, logging.handlers, sys logger = logging.getLogger('simple_example') logge

How to remove ellipses from long paths in traceback?

2012-01-12 Thread Jason Veldicott
Hi, Long paths in python traceback are contracted with ellipses. eg: TclError: couldn't load library "C:/Python26/tcl/tk8.5/../../bin/tk85.dll" Is there any way to see the full path? Surprisingly, search didn't reveal an answer to this question. Thanks Jason -- ht

Re: Python lib for creating Database tables

2012-01-11 Thread Jason Friedman
> Hello All, > > I just made something pretty simple that I intend to use while creating > database tables. It is still in the basic form, and much needs to be added. > However, I use introspection to make it a bit easier and less work on the > user. > > I would want my code to be reviewed by this

Python powering giant screen in Times Square

2011-12-31 Thread Jason Ford
ebook, Twitter, Instagram, Google+, Foursquare, and other sources. So if you happen to be in Times Square for the crazy party today, tell the people around you that big social media screen is powered by Python! - Jason (founder of FeedMagnet) -- http://mail.python.org/mailman/listinfo/python-list

Re: mutually exclusive arguments to a constructor

2011-12-30 Thread Jason Friedman
> Suppose I'm creating a class that represents a bearing or azimuth, > created either from a string of traditional bearing notation > ("N24d30mE") or from a number indicating the angle in degrees as > usually measured in trigonometry (65.5, measured counter-clockwise > from the x-axis).  The class

Re: Regular expressions

2011-12-26 Thread Jason Friedman
> Thanks a lot everyone. > > Can anyone suggest a good place to learn REs? Start with the manual: http://docs.python.org/py3k/library/re.html#module-re -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expressions

2011-12-26 Thread Jason Friedman
> On Tue, Dec 27, 2011 at 10:45 AM, mauricel...@acm.org > wrote: >> Hi >> >> I am trying to change to . >> >> Can anyone help me with the regular expressions needed? > > A regular expression defines a string based on rules. Without seeing a > lot more strings, we can't know what possibilities the

Re: modifying a time.struct_time

2011-12-23 Thread Jason Friedman
On Fri, Dec 16, 2011 at 10:44 AM, Chris Angelico wrote: > On Fri, Dec 16, 2011 at 8:45 PM, Ulrich Eckhardt > wrote: >> I'm trying to create a struct_time that is e.g. one year ahead or a month >> back in order to test some parsing/formatting code with different dates. > > Do you need it to be one

Re: merging argparse parsers

2011-12-23 Thread Jason Friedman
> I would like to have something like > > merged_parser = LoggingParser() + OtherParser() > > Which should create an argument parser with all the options composed. > I have used parent parsers. http://docs.python.org/py3k/library/argparse.html#parents I think in your case merged_parser would bec

Debug python from DLL callback?

2011-11-30 Thread Jason Veldicott
Hi, I am wondering if anyone here might be able to suggest if there is a way of switching over from python execution into debug mode of an IDE, from python code that is executed as a callback from a C++ DLL? Thanks Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter

2011-11-26 Thread Jason Swails
e variable that you set is useless unless you plan to use the value (or if there's a case where you may use it). If such a case exists, then you'll need a reference to that variable in the relevant scope you're dealing with. Hope this helps, Jason On Nov 26, 2011, at 4:42 P

Re: (n00b) Tkinter trouble

2011-11-16 Thread Jason Swails
On Tue, Nov 15, 2011 at 10:49 PM, Chris Angelico wrote: > On Wed, Nov 16, 2011 at 2:02 PM, Jason Swails > wrote: > > Apparently I could not do what I was wanting to (state=DISABLED is not a > > valid option to Toplevel). What I wanted to do was something similar to > &g

Re: (n00b) Tkinter trouble

2011-11-15 Thread Jason Swails
raw() method on the window during the constructor of the *new* window and execute .deiconify() on it during the new window's destroy() method (before calling Toplevel's destroy on self). I still like the first way better. Thanks! Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: (n00b) Tkinter trouble

2011-11-14 Thread Jason Swails
On Mon, Nov 14, 2011 at 3:49 AM, Chris Angelico wrote: > On Mon, Nov 14, 2011 at 6:11 PM, Jason Swails > wrote: > > Then, I can reactivate all of the buttons in the destroy() method before > > calling the destroy() method of Toplevel on self. > > Small side point that

Re: (n00b) Tkinter trouble

2011-11-13 Thread Jason Swails
On Sun, Nov 13, 2011 at 1:27 PM, Jason Swails wrote: > Hello, > > I'm trying my hand at creating a Tkinter application, but not having much > luck. I'm trying to have my top level window be a series of buttons with > different options on them. Every time a button is pre

(n00b) Tkinter trouble

2011-11-13 Thread Jason Swails
op.mainloop() I'm really kind of running around in the dark here, so any advice or explanation is appreciated. Thanks! Jason -- http://mail.python.org/mailman/listinfo/python-list

Can I fully replace GNU Bash with Python?

2011-11-04 Thread Jason Hsu, Mr. Swift Linux
This question concerns my process of creating Swift Linux from the base distro (antiX Linux in the past, Linux Mint Debian Edition now). (NOTE: The process I'm describing here is an oversimplification.) All of my development work takes place in the ~/develop directory. This is the directory where

Re: Review Python site with useful code snippets

2011-10-29 Thread Jason Friedman
On Wed, Oct 26, 2011 at 3:51 PM, Chris Hall wrote: > I am looking to get reviews, comments, code snippet suggestions, and > feature requests for my site. > I intend to grow out this site with all kinds of real world code > examples to learn from and use in everyday coding. > The site is: > > http:

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