Re: Persistent api-ms-win-crt-runtime-i1-1-0.dll start up error

2015-11-24 Thread eryksun
On Tue, Nov 24, 2015 at 3:54 AM, Laura Creighton wrote: > In a message of Tue, 24 Nov 2015 10:56:32 +0200, > tolga.karabiyiko...@ankara.edu > >>The question is i am receiving 'api-ms-win-crt-runtime-i1-1-0.dll is >>missing' error on the start up. > > You appear to have this problem. > > https://b

Re: non-blocking getkey?

2015-11-20 Thread eryksun
On Thu, Nov 19, 2015 at 10:31 AM, Michael Torrie wrote: > One windows it might be possible to use the win32 api to enumerate the > windows, find your console window and switch to it. You can call GetConsoleWindow [1] and then SetForegroundWindow [2]. import os import sys try:

Re: non-blocking getkey?

2015-11-18 Thread eryksun
On Wed, Nov 18, 2015 at 3:14 AM, Christian Gollwitzer wrote: > The standard terminal on Windows is very ugly, can't resize the width, and > pasting works only if you right-click -> paste. The console UI is improved in Windows 10: http://blogs.windows.com/buildingapps/2014/10/07/console-improvemen

Re: Launcher, and ftype Python.File

2015-11-18 Thread eryksun
On Wed, Nov 18, 2015 at 8:45 AM, Christian Ullrich wrote: > Apparently %L is always the long file name, and %1 is the short name unless > the shell can prove that the executable can handle long names. Specifically old Win16 programs (identified by the file header) aren't aware of long filenames.

Re: What meaning is of '#!python'?

2015-11-14 Thread eryksun
On Sat, Nov 14, 2015 at 8:26 PM, Zachary Ware wrote: > > "#!python" is a valid shebang for the Python Launcher for Windows. > It's also a not-too-terrible placeholder for a Unix shebang meaning > "whichever Python you want it to be". The better choice for use with > both platforms would be "#!/us

Re: A high-level cross-platform API for terminal/console access

2015-10-21 Thread eryksun
On 10/21/15, Peter Brittain wrote: >> >> Did you try https://pypi.python.org/pypi/UniCurses ? >> > > Yes - it failed to install with pip and also looked like a dead project when > I followed the project home page URL. > -- > https://mail.python.org/mailman/listinfo/python-list > Also check out th

Re: help(string) commands not working on pyton 3.5

2015-10-16 Thread eryksun
On 10/16/15, Prasad Joshi wrote: > > I am using windows 10. > import math help (math) > 'more' is not recognized as an internal or external command, > operable program or batch file. What do you get for the following? import os windir = os.environ['SystemRoot'] mo

Re: Installed 3.5.0 successfully on Windows 10, but where is DDLs, Doc, Lib, etc?

2015-10-15 Thread eryksun
On 10/15/15, Gisle Vanem wrote: > > Thanks for the detailed info. I fixed some paths under: >HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.5-32 > > Now my Python3.5 almost works. But something is wrong with the > Python3 sys.prefix: >c:> py -2 -c "import os, sys; print(sys.prefix)" >

Re: Installed 3.5.0 successfully on Windows 10, but where is DDLs, Doc, Lib, etc?

2015-10-15 Thread eryksun
On 10/15/15, Gisle Vanem wrote: > > This is non-sense. I do have Python2 + 3 both on PATH (but both 32-bits). > Not sure if PyLauncher looks for 64-bit registry entries only. Running "py -3" doesn't use PATH. The launcher only uses PATH when evaluating "/usr/bin/env" in a virtual shebang, e.g. "#

Re: help(string) commands not working on pyton 3.5

2015-10-15 Thread eryksun
On 10/14/15, Prasad Joshi wrote: > Hi, > > I have installed the "Windows x86-64 executable > installer" > on my desktop but I cannot get help ( ) or help (string) command working. > What could be an issue? > It may help to know which

Re: Installed 3.5.0 successfully on Windows 10, but where is DDLs, Doc, Lib, etc?

2015-10-14 Thread eryksun
On 10/14/15, Zachary Ware wrote: > > You can find where Python is installed using Python itself: try `py > -3.5 -c "import sys, os;os.system('explorer ' + sys.prefix)"` at the > Command Prompt, Here's a slightly simpler way to open the folder: py -3.5 -c "import os, sys; os.startfile(sys.pre

