Re: Critic my module

2013-07-27 Thread Jason Swails
s strange: >>> print(platform.uname()) ('Linux', 'Batman', '3.3.8-gentoo', '#1 SMP Fri Oct 5 14:14:57 EDT 2012', 'x86_64', 'AMD FX(tm)-6100 Six-Core Processor') Whereas: [bash $] uname -a Linux Batman 3.3.8-gentoo #1 SMP Fri Oct 5 14

Re: Critic my module

2013-07-27 Thread Jason Friedman
> > >I made a Python3 module that allows users to use certain Linux shell > commands from Python3 more easily than using os.system(), > subprocess.Popen(), or subprocess.getoutput(). This module (once placed > with the other modules) can be used like this > > Looks similar to https://pypi.pytho

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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: 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'?

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

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-27 Thread Jason Friedman
> On 26Jan2013 09:48, Matt Jones wrote: > | It sounds like your real problem is with your SQL query... Is that part of > | this problem under your control? Can you break the query into smaller, > | quicker, pieces that you can run in a reasonable amount of time? > > Another option to investigate

confusion with decorators

2013-01-30 Thread Jason Swails
I was at one point hopeful to avoid. I'm still stumbling around with decorators a little, but this exercise has made them a lot clearer to me. Thanks! Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: confusion with decorators

2013-01-31 Thread Jason Swails
On Thu, Jan 31, 2013 at 12:46 AM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Wed, 30 Jan 2013 19:34:03 -0500, Jason Swails wrote: > > > Hello, > > > > I was having some trouble understanding decorators and inheritance and > > a

Re: confusion with decorators

2013-01-31 Thread Jason Swails
r to catch the HTTPError, but since that should not be possible in AuthorClass, I'd rather not risk masking a bug. I'm under no impressions that the above code will decorate A-inherited functions with the B-decorator (I know it won't), but that's the effect I'm trying to achieve... Thanks! Jason -- Jason M. Swails Quantum Theory Project, University of Florida Ph.D. Candidate 352-392-4032 -- http://mail.python.org/mailman/listinfo/python-list

Re: confusion with decorators

2013-01-31 Thread Jason Swails
On Thu, Jan 31, 2013 at 11:00 AM, Jason Swails wrote: > > > On Thu, Jan 31, 2013 at 10:28 AM, Chris Angelico wrote: > >> >> >> Well, that surely isn't going to work, because it always decorates the >> >> same function, the global "fcn&quo

Re: confusion with decorators

2013-01-31 Thread Jason Swails
> do_this() > except self.catch_these: > do_that() > > The subclass can then extend or replace that list: > > class RemotePatch(Patch): > catch_these = Patch.catch_these + [EggsException, CheeseException] > Ha! I use this technique all the time to avoid code duplication (it's used several times in the program I'm writing). It didn't even occur to me in this context... Thanks for pointing this out! As always, the time you put into responses and helping is appreciated. All the best, Jason -- http://mail.python.org/mailman/listinfo/python-list

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

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

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

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

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

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

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

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

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

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

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,

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

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

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

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: 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: 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: pthreads in C++ with embedded Python

2011-06-08 Thread Jason Tackaberry
your effort to create a reduced testcase I assume? Cheers, Jason. -- http://mail.python.org/mailman/listinfo/python-list

Re: pthreads in C++ with embedded Python

2011-06-08 Thread Jason Tackaberry
ed. :) Cheers, Jason. -- http://mail.python.org/mailman/listinfo/python-list

Embedding Python in a shell script

2011-06-16 Thread Jason Friedman
$ cat test.sh #!/bin/bash for i in 1 2 3 4; do python -c " for j in range($i): print j " done $ sh test.sh 0 0 1 0 1 2 0 1 2 3 The code behaves as I expect and want, but the de-denting of the Python call is unattractive, especially unattractive the longer the Python call becomes. I'd prefe

Re: Embedding Python in a shell script

2011-06-17 Thread Jason Friedman
Thank you, everyone, for your suggestions. I'll try them all and decide which I like best. -- http://mail.python.org/mailman/listinfo/python-list

Re: Code hosting services

2011-07-16 Thread Jason Earl
traction. The perception is that bzr is unusably slow. This is too bad, IMHO, as Launchpad is pretty cool. Jason -- http://mail.python.org/mailman/listinfo/python-list

Re: a little parsing challenge ☺

2011-07-20 Thread Jason Earl
the newsgroups: line is not supposed to have spaces in it, that > makes both his post and your post invalid. Hence, filter on invalid > posts. I suspect that the spaces you are seeing are being added by Gnus. I see them too (and I see them in your post as well), but they disappear when

Re: TypeError: 'module' object is not callable

2011-08-11 Thread Jason Swails
or instance, "from mymodule import *") versus keeping everything in a separate namespace so stuff doesn't get overwritten. This is more applicable to scripts/programs you write that import a number of different modules, all of whom may contain objects with the same name. All the

Commands for changing ownership of a file

2011-08-14 Thread Jason Hsu
I have a script that I execute as root, but I need to change the ownership of the files created in the script to that of my username. In GNU Bash, the command is something like "chown myusername:users". What's the equivalent Python command? I know that there is a command that uses numbers for the

Re: Ten rules to becoming a Python community member.

2011-08-16 Thread Jason Swails
As such, I argue they are supposed to be used (to) often. In such circumstances as these, I say keep your language concise and simple, and your words will reach the most people (and the fewest killfiles, perhaps). As the wise man says, "It's not only quiet people that don't say much". (And here RR joins his silent majority). Peace, Jason -- http://mail.python.org/mailman/listinfo/python-list

List spam

2011-08-18 Thread Jason Staudenmayer
I really like this list as part of my learning tools but the amount of spam that I've been getting from it is CRAZY. Doesn't anything get scanned before it sent to the list? Jason ..·><º> -- http://mail.python.org/mailman/listinfo/python-list

RE: List spam

2011-08-18 Thread Jason Staudenmayer
> On 18/08/2011 13:58, Jason Staudenmayer wrote: > > I really like this list as part of my learning tools but the amount > > of spam that I've been getting from it is CRAZY. Doesn't > anything get > > scanned before it sent to the list? > > I haven't

RE: List spam

2011-08-18 Thread Jason Staudenmayer
> On Aug 18, 2011, at 8:58 AM, Jason Staudenmayer wrote: > > > I really like this list as part of my learning tools but > the amount of spam that I've been getting from it is CRAZY. > Doesn't anything get scanned before it sent to the list? > > This has been

RE: List spam

2011-08-18 Thread Jason Staudenmayer
> On Aug 18, 8:39 am, "Jason Staudenmayer" > wrote: > > > > [snip irony] > > > > Adventure Aquarium is America's Most Touchable Aquarium! > > Featuring the ALL NEW Stingray Beach Club > > Where you can touch and hand feed the gentle stin

Re: Help with regular expression in python

2011-08-19 Thread Jason Friedman
> Hi Josh, > thanks for the reply. I am no expert so please bear with me: > I thought that the {32} was supposed to match the previous expression 32 > times? > > So how can i have all matches accessible to me? $ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "he

typing question

2011-08-27 Thread Jason Swails
so, there should be no difference between any of my class definitions). I would prefer that every approach give me the name of the class (rather than the first 2 just return 'instance'). Why is this not the case? Also, is there any way to access the name of the of the class type foo or bar

Re: killing a script

2011-08-29 Thread Jason Swails
caught if it isn't seen by the main Python process, so this still won't do anything if you use an unprotected/unwrapped os.system command. HTH, Jason -- http://mail.python.org/mailman/listinfo/python-list

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