Re: Will IronPython / WPF work on Mac OS X?

2014-08-04 Thread Benjamin Kaplan
On Aug 4, 2014 6:23 AM, wrote: > > Hello, > I am thinking of using IronPython to build an Python application. Using WPF in Visual Studio to draw the GUI and create the XAML. Can I then run this Python application on a Mac OS X (10.8)? > Thanks. > -- Nope. IronPython on Mac runs on top of Mono, s

Re: What is the difference between 32 and 64 bit Python on Windows 7 64 bit?

2014-05-11 Thread Benjamin Kaplan
On Sat, May 10, 2014 at 11:56 PM, Ross Gayler wrote: > > Hi, > > I want to install Python on a PC with 16GB of RAM and the 64 bit version of > Windows 7. > I want Python to be able to use as much as possible of the RAM. > > When I install the 64 bit version of Python I find that sys.maxint == 2**

Re: Functions help

2014-02-23 Thread Benjamin Kaplan
On Sun, Feb 23, 2014 at 5:39 PM, alex23 wrote: > On 24/02/2014 11:09 AM, Mark Lawrence wrote: >> >> On 24/02/2014 00:55, alex23 wrote: >>> >>> >>> for _ in range(5): >>> func() >> >> >> the obvious indentation error above > > > Stupid cut&paste :( > -- Your message came through fine for

Re: python import error

2013-12-10 Thread Benjamin Kaplan
On Tue, Dec 10, 2013 at 9:45 PM, wrote: > On Wednesday, December 11, 2013 10:23:34 AM UTC+5:30, John Gordon wrote: >> In <93405ea9-6faf-4a09-9fd9-ed264e313...@googlegroups.com> >> smilesonisa...@gmail.com writes: >> >> >> >> > File "aaa.py", line 5, in >> >> > from ccc.ddd import sss >> >

Re: python programming help

2013-12-08 Thread Benjamin Kaplan
On Sun, Dec 8, 2013 at 10:32 AM, wrote: > > On Sunday, December 8, 2013 6:27:34 PM UTC, bob gailer wrote: > > On 12/8/2013 12:59 PM, rafaella...@gmail.com wrote: > > > > > i have a dictionary with names and ages for each name. I want to write a > > > function that takes in an age and returns the

Re: Trying tcompile an use the Python 3.4a

2013-11-14 Thread Benjamin Kaplan
On Nov 14, 2013 5:55 AM, "Nick the Gr33k" wrote: > > Will someone please tell me how to install 'pip' > > My website is not working because modules are missing and the only way i can install them is by installing python's module manager 'pip' > > but 'yum install python-pip' fails. > > How would i

Re: Python Front-end to GCC

2013-10-22 Thread Benjamin Kaplan
On Tue, Oct 22, 2013 at 8:04 AM, Mark Janssen wrote: > I love it. Watch this... > > [context] A language specification in BNF is just syntax. It doesn't say anything about semantics. So how could this be used to produce executable C code for a program? BNF is used to produce parser

Re: Python GUI?

2013-09-17 Thread Benjamin Kaplan
On Tue, Sep 17, 2013 at 9:51 AM, rusi wrote: > On Tuesday, September 17, 2013 9:49:28 PM UTC+5:30, Benjamin Kaplan wrote: >> On Tue, Sep 17, 2013 at 7:55 AM, rusi wrote: >> >> > On Thursday, September 12, 2013 10:21:49 PM UTC+5:30, Benjamin Kaplan >> > wrote:

Re: Python GUI?

2013-09-17 Thread Benjamin Kaplan
On Tue, Sep 17, 2013 at 7:55 AM, rusi wrote: > On Thursday, September 12, 2013 10:21:49 PM UTC+5:30, Benjamin Kaplan wrote: > >> The main difference between wx and qt is that qt looks native on every >> platform >> while wx *is* native on every platform (it uses

Re: Python GUI?

2013-09-12 Thread Benjamin Kaplan
On Sep 12, 2013 9:06 AM, wrote: > > On Thursday, September 12, 2013 6:05:14 AM UTC+1, Michael Torrie wrote: > > On 09/11/2013 02:55 PM, eamonn...@gmail.com wrote: > > > > > PyQT -- You have a GUI designer, so I'm not going to count that > > > > What do you mean? Gtk has a GUI designer too. what

Re: Language design

2013-09-11 Thread Benjamin Kaplan
On Wed, Sep 11, 2013 at 5:37 PM, Mark Janssen wrote: >> Unicode is not 16-bit any more than ASCII is 8-bit. And you used the >> word "encod[e]", which is the standard way to turn Unicode into bytes >> anyway. No, a Unicode string is a series of codepoints - it's most >> similar to a list of ints t

Re: NameError: global name '' is not defined , but a bit differences

2013-09-04 Thread Benjamin Kaplan
On Wed, Sep 4, 2013 at 9:17 PM, Mohsen Pahlevanzadeh wrote: > Dear all , > > i get the error : > > NameError: global name 'ui' is not defined > > Complete question is at : > http://stackoverflow.com/questions/18627608/nameerror-global-name-is-not-defined-but-differences > > Before answering, Thank

Re: How to exit a cgi file after a download

2013-09-04 Thread Benjamin Kaplan
On Sep 4, 2013 1:29 PM, "Ferrous Cranus" wrote: > > Python help. > > I use the following code in a cgi file > to give the client a download link to > download a file. > > --- > > print "%s" % (' Down > Load ') > > > > A click on "Down Load" opens a pop up browser > window which allows the use

Re: New way of writing socket servers in #Linux kernel 3.9 (and in #Python too)

2013-08-24 Thread Benjamin Kaplan
On Sat, Aug 24, 2013 at 7:08 PM, Michael Torrie wrote: > #Linux, #Python? This this hash tag stuff is getting out of hand, don't > you think? Didn't you hear? In an effort to redefine itself for the modern Internet, Usenet is adding support for hash tags and limiting posts to 140 characters beca

Re: List getting extended when assigned to itself

2013-08-24 Thread Benjamin Kaplan
On Sat, Aug 24, 2013 at 8:52 PM, Krishnan Shankar wrote: > Hi Python Friends, > > I came across an example which is as below, > var = [1, 12, 123, 1234] var > [1, 12, 123, 1234] var[:0] > [] var[:0] = var var > [1, 12, 123, 1234, 1, 12, 123, 1234] > > Here in var[:0]

Re: can't get utf8 / unicode strings from embedded python

2013-08-24 Thread Benjamin Kaplan
On Sat, Aug 24, 2013 at 9:47 AM, David M. Cotter wrote: > > > What _are_ you using? > i have scripts in a file, that i am invoking into my embedded python within a > C++ program. there is no terminal involved. the "print" statement has been > redirected (via sys.stdout) to my custom print clas

Re: Resolving import errors reported by PyLint in modules using Python.NET

2013-08-08 Thread Benjamin Kaplan
On Thu, Aug 8, 2013 at 10:17 PM, wrote: > PyLint can't figure out imports of .NET code being referenced in my Python > scripts that use Python.NET. I can kind of see why; you have to evaluate > some clr.AddReference calls for the imports to even succeed. I wonder if I > have any recourse. G

Re: GeoIP2 for retrieving city and region ?

2013-07-15 Thread Benjamin Kaplan
On Sat, Jul 13, 2013 at 10:43 AM, Νικόλας wrote: > Στις 13/7/2013 7:54 μμ, ο/η Dennis Lee Bieber έγραψε: >> >> Are you paying for a fixed IP number? I suspect you are if you >> were >> running a world-accessible server. >> >> Obviously a fixed IP will be tied to a fixed connection

Re: Explain your acronyms (RSI?)

2013-07-06 Thread Benjamin Kaplan
On Sat, Jul 6, 2013 at 12:38 PM, Terry Reedy wrote: > "rms has crippling RSI" (anonymous, as quoted by Skip). > > I suspect that 'rms' = Richard M Stallman (but why lower case? to insult > him?). I 'know' that RSI = Roberts Space Industries, a game company whose > Kickstarter project I supported.

Re: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb6 in position 0: invalid start byte

2013-07-05 Thread Benjamin Kaplan
On Jul 5, 2013 12:12 AM, "Lele Gaifax" wrote: > > Νίκος Gr33k writes: > > > try: > > host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] > > except Exception as e: > > host = "Reverse DNS Failed" > > > > How can the above code not be able to reeverse dns any more and it > > fa

Re: Importing modules into IronPython

2013-07-03 Thread Benjamin Kaplan
On Wed, Jul 3, 2013 at 3:05 PM, HighBeliever wrote: > Hi, I have to shift a Python 2.7 program to run in Windows. Doing that has > forced me to use IronPython because my program is dependent on a .dll file > that uses .NET framework. > > I moved all my code to Iron Python and modified it to work

Re: How to tell Script to use pythonw.exe ?

2013-07-03 Thread Benjamin Kaplan
On Jul 3, 2013 8:27 AM, "Νίκος" wrote: > > Στις 3/7/2013 6:43 πμ, ο/η Tim Roberts έγραψε: > >> goldtech wrote: >>> >>> >>> I just changed the file extension of the script file from .py to .pyw >>> and it uses pythonw.exe. I didn't read it anywhere, just intuited it >>> and tried it. Python has so

Re: Is this PEP-able? fwhile

2013-06-24 Thread Benjamin Kaplan
On Mon, Jun 24, 2013 at 8:54 PM, Chris Angelico wrote: > On Tue, Jun 25, 2013 at 12:01 PM, rusi wrote: >> On Tuesday, June 25, 2013 3:08:57 AM UTC+5:30, Chris Angelico wrote: >>> On Tue, Jun 25, 2013 at 5:52 AM, <> wrote: >>> >>> > (NOTE: Many people are being taught to avoid 'break' and 'conti

Re: Variables versus name bindings [Re: A certainl part of an if() structure never gets executed.]

2013-06-17 Thread Benjamin Kaplan
On Mon, Jun 17, 2013 at 8:55 AM, Simpleton wrote: > On 17/6/2013 5:22 μμ, Terry Reedy wrote: >> >> On 6/17/2013 7:34 AM, Simpleton wrote: >>> >>> On 17/6/2013 9:51 πμ, Steven D'Aprano wrote: Now, in languages like Python, Ruby, Java, and many others, there is no table of memory addr

Re: Eval of expr with 'or' and 'and' within

2013-06-14 Thread Benjamin Kaplan
On Jun 14, 2013 9:34 AM, "Michael Torrie" wrote: > > On 06/14/2013 03:50 AM, Nick the Gr33k wrote: > > >>> print(name or month or year) > > abcd > > >>> print(name and month and year) > > ijkl > > Interesting. I'd have thought a boolean expression would return True or > False, not a string. Le

Re: Version Control Software

2013-06-13 Thread Benjamin Kaplan
On Jun 13, 2013 10:17 AM, "Grant Edwards" wrote: > > On 2013-06-13, Ben Finney wrote: > > cutems93 writes: > > > >> I am looking for an appropriate version control software for python > >> development, and need professionals' help to make a good decision. > > > >> Currently I am considering four

Re: Re-using copyrighted code

2013-06-09 Thread Benjamin Kaplan
On Sun, Jun 9, 2013 at 6:40 PM, Mark Janssen wrote: >> Mark, ever watched TV? Or gone to the movies? Or walked into a bookshop? >> Listened to the radio? All these things publish copyrighted work. It is >> utter nonsense that merely publishing something in public gives up the >> monopoly privilege

Re: Re-using copyrighted code

2013-06-09 Thread Benjamin Kaplan
On Sun, Jun 9, 2013 at 1:32 PM, Mark Janssen wrote: > On Sun, Jun 9, 2013 at 12:50 PM, Michael Torrie wrote: >> On 06/09/2013 11:18 AM, Mark Janssen wrote: >>> You actually do not. Attaching a legal document is purely a secondary >>> protection from those who would take away right already grante

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Benjamin Kaplan
On Sun, Jun 9, 2013 at 2:20 AM, Νικόλαος Κούρας wrote: > Τη Κυριακή, 9 Ιουνίου 2013 12:12:36 μ.μ. UTC+3, ο χρήστης Cameron Simpson > έγραψε: >> On 09Jun2013 02:00, =?utf-8?B?zp3Or866zr/PgiDOk866z4EzM866?= >> wrote: >> >> | Steven wrote: >> >> | >> Since 1 byte can hold up to 256 chars, why not

Re: Changing filenames from Greeklish => Greek (subprocess complain)

2013-06-09 Thread Benjamin Kaplan
On Sun, Jun 9, 2013 at 2:38 AM, Νικόλαος Κούρας wrote: > Τη Κυριακή, 9 Ιουνίου 2013 12:20:58 μ.μ. UTC+3, ο χρήστης Lele Gaifax έγραψε: > >> > How about a string i wonder? >> > s = "νίκος" >> > what_are these_bytes = s.encode('iso-8869-7').encode(utf-8') > >> Ignoring the usual syntax error, this i

Re: Re-using copyrighted code

2013-06-08 Thread Benjamin Kaplan
On Sat, Jun 8, 2013 at 2:31 PM, Malte Forkel wrote: > Hello, > > I have written a small utility to locate errors in regular expressions > that I want to upload to PyPI. Before I do that, I would like to learn > a litte more about the legal aspects of open-source software. What would > be a good i

RE: Python #ifdef

2013-05-28 Thread Benjamin Kaplan
On May 28, 2013 1:10 PM, "Carlos Nepomuceno" wrote: > > Thank you! I made it run like the following. What do you think about that? IS there a better way? > > > > #The following runs on Python 2.7 > sc3=''' > # Python 3 > def original(n): > m = 0 > for b in n.to_bytes(6, 'big'): > m

Re: in need of some help regarding my rock paper scissors game

2013-05-12 Thread Benjamin Kaplan
On Sun, May 12, 2013 at 12:33 PM, Alex Norton wrote: > im new to python and im in the middle of making a RPS game for a college > unit. > > i have used PyQt to create the GUI and i have received help regarding adding > the code to the buttons. > > but its missing something as the error > > 'Traceb

Re: Why do Perl programmers make more money than Python programmers

2013-05-07 Thread Benjamin Kaplan
On May 7, 2013 5:42 PM, "Neil Hodgson" wrote: > > jmfauth: > >> 2) More critical, Py 3.3, just becomes non unicode compliant, >> (eg European languages or "ascii" typographers !) >> ... > > >This is not demonstrating non-compliance. It is comparing performance, not compliance. > >Please sh

Re: Is Unicode support so hard...

2013-04-20 Thread Benjamin Kaplan
On Sat, Apr 20, 2013 at 10:22 AM, Ned Batchelder wrote: > On 4/20/2013 1:12 PM, jmfauth wrote: >> >> In a previous post, >> >> >> http://groups.google.com/group/comp.lang.python/browse_thread/thread/6aec70817705c226# >> , >> >> Chris “Kwpolska” Warrick wrote: >> >> “Is Unicode support so hard, esp

Re: py2exe and 64/32 bit windows

2013-04-09 Thread Benjamin Kaplan
On Apr 9, 2013 12:53 PM, "Grant Edwards" wrote: > > On 2013-04-09, Ian Kelly wrote: > > >> My "Windows partition" currently has a 64-bit Windows 7 Ultimate > >> installation. > >> > >> I'm told that the executable I generate on that machine won't run on > >> Win7 32-bit installations. I'm not su

Re: How to do a Lispy-esque read?

2013-04-08 Thread Benjamin Kaplan
There is no "read in a stream until it's a valid literal" function as far as I know, but ast.literal_eval will turn your string into an object. On Mon, Apr 8, 2013 at 12:45 AM, wrote: > Suppose I want to read an object from some stream. How do I do it? > > For example, if the input stream contai

Re: I hate you all

2013-04-05 Thread Benjamin Kaplan
On Fri, Apr 5, 2013 at 10:07 PM, Timothy Madden wrote: > > On 06.04.2013 03:35, Chris Angelico wrote: >> >> On Sat, Apr 6, 2013 at 11:22 AM, wrote: >>> >>> On Saturday, April 6, 2013 1:42:15 AM UTC+3, Ian wrote: >>> [...] The "def" line has four spaces. The "for" line then has a hard

Re: Python class and variable issue(newby question!)

2013-03-29 Thread Benjamin Kaplan
On Fri, Mar 29, 2013 at 2:12 PM, Sam Berry wrote: > Hey, > > Im new to object orientated programming and have an issue with using classes. > Im using the kivy module, a GUI creator , so posting the actual code may > confuse. But an example of what im trying to achieve is below > > class test() >

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread Benjamin Kaplan
On Thu, Mar 28, 2013 at 2:11 PM, jmfauth wrote: > On 28 mar, 21:29, Benjamin Kaplan wrote: >> On Thu, Mar 28, 2013 at 10:48 AM, jmfauth wrote: >> > On 28 mar, 17:33, Ian Kelly wrote: >> >> On Thu, Mar 28, 2013 at 7:34 AM, jmfauth wrote: >> >> >

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread Benjamin Kaplan
On Thu, Mar 28, 2013 at 10:48 AM, jmfauth wrote: > On 28 mar, 17:33, Ian Kelly wrote: >> On Thu, Mar 28, 2013 at 7:34 AM, jmfauth wrote: >> > The flexible string representation takes the problem from the >> > other side, it attempts to work with the characters by using >> > their representations

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Benjamin Kaplan
On Mon, Mar 18, 2013 at 1:24 PM, Mark Janssen wrote: > On Mon, Mar 18, 2013 at 12:06 PM, Georg Brandl wrote: >> Am 18.03.2013 05:26, schrieb Mark Janssen: >>> Continuing on this thread, there would be a new bunch of behaviors to >>> be defined. Since "everything is an object", there can now be a

Re: [Python-ideas] Message passing syntax for objects

2013-03-18 Thread Benjamin Kaplan
On Mon, Mar 18, 2013 at 10:18 AM, Mark Janssen wrote: >> Ian Cordasco wrote: >>> >>> On Sun, Mar 17, 2013 at 11:53 PM, Mark Janssen >>> wrote: >>> Hello, I just posted an answers on quora.com about OOP (http://qr.ae/TM1Vb) and wanted to engage the python community on the subje

Re: PyWart: NameError trackbacks are superfluous

2013-03-16 Thread Benjamin Kaplan
On Sat, Mar 16, 2013 at 8:14 PM, Steven D'Aprano wrote: > On Sat, 16 Mar 2013 19:58:41 -0600, Michael Torrie wrote: > >> On 03/16/2013 06:11 PM, Rick Johnson wrote: >>> No, the "ACTUAL PROBLEM" is in the author. >> >> Surely any NameException can also be blamed on the author then, by your >> logic

Re: Why is it impossible to create a compiler than can compile Python to machinecode like C?

2013-03-04 Thread Benjamin Kaplan
On Mar 4, 2013 3:02 PM, "CM" wrote: > > > > The main issue is that python has dynamic typing. The type of object > > that is referenced by a particular name can vary, and there's no way > > (in general) to know at compile time what the type of object "foo" is. > > > > That makes generating object

Re: How to install development package on linux?

2013-03-02 Thread Benjamin Kaplan
On Sat, Mar 2, 2013 at 10:14 PM, Sarbjit singh wrote: > > I searched on google and found these errors could be due to missing python > header files which would be available in development package. > > So I am struggling to make it work. A "development package" is meaningless when you aren't ins

Re: In win32 and linux platform, os modules has diffreent output order, is it a bug?

2013-03-01 Thread Benjamin Kaplan
On Fri, Mar 1, 2013 at 12:43 AM, Honghe Wu wrote: > env: python 2.7.3 > > 6 test files' name in a directory as below: > 12ab Abc Eab a1bc acd bc > > the following is test code: > for root, dirs, files in os.walk(os.getcwd()): > print files > > the output in win32 platform is: > ['12ab', '

Re: cymbalic reference?

2013-01-15 Thread Benjamin Kaplan
On Tue, Jan 15, 2013 at 8:56 PM, rh wrote: > I have this working and I am curious to know how others do same. > > class Abc(object): > def __init__(self): > pass > def good(self): > print "Abc good" > def better(self): > print "Abc better" > > urls = {'Abc':'htt

Re: wiki.python.org

2013-01-09 Thread Benjamin Kaplan
On Wed, Jan 9, 2013 at 8:30 AM, Ken wrote: > On Wed, Jan 09, 2013 at 04:05:31PM +, Reed, Kevin wrote: >> Hello, >> >> I have been unable to access wiki.python.org for two days. Is there a >> problem with the server, or is it me? >> >> Thank you much, >> >> Kevin C. Reed >> New Python User >

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

2013-01-06 Thread Benjamin Kaplan
On Jan 6, 2013 12:33 PM, "kofi" wrote: > > Using python 3.1, I have written a function called "isEvenDigit" > > Below is the code for the "isEvenDigit" function: > > def isEvenDigit(): > ste=input("Please input a single character string: ") > li=["0","2","4", "6", "8"] > if ste in li:

Re: 3.2 can't extract tarfile produced by 2.7

2012-12-26 Thread Benjamin Kaplan
On Dec 26, 2012 11:00 AM, "Antoon Pardon" wrote: > > I am converting some programs to python 3. These programs manipulate tarfiles. In order for the python3 programs to be really useful > they need to be able to process the tarfiles produced by python2 that however seems to be a problem. > > This

Re: compile python 3.3 with bz2 support

2012-12-22 Thread Benjamin Kaplan
On Dec 21, 2012 1:31 AM, "Isml" <76069...@qq.com> wrote: > > hi, everyone: > I want to compile python 3.3 with bz2 support on RedHat 5.5 but fail to do that. Here is how I do it: > 1. download bzip2 and compile it(make、make -f Makefile_libbz2_so、make install) > 2.chang to python 3.3 sou

Re: Unicode

2012-12-17 Thread Benjamin Kaplan
On Mon, Dec 17, 2012 at 12:59 AM, Anatoli Hristov wrote: >> What happens when you do use UTF-8? > This is the result when I encode the string: > " étroits, en utilisant un portable extrêmement puissant—le plus > petit et le plus léger des HP EliteBook pleine puissance—avec un > écran de di

Re:

2012-12-15 Thread Benjamin Kaplan
On Sat, Dec 15, 2012 at 5:49 PM, Dustin Guerri wrote: > > Hi there, > > I'm new to Python and to programming. is this the right place for me to > post a beginner question on Python use ? > > Many thanks. > You could post questions here, but it would be better to use the Python-tutor list for tha

Re: How to import module whose filename starts number

2012-12-12 Thread Benjamin Kaplan
On Dec 12, 2012 9:47 AM, "Yong Hu" wrote: > > I have a few scripts whose file names start with numbers. For example, 01_step1.py, 02_step2.py > > I tried to import them in another script by "import 01_step1" or "from 01_step1 import *". Both failed, saying "SyntaxError: invalid syntax" > > Is ther

Re: Robust regex

2012-11-19 Thread Benjamin Kaplan
On Nov 19, 2012 12:37 PM, "Joseph L. Casale" wrote: > > Trying to robustly parse a string that will have key/value pairs separated > by three pipes, where each additional key/value (if more than one exists) > will be delineated by four more pipes. > > string = 'key_1|||value_1key_2|||value

Re: Numpy module

2012-10-29 Thread Benjamin Kaplan
On Sun, Oct 28, 2012 at 10:40 PM, wrote: > Hello to the group! > > I've learned a lot about Ubuntu just trying to install numpy for Python > 3.2.3. I've finally managed to put it in the Python3.2 directory but when I > try to import it, I still get there's "no module named numpy." There are >

Re: Nice solution wanted: Hide internal interfaces

2012-10-29 Thread Benjamin Kaplan
On Mon, Oct 29, 2012 at 9:33 AM, Johannes Bauer wrote: > Hi there, > > I'm currently looking for a good solution to the following problem: I > have two classes A and B, which interact with each other and which > interact with the user. Instances of B are always created by A. > > Now I want A to ca

Re: Can't run any script without it failing due to calling tkinter for no reason

2012-10-14 Thread Benjamin Kaplan
On Sun, Oct 14, 2012 at 6:47 PM, wrote: > Hello All, > > > I'm running python 3.2 on Freebsd 9.0 Release and I must've screwed up my > environment somehow, because now I can't run any script without it failing > and throwing: > ** IDLE can't import Tkinter. Your Python may not be configured fo

Re: Can't import modules

2012-09-30 Thread Benjamin Kaplan
On Sun, Sep 30, 2012 at 12:42 PM, Peter Farrell wrote: > Hello! > > I'm still new to Python, so here's another easy one. After I save something > I've done as a .py file, how do I import it into something else I work on? > Every time I try to import something other than turtle or math, I get thi

Re: Installing Pip onto a mac os x system

2012-09-19 Thread Benjamin Kaplan
On Sep 19, 2012 6:37 PM, "John Mordecai Dildy" wrote: > > Does anyone know how to install Pip onto a mac os x ver 10.7.4? > > Ive tried easy_instal pip but it brings up this message (but it doesn't help with my problem): > > error: can't create or remove files in install directory > > The followin

Re: subprocess call is not waiting.

2012-09-19 Thread Benjamin Kaplan
On Sep 19, 2012 9:37 AM, "andrea crotti" wrote: > Well there is a process which has to do two things, monitor > periodically some external conditions (filesystem / db), and launch a > process that can take very long time. > > So I can't put a wait anywhere, or I'll stop everything else. But at >

Re: a python license problem?

2012-09-10 Thread Benjamin Kaplan
On Mon, Sep 10, 2012 at 7:58 PM, Jayden wrote: > Python is under GPL compatible. If I develop a python code, convert it to > executable and distribute the executable as a commercial software. May I need > to make my source code open? > > If python is under GPL, is the answer different? Thanks a

Re: Newbie: where's the new python gone?

2012-09-10 Thread Benjamin Kaplan
On Sun, Sep 9, 2012 at 11:10 PM, Dwight Hutto wrote: > > I have several installations on my windows, so I use > c:\python27_64\python.exe module_file.py > > or > > c:\python26\python.exe module_file.py > > in the command line. > > > Not to show that this shouldn't be a discussion, but usually it's

Re: Is there any difference between print 3 and print '3' in Python ?

2012-09-10 Thread Benjamin Kaplan
On Sun, Sep 9, 2012 at 11:33 PM, Dwight Hutto wrote: > > > On Sun, Sep 9, 2012 at 10:41 AM, Ian Foote wrote: >> >> On 09/09/12 14:23, iMath wrote: >>> >>> 在 2012年3月26日星期一UTC+8下午7时45分26秒,iMath写道: I know the print statement produces the same result when both of these two instructions

Re: Accessing dll

2012-09-06 Thread Benjamin Kaplan
On Sep 6, 2012 8:15 AM, "Helpful person" wrote: > > I am a complete novice to Python. I wish to access a dll that has > been written to be compatible with C and VB6. I have been told that > after running Python I should enter "from ctypes import *" which > allows Python to recognize the dll str

Re: why did the WindowsError occur?

2012-09-04 Thread Benjamin Kaplan
On Tue, Sep 4, 2012 at 11:30 PM, Levi Nie wrote: > my code: > import os > os.startfile(r'C:\Program Files\Internet Explorer.exe') > > the error: > os.startfile(r'C:\Program Files\Internet Explorer.exe') > WindowsError: [Error 2] : 'C:\\Program Files\\Internet Explorer.exe' > There's no such thing

Re: is implemented with id ?

2012-09-04 Thread Benjamin Kaplan
On Tue, Sep 4, 2012 at 11:30 PM, Franck Ditter wrote: > Hi ! > a is b <==> id(a) == id(b) in builtin classes. > Is that true ? > Thanks, > > franck No. It is true that if a is b then id(a) == id(b) but the reverse is not necessarily true. id is only guaranteed to be unique among objects alive

Re: popen4 - get exit status

2012-08-27 Thread Benjamin Kaplan
On Aug 27, 2012 3:47 PM, "Tim Johnson" wrote: > > In bash I do the following: > linus:journal tim$ /home/AKMLS/cgi-bin/perl/processJournal-Photo.pl hiccup > -bash: /home/AKMLS/cgi-bin/perl/processJournal-Photo.pl: No such file or directory > linus:journal tim$ echo $? > 127 > > In python, use os.p

Re: How to convert base 10 to base 2?

2012-08-20 Thread Benjamin Kaplan
On Mon, Aug 20, 2012 at 12:50 AM, wrote: > Hi, > as you can argue from the subject, i'm really,really new to python. > What is the best way to achieve that with python? Because the syntax > int('30',2) doesn't seem to work! That syntax goes the other way- from a string representing a number in

Re: how to fix error "Requires python(abi)=2.4"

2012-08-14 Thread Benjamin Kaplan
On Aug 14, 2012 4:51 AM, "sagarnikam123" wrote: > > i am installing numpy on fedora with python 2.6,2.7 & 3.1 > > > > -- Python bytecode and C interface are not compatible across versions. If you're trying to install a numpy binary that was compiled against 2.4, it won't work with newer versions.

Re: Idle no longer works

2012-08-11 Thread Benjamin Kaplan
On Sat, Aug 11, 2012 at 4:09 PM, Opap-OJ wrote: > I can no longer open the Idle IDE for Python on Windows 7. > > For 3-5 years I used Idle for all my python work. But in January this > happens: > > When I right click on a python file and choose "open with Idle" nothing > happens. > > If I doubl

Re: I thought I understood how import worked...

2012-08-07 Thread Benjamin Kaplan
On Aug 7, 2012 8:41 AM, "Roy Smith" wrote: > > On Tuesday, August 7, 2012 9:55:16 AM UTC-4, Ben Finney wrote: > > > The tutorial is misleading on this. It it says plainly: > > > > A module can contain executable statements as well as function > > definitions. […] They are executed only th

Re: help

2012-07-19 Thread Benjamin Kaplan
On Jul 19, 2012 4:04 PM, "Miriam Gomez Rios" wrote: > > Hello, sorry for bothering you, but I have a doubt, > > Is there a way to turn this string into a tuplelist??, I need it for gurobi > > ('per1','persona1.1','pro1'),('per1','persona1.1','pro2'),('per1','persona1.1','pro3'),('per1','person

Re: how to compile pygtk in python2.7?

2012-07-07 Thread Benjamin Kaplan
On Sat, Jul 7, 2012 at 9:47 PM, contro opinion wrote: > 1.download pygtk > > 2.cd /home/tiger/pygtk-2.24.0 > > 3.PYTHON=/usr/bin/python2.7 ./configure --prefix=/usr > 4. make > 5. make install > > tiger@ocean:~$ python2.7 > Python 2.7.3 (default, Jul 1 2012, 14:13:18) > [GCC 4.4.5] on linux2 >

Re: moving methods from class to instance of other class

2012-06-28 Thread Benjamin Kaplan
On Wed, Jun 27, 2012 at 11:59 PM, lars van gemerden wrote: > Hi all, > > I have some trouble with the following question: Let say i have the > following classes: > > class A(object): >    def __init__(self): >        self.name = 'a' >    def do(self): >        print 'A.do: self.name =', self.name

Re: Is there any way to decode String using unknown codec?

2012-06-27 Thread Benjamin Kaplan
On Wed, Jun 27, 2012 at 6:14 PM, wrote: > Hi > I'm a Korean and when I use modules like sys, os, &c, > sometimes the interpreter show me broken strings like > '\x13\xb3\x12\xc8'. > It mustbe the Korean "alphabet" but I can't decode it to the rightway. > I tried to decode it using codecs like cp94

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-26 Thread Benjamin Kaplan
On Tue, Jun 26, 2012 at 10:19 AM, David Thomas wrote: > I have installed Python 2.7.3 from Python.org also in Terminal it states that > I have 2.7.3. > How can I execute the script from Terminal?  I've tried typing python into > the window and then dragging the file to terminal but I get a synta

Re: Perl __DATA__ construct.

2012-06-25 Thread Benjamin Kaplan
On Mon, Jun 25, 2012 at 2:20 PM, Mladen Gogala wrote: > I have a script in Perl that I need to rewrite to Python. The script > contains __DATA__ at the end of the script, which enables Perl to access > all the data after that through a file descriptor, like this: > > usage() if ( !$stat or !define

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-25 Thread Benjamin Kaplan
On Mon, Jun 25, 2012 at 11:19 AM, David Thomas wrote: > Hello, > This is my first post so go easy on me.  I am just beginning to program using > Python on Mac.  When I try to execute a file using Python Launcher my code > seems to cause an error in terminal, when I execute the exact same piece o

Re: None shown in output

2012-06-21 Thread Benjamin Kaplan
damn On Thu, Jun 21, 2012 at 9:24 PM, Benjamin Kaplan wrote: > On Thu, Jun 21, 2012 at 8:42 PM, Xander Solis wrote: >> Hello Python list, >> >> Noob here with a newbie question. I'm reading and working on the exercise of >> the book, Learn Python the Hard way

Re: None shown in output

2012-06-21 Thread Benjamin Kaplan
On Thu, Jun 21, 2012 at 8:42 PM, Xander Solis wrote: > Hello Python list, > > Noob here with a newbie question. I'm reading and working on the exercise of > the book, Learn Python the Hard way 2.0. When I use this code, I get "None" > on the output. My question is why does this happen? > > def get

Re: "constant sharing" works differently in REPL than in script ?

2012-06-18 Thread Benjamin Kaplan
On Mon, Jun 18, 2012 at 7:52 PM, wrote: > Listening to 'Radio Free Python' episode 8 > (http://radiofreepython.com/episodes/8/ - around about the 30 minute mark) I > heard that Python pre creates some integer constants to avoid a proliferation > of objects with the same value. > > I was intere

Re: Read STDIN as bytes rather than a string

2012-06-18 Thread Benjamin Kaplan
On Mon, Jun 18, 2012 at 4:13 PM, Jason Friedman wrote: > 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 re

Re: Py3.3 unicode literal and input()

2012-06-18 Thread Benjamin Kaplan
On Mon, Jun 18, 2012 at 1:19 AM, jmfauth wrote: > What is input() supposed to return? > u'a' == 'a' > True r1 = input(':') > :a r2 = input(':') > :u'a' r1 == r2 > False type(r1), len(r1) > (, 1) type(r2), len(r2) > (, 4) > > --- > > sys.argv? > > jmf Python

Re: Passing ints to a function

2012-06-08 Thread Benjamin Kaplan
On Fri, Jun 8, 2012 at 7:41 PM, stayvoid wrote: > Hello, > > I want to pass several values to a function which is located on a > server (so I can't change its behavior). > That function only accepts five values which must be ints. > > There are several lists: > a = [1, 2, 3, 4, 5] > b = [5, 4, 3,

Re: Where is the latest step by step guide to use Jython to compilePython into Java?

2012-06-04 Thread Benjamin Kaplan
On Mon, Jun 4, 2012 at 11:47 AM, David Shi wrote: > Hello, Mohan, > > Did you test it?  I am using Windows.  Where are the exact steps for > compiling in DOS? > > Once .class or jar files created, how to use these files? > > Could you enlighten me with tested/proven step by step instructions? > >

Re: Installing Mailman

2012-06-03 Thread Benjamin Kaplan
On Mon, Jun 4, 2012 at 12:49 AM, Chris Rebert wrote: > On Sun, Jun 3, 2012 at 9:04 PM, Janet Heath > wrote: >> checking for --with-python... no >> checking for python... /usr/bin/python >> checking Python interpreter... /usr/bin/python >> checking Python version... 2.7.1 >> checking Python's emai

Re: ./configure

2012-06-03 Thread Benjamin Kaplan
> > Thanks Alain.  I should have a compiler on my Mac OS X Lion.  I am thinking > that it isn't set in my $PATH variable.  I don't know where the $PATH is set > at.  I will check to see if their is a binary. > -- > http://mail.python.org/mailman/listinfo/python-list You need to install the comma

Re: How to import Webkit and object in Official Python (not MacPorts python) without X11.

2012-05-26 Thread Benjamin Kaplan
On Sat, May 26, 2012 at 9:31 AM, Mr.T Beppu wrote: > I think that I will make a browser in Official Python (not MacPorts > Python). > What should I do in order to install Webkit for Official Python (not > MacPorts Python) ? > from tokyo Japan. > You don't just "install WebKit". You need a GUI fra

Re: install python 2.6 on Ubuntu 12.04

2012-05-22 Thread Benjamin Kaplan
On Tue, May 22, 2012 at 8:09 PM, Dan Stromberg wrote: > > If the pythons you require are in synaptic (sudo to root and run synaptic), > you probably can just use them. > > If not, then you, for each release, need to: > 1) download a tarball using a browser or whatever > 2) extract the tarball: tar

Re: %d not working in re at Python 2.7?

2012-05-14 Thread Benjamin Kaplan
On May 14, 2012 7:06 PM, "vacu" wrote: > > I am frustrated to see %d not working in my Python 2.7 re.search, like > this example: > > >>> (re.search('%d', "asdfdsf78asdfdf")).group(0) > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'NoneType' object has no attribute

Re: Some posts do not show up in Google Groups

2012-04-29 Thread Benjamin Kaplan
On Mon, Apr 30, 2012 at 2:20 AM, Frank Millman wrote: > > Hi all > > For a while now I have been using Google Groups to read this group, but on > the odd occasion when I want to post a message, I use Outlook Express, as I > know that some people reject all messages from Google Groups due to the hi

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Benjamin Kaplan
On Mon, Apr 23, 2012 at 1:01 PM, Paul Rubin wrote: > > Kiuhnm writes: > > I can't think of a single case where 'is' is ill-defined. > > If I can't predict the output of > >    print (20+30 is 30+20)  # check whether addition is commutative >    print (20*30 is 30*20)  # check whether multiplicati

Re: system call that is killed after n seconds if not finished

2012-04-16 Thread Benjamin Kaplan
On Mon, Apr 16, 2012 at 10:51 AM, Jaroslav Dobrek wrote: > > Hello, > > I would like to execute shell commands, but only if their execution > time is not longer than n seconds. Like so: > > monitor(os.system("do_something"), 5) > > I.e. the command do_somthing should be executed by the operating >

Re: trac.util

2012-04-11 Thread Benjamin Kaplan
On Wed, Apr 11, 2012 at 4:52 PM, cerr wrote: > > Hi, > > I want to install some python driver on my system that requires trac.util > (from Image.py) but I can't find that anywhere, any suggestions, anyone? > > Thank you very much, any help is appreciated! > > Error: > File "/root/weewx/bin/Image.p

Re: Question on Python 3 shell restarting

2012-04-10 Thread Benjamin Kaplan
On Tue, Apr 10, 2012 at 2:36 PM, Franck Ditter wrote: > In article > <19745339.1683.1333981625966.JavaMail.geo-discussion-forums@yncc41>, >  Miki Tebeka wrote: > >> > How may I get a fresh Python shell with Idle 3.2 ? >> Open the configuration panel (Options -> Configure IDLE). >> Look in the "Ke

Re: Run once while loop

2012-04-04 Thread Benjamin Kaplan
On Wed, Apr 4, 2012 at 9:21 AM, Anatoli Hristov wrote: > I thing the best will be if I use hundreds of the seconds to print the > message. > > for example at 12:00:00:10, but unfortunately I cant see that I can use > hundreds of the seconds. > > Does anyone knows if I can use it ? > > Thanks > > A

Re: Installing Python Apps on Mac Lion

2012-03-13 Thread Benjamin Kaplan
On Tue, Mar 13, 2012 at 12:42 PM, wrote: > > Sábado, 25 de Junho de 2011 02h20min49s UTC+1, JKPeck escreveu: > > The Lion version of the OS on the Mac comes with Python 2.7 installed, > > but it is in /System/Library/Frameworks/..., and this area is not writable > > by third party apps. > > > > So

Re: What's the best way to write this regular expression?

2012-03-07 Thread Benjamin Kaplan
On Wed, Mar 7, 2012 at 4:11 PM, John Salerno wrote: > > On Wed, Mar 7, 2012 at 3:01 PM, Ian Kelly wrote: > > > There is a fork of setuptools called "distribute" that supports Python > > 3. > > Thanks, I guess I'll give this a try tonight! > > > setup.py is a file that should be included at the to

  1   2   3   4   5   6   7   8   >