Re: Installation problem

2015-10-08 Thread eryksun
On 10/8/15, Oscar Benjamin wrote: > On Thu, 8 Oct 2015 22:30 eryksun wrote: > > The new installer for 3.5 doesn't create an "App Paths" key for > "python.exe" like the old installer used to do (see the old > Tools/msi/msi.py). Without that, unless py

Re: Installation problem

2015-10-08 Thread eryksun
On 10/8/15, Tim Golden wrote: > > What happens if you do [Windows] + R (ie Start > Run), enter "python" > and click OK? The new installer for 3.5 doesn't create an "App Paths" key for "python.exe" like the old installer used to do (see the old Tools/msi/msi.py). Without that, unless python.exe is

Re: Error code 0x80070570

2015-09-30 Thread eryksun
On 9/30/15, Rusiri Jayalath wrote: > Error code 0x80070570 appears when installing python 3.5.0 (32-bit) setup > for my windows 8.1 system. Please help me to solve this problem. 0x80070570 is ERROR_FILE_CORRUPT: the file or directory is corrupted and unreadable. It could be an intermittent proble

Re: Beginning question #compilersetup, #windows7, #vs2010

2015-09-27 Thread eryksun
On Sat, Sep 26, 2015 at 4:40 PM, Jeff VanderDoes wrote: > > I'm fairly new to Python and was excited to start playing with it until I > ran into need to compile some extensions under windows 7 64 bit. I've done > some searching but after more hours than I care to count being unsuccessful > settin

Re: Failed to upgrade pip in fresh 2.7 install

2015-09-26 Thread eryksun
On 9/26/15, Zachary Ware wrote: > On Sat, Sep 26, 2015 at 1:13 PM, wrote: >> After a fresh install of Python 2.7 32-bit and 64-bit, upgrading pip >> using pip fails. Am I doing this incorrectly? Any suggestions? > > This is a limitation of Windows: you can't replace the executable that > you're

Re: .bat file trouble.

2015-09-20 Thread eryksun
On 9/18/15, Christian Gollwitzer wrote: > Am 18.09.15 um 11:06 schrieb bobert...@googlemail.com: > >> We originally thought that it was because it was missing the files: >> process_init.py and process_global_variables.py however they are >> right there in the same directory. > > Concerning that, w

Re: Need Help w. PIP!

2015-09-04 Thread eryksun
On Fri, Sep 4, 2015 at 10:07 PM, Steve Burrus wrote: > well everyone there must be sometjhing about upgrading Python up to version > 3.5 rc > because everything works just fine now, beyond my wildest dreams! I am even > able > now to type in "pip" and get the usual info. on it and I have connect

Re: Need Help w. PIP!

2015-09-04 Thread eryksun
On Fri, Sep 4, 2015 at 11:35 AM, Steve Burrus wrote: > > "C:\Users\SteveB>py -m pip > Job information querying failed You're using build 10074, an old build of Windows 10 that had a buggy Job object API. This was fixed in build 10159: http://bugs.python.org/issue24127 FYI, the py launcher runs

Re: Need Help w. PIP!

2015-09-04 Thread eryksun
On Fri, Sep 4, 2015 at 5:10 PM, Steve Burrus wrote: > so what is my hopefully sinple solution anyway? i do n't see myself anytime > soon getting off of Build 10074 of Win 10. Script wrappers such as pip.exe are simple versions of the py launcher that execute an embedded script. For example, here'

Re: [Tutor] Convert Qstring to string in windows

2014-10-17 Thread eryksun
On Thu, Oct 16, 2014 at 10:21 AM, C@rlos wrote: > in linux i do for this way: > pythonstringtext=qstringtext.text().toUtf8.data() > and it return a python string correctly. pythonstringtext is a byte string that has to be decoded as UTF-8. Here's the 'mojibake' result when it gets decoded as UTF-

Re: fighting game made with python

2011-04-07 Thread eryksun ()
On Thursday, April 7, 2011 9:51:05 AM UTC-4, neil harper wrote: > is there any fighting games(street fighter, mortal kombat, etc) made in > python? I found a 2D pygame (SDL) fighter called "fighter framework", which is basically karate sparring. http://www.pygame.org/project-fighter+framework-1

Re: Python and DDE

2011-04-07 Thread eryksun ()
On Wednesday, April 6, 2011 3:37:34 PM UTC-4, Robert Upton wrote: > Dear Pythoners, > > I am attempting to get the DDE module to import into Python and am > having some trouble. I have downloaded and installed the pywin32 > extensions for Python 2.6, which is the version of python I am running >

Re: Python benefits over Cobra

2011-04-07 Thread eryksun ()
On Thursday, April 7, 2011 2:43:09 AM UTC-4, Steven D'Aprano wrote: > On Thu, 07 Apr 2011 00:25:46 -0500, harrismh777 wrote: > > > The gnu suite of tools and the linux kernel were the keys to unlocking > > Microsoft lock-in... brilliant technologies for innovation and freedom. > > I used to belie

Re: Spam on the mailing list

2011-04-07 Thread eryksun ()
On Wednesday, April 6, 2011 11:03:31 AM UTC-4, Chris Angelico wrote: > I don't know whether it's ironic or in some way Pythonesque, but this > is the only mailing list that I've seen significant amounts of spam > on... My impression is that there is much more spam on comp.lang.python than on the

Re: TypeError: iterable argument required

2011-04-06 Thread eryksun ()
On Wednesday, April 6, 2011 3:21:42 PM UTC-4, Νικόλαος Κούρας wrote: > On 6 Απρ, 19:58, "eryksun ()" wrote: > > > The expression ``x or y`` first evaluates *x*; if *x* is > > true, its value is returned; otherwise, *y* is evaluated > > and the resulting value is

Re: TypeError: iterable argument required

2011-04-06 Thread eryksun ()
On Wednesday, April 6, 2011 11:57:32 AM UTC-4, Νικόλαος Κούρας wrote: > >>> mail = None > >>> mail = mail or 7 > >>> mail > 7 Quote: The expression ``x or y`` first evaluates *x*; if *x* is true, its value is returned; otherwise, *y* is evaluated and the resulting value is returned. Since 'mail

Re: TypeError: iterable argument required

2011-04-06 Thread eryksun ()
On Wednesday, April 6, 2011 11:41:24 AM UTC-4, Νικόλαος Κούρας wrote: > On 6 Απρ, 16:54, "eryksun ()" wrote: > > > You can also use an empty string as the default value when getting the > > field value > > Please provide me an example. import cgi form = cgi.F

Re: TypeError: iterable argument required

2011-04-06 Thread eryksun ()
On Wednesday, April 6, 2011 6:06:06 AM UTC-4, Νικόλαος Κούρας wrote: > > The trouble was in `if "@" in mail` . > You can only test somthing `in` something else if the second thing is > iterable and None isnt. > > So i made the code look like this: > > [code] > if ( mail is not None and '@' in mai

Re: 3D subfigures in matplotlib?

2011-04-05 Thread eryksun ()
On Tuesday, April 5, 2011 6:17:34 AM UTC-4, MATLABdude wrote: > How can I make maybe 3D subfigures with Python and matplotlib? > > I found the following example (http://matplotlib.sourceforge.net/ > examples/mplot3d/subplot3d_demo.html), but it doesn't work. > > [snip] > > I am using Python 2.6.6

Re: TypeError: iterable argument required

2011-04-04 Thread eryksun ()
On Monday, April 4, 2011 9:40:33 AM UTC-4, Νικόλαος Κούρας wrote: In one of your messages you wrote the following: > cursor.execute( '''INSERT INTO users(mail, comment) VALUES(%s, > %s)''', (mail, comment) ) > except MySQLdb.Error: > print ( "Error %d: %s" % (e.args[0], e.args[1]) ) Is this a ty

Re: TypeError: iterable argument required

2011-04-03 Thread eryksun ()
On Saturday, April 2, 2011 12:26:18 PM UTC-4, Νικόλαος Κούρας wrote: > Hello, after inserting this line if "@" in mail and comment not in > ("Σχολιάστε ή ρωτήστε με σχετικά", ""): > > iam getting the following error which i dont understand > > *

Re: Sending keystrokes to Windows exe programs

2011-04-02 Thread eryksun ()
On Saturday, April 2, 2011 12:48:44 PM UTC-4, Alex van der Spek wrote: > > I can start a windows program on Vista with: > > >>> import subprocess > >>> dva=subprocess.Popen(DVAname,stdin=subprocess.PIPE) > > Unfortunately sending keystrokes with communicate() does not appear to work: > > >>> dva

Re: PyVISA

2011-04-01 Thread eryksun ()
On Friday, April 1, 2011 10:24:58 PM UTC-4, Manatee wrote: > > VisaIOError: VI_ERROR_INTF_NUM_NCONFIG: The interface type is valid > but the specified interface number is not configured. > > My instrument is on GPIB 5 and I can do a *IDN? with another program > and get a response. So I must still

Re: Alphabetics respect to a given locale

2011-04-01 Thread eryksun ()
On Friday, April 1, 2011 4:55:42 PM UTC-4, candide wrote: > > How to retrieve the list of all characters defined as alphabetic for the > current locale ? Give this a shot: In [1]: import string In [2]: print string.letters abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ In [3]: import lo

Re: newbie question

2011-04-01 Thread eryksun ()
Regarding the format of your post, please use plain text only. On Friday, April 1, 2011 3:52:24 PM UTC-4, Karl wrote: > > aList = [0, 1, 2, 3, 4] > bList = [2*i for i in aList] > sum = 0 > for j in bList: > sum = sum + bList[j] > print j > > 0 > 2 > 4 > > IndexError: list index out of

Re: PyVISA

2011-04-01 Thread eryksun ()
On Friday, April 1, 2011 3:40:23 PM UTC-4, Manatee wrote: > > Well, ok, I'll try some of that. But I am running window 7, not Linux. > The "sudo" command sounds like Linux. Again, there's a win32 exe installer available here: http://sourceforge.net/projects/pyvisa/files/PyVISA/1.3/PyVISA-1.3.win

Re: PyVISA

2011-04-01 Thread eryksun ()
On Friday, April 1, 2011 11:29:10 AM UTC-4, Manatee wrote: > I have unpacked the PyVISA files into the Python/lib/site-packages dir > and from the IDLE GUI I get and error > > import visa > > Traceback (most recent call last): > File " > ", line 1, in > import visa > ImportError: No module

Re: A problem about ipython

2011-04-01 Thread eryksun ()
On Thursday, March 31, 2011 9:48:27 PM UTC-4, Vincent Ren wrote: > > when I run this(from Programming Python 3rd) in ipython, I'll > get a NameError: > > > /usr/lib/python2.6/profile.pyc in runctx(self, cmd, globals, locals) > 460 sys.setprofile(self.dispatcher) > 461

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread eryksun ()
On Thursday, March 31, 2011 4:35:42 PM UTC-4, Chris Angelico wrote: > > I was trolling, I know the reasons behind it. Anyway, most people > don't share code by email! (Actually, since you seem to be the author > of that page - could you address that particular point? I think it's > probably as big

Re: multiprocessing Pool.imap broken?

2011-03-31 Thread eryksun ()
p://stackoverflow.com/questions/5481104/multiprocessing-pool-imap-broken/5481610#5481610 > > On Wed, Mar 30, 2011 at 5:59 AM, eryksun () wrote: > > On Tuesday, March 29, 2011 9:44:21 PM UTC-4, Yang Zhang wrote: > >> I've tried both the multiprocessing included in the python2.6

Re: Learn Python the Hardway exercise 11 question 4

2011-03-31 Thread eryksun ()
On Wednesday, March 30, 2011 11:03:09 PM UTC-4, JosephS wrote: > print "How old are you?", age = raw_input() > print "How tall are you?", height = raw_input() > print "How much do you weigh?", weight = raw_input() > print "So, you're %r old, %r tall and %r heavy." % ( age, height, > weight) > Note:

Re: popular programs made in python?

2011-03-30 Thread eryksun ()
On Tuesday, March 29, 2011 10:32:26 AM UTC-4, Neil Alt wrote: > i mean made with python only, not just a small part of python. I think it's uncommon for an application to be programmed entirely in Python. It's common to use C/C++ to accelerate performance critical parts of the code. I don't see

Re: Sudden error: SyntaxError: Non-ASCII character '\xc2' in file

2011-03-30 Thread eryksun ()
On Wednesday, March 30, 2011 10:34:46 AM UTC-4, Gnarlodious wrote: > > The error originates at '·' which string contains a · > character. > > Complete error message is: > > SyntaxError: Non-ASCII character '\xc2' in file /Library/WebServer/ > Sites/Sectrum/Site/Feed.py on line 17, but no encodin

Re: learn python the hard way exercise 42 help

2011-03-30 Thread eryksun ()
On Wednesday, March 30, 2011 9:48:29 AM UTC-4, neil harper wrote: > http://pastie.org/1735028 > hey guys play is confusing me, i get how next gets the first room, which > is passed when the instance of Game() is created, but how does it get > the next room? > > thanks Each room is a method of Gam

Re: multiprocessing Pool.imap broken?

2011-03-30 Thread eryksun ()
On Tuesday, March 29, 2011 9:44:21 PM UTC-4, Yang Zhang wrote: > I've tried both the multiprocessing included in the python2.6 Ubuntu > package (__version__ says 0.70a1) and the latest from PyPI (2.6.2.1). > In both cases I don't know how to use imap correctly - it causes the > entire interpreter t

Re: Directly Executable Files in Python

2011-03-30 Thread eryksun ()
On Tuesday, March 29, 2011 3:51:30 AM UTC-4, Paul Rudin wrote: > Benjamin Kaplan writes: > > > If you can figure out a good way to compile a language like Python, > > you'll be very rich. Yes, it is running the interpreter and then > > running the bytecode on the interpreter. It's the same way Ja

Re: [pyplot] using f1=figure(1)

2011-03-30 Thread eryksun ()
On Monday, March 28, 2011 12:04:02 PM UTC-4, Giacomo Boffi wrote: > > >>> f1=figure(1) > >>> f2=figure(2) > >>> f1 > > >>> f2 > > >>> plot(sin(linspace(0,10)),figure=f1) > [] > >>> plot(cos(linspace(0,10)),figure=f2) > [] > >>> show() You can set the current figure to fig1 with the following:

Re: how to create a virtual printer

2011-03-29 Thread eryksun ()
On Monday, March 28, 2011 7:12:23 AM UTC-4, kalo...@gmail.com wrote: > > Does anybody know how to create a virtual > printer with python (on both windows and linux)? Here's some code I just put together showing how to use Python to create a PostScript file printer on Windows, output raw text to

Re: embedding interactive python interpreter

2011-03-27 Thread eryksun ()
On Sunday, March 27, 2011 11:06:47 PM UTC-4, Eric Frederich wrote: > I'm not sure that I know how to run this function in such a way that > it gives me an interactive session. > I passed in stdin as the first parameter and NULL as the second and > I'd get seg faults when running exit() or even imnp

Re: Data files for tests

2011-03-27 Thread eryksun ()
On Sunday, March 27, 2011 7:33:22 PM UTC-4, eryksun () wrote: > On Sunday, March 27, 2011 7:07:33 PM UTC-4, Steven D'Aprano wrote: > > I have a package with some tests. The tests are not part of the package > > itself, so I have a laid out my files like this: > >

Re: Data files for tests

2011-03-27 Thread eryksun ()
On Sunday, March 27, 2011 7:07:33 PM UTC-4, Steven D'Aprano wrote: > I have a package with some tests. The tests are not part of the package > itself, so I have a laid out my files like this: > > > src/ > spam/ > __init__.py > other-files.py > test_spam.py > > > Some of

Re: Standard way to distribute utilities with packages

2011-03-27 Thread eryksun ()
On Sunday, March 27, 2011 4:05:30 PM UTC-4, Laszlo Nagy wrote: > I'd like to distribute a pure Python package named "foo". By default it > will be placed in lib/site-packages/foo. What if I want to add > utilities? Command line or GUI programs that are not full featured > applications, but they

Re: embedding interactive python interpreter

2011-03-27 Thread eryksun ()
On Friday, March 25, 2011 12:02:16 PM UTC-4, Eric Frederich wrote: > > Is there something else I should call besides "exit()" from within the > interpreter? > Is there something other than Py_Main that I should be calling? Does PyRun_InteractiveLoop also have this problem? -- http://mail.python.o

Re: why memoizing is faster

2011-03-26 Thread eryksun ()
On Saturday, March 26, 2011 11:49:02 AM UTC-4, Steven D'Aprano wrote: > > > > def fib(n): > > phi = (5 ** 0.5 + 1) / 2 > > f = (phi ** n - (1 - phi) ** n) / 5 ** 0.5 > > return int(f) > > Have you tried it? > > Unfortunately, with floating point rounding error, that r

Re: why memoizing is faster

2011-03-26 Thread eryksun ()
On Saturday, March 26, 2011 7:50:36 AM UTC-4, Steven D'Aprano wrote: > > That's of the order of 200 MB of memory -- not that much for today's > systems. I've had people email me .doc files that big *wink* Yikes! I know this thread is about caching the output of a function, but in the example of

Re: Writing to a file

2011-03-25 Thread eryksun ()
On Friday, March 25, 2011 9:39:11 PM UTC-4, Littlefield, Tyler wrote: > >with open(test_absname, 'w') as test: > what's the difference in that and test = ...? I can see why you > mentioned the os.path for cross-platform, but I don't understand why > someone would use with over =. It avoids h

Re: Writing to a file

2011-03-25 Thread eryksun ()
On Friday, March 25, 2011 11:07:19 AM UTC-4, jyou...@kc.rr.com wrote: > > >>> f = open('~/Desktop/test.txt', 'w') > >>> f.write('testing 1... 2... 3...') > >>> f.close() Consider using "with" to automatically close the file and os.path for cross-platform compatibility: import os.path use

Re: python 2.7.1 "serial" vs "pyserial"

2011-03-25 Thread eryksun ()
On 3/25/2011 7:27 AM, bruce bushby wrote: > > Is there any difference between the "serial" module in Python 2.7.1 and > "pyserial 2.5" ? I've never used it, but "pyserial" is actually "serial": http://pyserial.sourceforge.net I have it installed on my system via Christoph Gohlke's "Base" distri

Re: why memoizing is faster

2011-03-25 Thread eryksun ()
On Friday, March 25, 2011 6:53:48 AM UTC-4, Andrea Crotti wrote: > > I had never seen such a thing, but why would this make sense at all? > When does it make sense logically for a function to have an attribute? > > A function should have some input, some local variables to compute > temporary resu

Re: why memoizing is faster

2011-03-25 Thread eryksun ()
On Thursday, March 24, 2011 8:12:22 PM UTC-4, Terry Reedy wrote: > > If Python did what some have asked, which is to make 'recursive' > functions actually recursive by replacing a local variable that matches > the function name (in this 'fib') with a direct reference to the > function itself, as

Re: python time

2011-03-20 Thread eryksun ()
On Monday, March 21, 2011 12:07:13 AM UTC-4, ecu_jon wrote: > so then why does this not work ? > > import time > ... > time = config.get("myvars", "time") > ... > while a>0: > #import time > time.sleep(2) > > if i uncomment the import time line in the while loop it works. > boggle... An i

Re: import newer

2011-03-20 Thread eryksun ()
On Sunday, March 20, 2011 12:27:38 AM UTC-4, xinyou yan wrote: > I begin to study with <> > > I met a problem with import. > > first > I creat a file hello.py > > then in fedora /14 > I type python to the interpreter > > >>> import hello > Traceback (most recent call last): > File "", lin

Re: Abend with cls.__repr__ = cls.__str__ on Windows.

2011-03-18 Thread eryksun ()
On Thursday, March 17, 2011 8:24:36 PM UTC-4, J Peyret wrote: > > I suspect that object.__str__ is really object.__repr__ by default, as > they both print out the same string, so that this doesn't make any > sense. They're not the same object, and they don't have all of the same methods. In [1]:

Re: Fitting polynomial curve

2011-03-18 Thread eryksun ()
On 3/17/2011 1:42 AM, Astan Chee wrote: > > I have 2 points in 3D space and a bunch of points in-between them. I'm > trying to fit a polynomial curve on it. Currently I'm looking through > numpy but I don't think the function exists to fit a function like this: > y = ax**4 + bx**3 + cx**2 + dx + e

Re: PEP for module naming conventions

2011-03-17 Thread eryksun ()
On Friday, March 11, 2011 4:52:57 PM UTC-5, Tim Johnson wrote: > I need to be better informed on naming conventions for modules. For > instance, I need to create a new module and I want to make sure that > the module name will not conflict with any future or current python > system module names.

Re: organizing many python scripts, in a large corporate environment.

2011-03-17 Thread eryksun ()
On Wednesday, March 16, 2011 9:03:19 PM UTC-4, bukzor wrote: > > I finally understand. You mean something along the lines of `kde- > config`: an executable to help figure out the configuration at > runtime. This requires either installation or control of the $PATH > environment variable to work wel

Re: Memory Usage of Strings

2011-03-16 Thread eryksun ()
On Wednesday, March 16, 2011 2:20:34 PM UTC-4, Amit Dev wrote: > > sum(map(len, l)) => 8200 for 1st case and 9100 for 2nd case. > Roughly 100MB as I mentioned. The two lists used approximately the same memory in my test with Python 2.6.6 on Windows. An implementation detail such as this

Re: organizing many python scripts, in a large corporate environment.

2011-03-16 Thread eryksun ()
On Tuesday, March 15, 2011 12:44:48 AM UTC-4, bukzor wrote: > > Currently it requires either: 1) no symlinks to scripts or 2) > installation of the pathtools to site-packages. An executable with a unique name on the system PATH could be executed it as a subprocess that pipes the configured base d

Re: Get Path of current Script

2011-03-15 Thread eryksun ()
On Tuesday, March 15, 2011 9:47:17 AM UTC-4, Mario Rol wrote: > > os.path.join(sys.path[0], 'config.txt') > > If the script and config.txt are in /tmp this will return '/tmp/ > config.txt' no matter from which directory you started the script. You have to be careful about symlinks. Even Windows

Re: organizing many python scripts, in a large corporate environment.

2011-03-15 Thread eryksun ()
On Tuesday, March 15, 2011 12:44:48 AM UTC-4, bukzor wrote: > When looking at google code search, this kind of code is > rampant (below). Is everyone really happy with this? > > sys.path.insert(0, > os.path.dirname(os.path.dirname( > os.path.dirname(os.path.abspath(__file__)

Re: Get Path of current Script

2011-03-14 Thread eryksun ()
On Monday, March 14, 2011 5:17:49 PM UTC-4, Grant Edwards wrote: > > Indeed that is very common, and there's been a "standard" way to do > that since before dirt. > > The standard on Unix is to look in the following places in (this > order), and use the first one you find: On Windows it's typical

Re: organizing many python scripts, in a large corporate environment.

2011-03-14 Thread eryksun ()
On Monday, March 14, 2011 3:56:15 PM UTC-4, eryksun () wrote: > To be clear on the file structure, I'm picturing that 'base' is a > path on each user's shell path where all the accessible scripts > are linked, and that this is also the package directory. Wait, th

Re: organizing many python scripts, in a large corporate environment.

2011-03-14 Thread eryksun ()
On Monday, March 14, 2011 9:45:51 AM UTC-4, eryksun () wrote: > > If you're linking to a common file, couldn't you just add in > the base folder there? > > ... > > # script.py > import _path # _path.py is a symbolic link > > # _path.py: > ba

Re: organizing many python scripts, in a large corporate environment.

2011-03-14 Thread eryksun ()
On Monday, March 14, 2011 2:38:50 AM UTC-4, bukzor wrote: > I've written this many times. It has issues. In fact, I've created a > library for this purpose, for the following reasons. If you're linking to a common file, couldn't you just add in the base folder there? I don't think it's a bad pra

Re: Get Path of current Script

2011-03-14 Thread eryksun ()
On Monday, March 14, 2011 5:53:25 AM UTC-4, Alain Ketterlin wrote: > sys.path[0] is the path to the directory containing the script that the > interpreter started with. How about os.path.dirname(os.path.realpath(sys.argv[0]))? I think realpath is required in case someone runs it from a symlink.

Re: organizing many python scripts, in a large corporate environment.

2011-03-13 Thread eryksun ()
On Sunday, March 13, 2011 7:27:47 PM UTC-4, bukzor wrote: > e) create custom boilerplate in each script that addresses the > issues in a-d. This seems to be the best practice at the moment... The boilerplate should be pretty simple. For example, if the base path is the parent directory, the

Re: organizing many python scripts, in a large corporate environment.

2011-03-12 Thread eryksun ()
bukzor wrote: > This only works if you can edit the PYTHONPATH. With thousands of > users and dozens of groups each with their own custom environments, > this is a herculean effort. It works for me without setting PYTHONPATH. Again, I run the module from the root folder with the -m option as a pa

Re: organizing many python scripts, in a large corporate environment.

2011-03-11 Thread eryksun ()
I'm not an expert at Python packaging, but assuming a structure such as folder1 \ __init__.py module1.py folder2 \ __init__.py module2.py Then from the root folder I can run python -m folder1.module1 and within module1, I can import from module2, e