[Tutor] Is nesting functions only for data hiding overkill?

2019-08-21 Thread James Hartley
Yes, nesting functions is valuable & necessary for closures and wrapping functions for creating properties. But is nesting, simply for hiding data, a preferred solution? I have a number of member functions which are prefaced with underscores pointing out that they should not be called by client c

[Tutor] Is nesting functions only for data hiding overkill?

2019-08-21 Thread James Hartley
Yes, nesting functions is valuable & necessary for closures and wrapping functions for creating properties. But is nesting, simply for hiding data, a preferred solution? I have a number of member functions which are prefaced with underscores pointing out that they should not _

[Tutor] class functions/staticmethod?

2019-08-11 Thread James Hartley
I am lacking in understanding of the @staticmethod property. Explanation(s)/links might be helpful. I have not found the descriptions found in the Internet wild to be particularly instructive. Given the code below: =8<-- from collections import namedtuple class Foo(): Dim

[Tutor] Inserting long URL's into comments & docstrings?

2019-07-29 Thread James Hartley
This should be a slow ball pitch. Unfortunately, I haven't stumbled across a reasonable answer yet. On occasion, I put long URL's into comments/docstrings simply to document where I found specific information. However, to be a good disciple of PEP8, anything which can't fit within 72 characters

[Tutor] raising exceptions in constructor code?

2019-07-16 Thread James Hartley
I ask this having more C++ knowledge than sense. There is an adage in the halls of everything Stroustrup that one needs to think about how resource allocation will be unwound if an exception is thrown. This gets watered down to the mantra "Don't throw exceptions from within constructors." Does t

[Tutor] Lengthy copyright notices?

2019-07-15 Thread James Hartley
help(module_name) will place any text in the *first* module-level docstring into the description section of the help page in Python 3.4.5. Subsequent docstrings found at module level are ignored. I have been using this factoid for placement of a copyright & licensing notice. By placing a rather

[Tutor] directory structure with tests?

2019-03-06 Thread James Hartley
It is preferable to sprinkle tests files throughout the directories of a project, or coalesce all tests in a test directory? Thanks! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/li

Re: [Tutor] Beginners Book, Python and PyScripter

2018-12-05 Thread James Stapleton-Cotton
ss given by the book mentioned above. Regards On Tue, Dec 4, 2018 at 9:16 PM Adam Eyring wrote: > I haven't gone through many python books, but have been using a copy of > Automating the Boring Stuff with Python. It covers lists, dictionaries, > scraping data from websites, etc. &g

Re: [Tutor] Beginners Book, Python and PyScripter

2018-12-04 Thread James Stapleton-Cotton
Thank you Mats and Steven. I'm back on track now with a different tutorial which has lead to me to the relevant coding tools. https://wiki.python.org/moin/BeginnersGuide/NonProgrammers https://python.swaroopch.com On Mon, Dec 3, 2018 at 4:04 PM Mats Wichmann wrote: > On 12/3/18 3:35 A

[Tutor] Beginners Book, Python and PyScripter

2018-12-03 Thread James Stapleton-Cotton
file that opens is the Python Shell. I am really confused as to whether or not PyScripter works on Mac OS or if I'm missing a step in the installation process? I hope I have been clear in my query. I look forward to hearing from you. Regards, James ___

Re: [Tutor] Need help in learning Python

2018-08-12 Thread James Gledhill via Tutor
I know this is a python focused mail group, but you asked about Linux so I'll answer. :-) I would strongly recommend that you skip Kali Linux for the next little while. Every tool available on Kali can be obtained on Ubuntu. Kali is not beginner friendly, and while the community is great, honest

Re: [Tutor] Using pip

2018-07-05 Thread James Reynolds
". env/bin/activate". If you are windows it would be "env\Scripts\activate" Once activated, you can install your package like: pip install pyvisa you may also enjoy using ipython (pip install ipython) for this kind of use case. James ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Working example of using SSL:

2018-06-22 Thread James Lundy
Can any one get me started with SSL by providing a working example with some documentation? God Bless: James Lundy jalu...@computer.org<mailto:jalu...@computer.org> ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription o

Re: [Tutor] calling printf() in a C language DLL using ctypes.CDLL

2018-05-09 Thread James Chapman
A long time ago when I was working with Python and DLLs I slapped together a basic and ugly example. You can find it here: https://github.com/James-Chapman/python-code-snippets/ tree/master/DLL_C_funcs_w_callbacks The whole thing should load into Visual Studio. I can't guarantee that it wor

[Tutor] List vs. Set:

2018-02-25 Thread James Lundy
dvance for answering this query. I am new with Python and would appreciate any advice. God Bless: James Lundy jalu...@computer.org<mailto:jalu...@computer.org> ## Read in Data # Open file filename = input("Enter the name of the file: &

Re: [Tutor] When do you know you're ready to start applying for jobs?

2017-12-19 Thread James Chapman
ite and understand what's happening on any of these projects (https://github.com/trending/python) then you're ready to start applying for jobs. Show off your skills via public git profiles and you should have something in no time, especially if you're not fussy! Programmers are

Re: [Tutor] How to debug a memory leak in a wsgi application?

2017-12-14 Thread James Chapman
​Ah OK, now I understand why you mentioned pymalloc to begin with. I'm not familiar with uWSGI or cython. That said, why do you think it's uWSGI causing a leak? It seems unlikely. Python projects can grow in size if you're not dereferencing objects... (see https://f0rki.at/hunting-memory-leaks-in-

Re: [Tutor] How to debug a memory leak in a wsgi application?

2017-12-14 Thread James Chapman
No, I'm saying you shouldn't need to make any kind of malloc calls manually. Python handles memory allocation and deallocation on your behalf. Why do you need to call pymalloc? Are you using ctypes? And if you are I presume this is then to make C-calls into a shared library? James --

Re: [Tutor] How to debug a memory leak in a wsgi application?

2017-12-13 Thread James Chapman
a problem? Are you changing pointers before you've freed the corresponding block of memory? There are many ways to create a memory leak, all of them eliminated by letting python handle your memory allocations. But, back to your original question, check out "valgrind". HTH -- Jam

Re: [Tutor] Windows Memory Basics

2017-10-17 Thread James Chapman
want to scan in memory, depending on the compiler settings the memory layout could have changed, or rather not be what you expected due to packing and alignment. Probably not the answer you were hoping for but I hope this helps. -- James On 17 October 2017 at 01:02, Michael C wrote: > Hold on, supp

Re: [Tutor] Help with putting numbers from highest to lowest.

2017-09-27 Thread Derry, James R
In [2]: ?sorted Signature: sorted(iterable, /, *, key=None, reverse=False) Docstring: Return a new list containing all items from the iterable in ascending order. A custom key function can be supplied to customize the sort order, and the reverse flag can be set to request the result in descending

[Tutor] overriding brackets in lvalue assignment possible?

2016-12-27 Thread James Hartley
I can successfully override __getitem__() for rvalues, but the following example shows that more is required when used as an lvalue: ===8<- #!/usr/bin/env python class Foo(): def __init__(self, n): self.d = dict.fromkeys([i for i in range(0, n)]) def __getitem__(self, i):

[Tutor] enforcing specific types in Python 3.5?

2016-10-13 Thread James Hartley
I have implemented the equivalent of "insert if unique" in Python & SQLAlchemy to help with data normalization. However to help minimize the number of preliminary SELECT statements needed, it helps to check types through calls to isinstance() before getting to the salient code. Unfortunately, the

Re: [Tutor] Code for python game

2016-10-12 Thread Derry, James R
hi, tracey, are you allowed to use python sets? if so, you should take a look at them and their methods: https://docs.python.org/3.5/tutorial/datastructures.html?highlight=data%20structures#sets best, james From: Tutor [tutor-bounces+jderry=mail.utexas

Re: [Tutor] Modularity

2016-01-14 Thread James Chapman
I should have re-read that last reply before hitting send. Apologies for the poor sentence construction! Something I forgot to highlight before which might be related to your initial question. If you have a file called sound.py which contained a class called WavFile, if you imported just sound li

Re: [Tutor] Procedure to install dlib on windows?

2016-01-14 Thread James Chapman
>From one of the Python examples: # COMPILING/INSTALLING THE DLIB PYTHON INTERFACE # You can install dlib using the command: # pip install dlib # # Alternatively, if you want to compile dlib yourself then go into the dlib # root folder and run: # python setup.py install # or #

Re: [Tutor] Modularity

2016-01-14 Thread James Chapman
re things I hate more but this come close! James ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Question about the memory manager

2016-01-11 Thread James Chapman
ow do we ensure this doesn't happen? Answer: build an emergency stash so you know you can spend it in such emergencies: rainydayfund = [[] for x in xrange(16*1024)] # or however much you need def handle_exception(e): global rainydayfund del rainydayfund ... etc, etc ... &qu

Re: [Tutor] reading an input stream

2016-01-07 Thread James Chapman
eadable was a requirement. ) If the method of receiving that data is optional, have you considered using something like AMQP (RabbitMQ) which would eliminate your need to support concurrency? It would also handle failure well. James -- James On 29 December 2015 at 20:14, richard kappler wrote:

[Tutor] Help with returning a list object from a C extension.

2015-11-28 Thread James Oren
Hi all, this is my first time using the mailing list. I'm trying to learn how to use C to extend my code, and have already worked out how to use ctypes. I'm now trying to learn the full C extension module approach with Python.h and have worked through the Python doc and a couple other examples. Th

[Tutor] relative imports within a package?

2015-11-07 Thread James Hartley
The Python 3 tutorial discusses relative imports at: https://docs.python.org/3/tutorial/modules.html#intra-package-references I have the following directory structure for a package in development: + outer_package/ + __init__.py + inner_package | + __init__.py | + mycl

[Tutor] accessing modules found throughout a package?

2015-10-17 Thread James Hartley
In my current project, I am developing a package. It makes sense to embed tests throughout the package's directory structure as they should be part of the package & its distribution. It may raise eyebrows that I have tests sprinkled through various directories, but there are reasons for keeping s

Re: [Tutor] Topic focus of ‘python-tutor’ (was: mySQL and Python)

2015-02-19 Thread James Chapman
ny. Someone else on this list might be able to provide a satisfactory answer, but, as the main focus of this list is learning to program in python using the standard library you might not get an answer, and if you do, the answer might not be very knowledgeable. You could try asking your question

Re: [Tutor] mySQL and Python

2015-02-18 Thread James Chapman
One of my pet hates about this list... "This is a tutor list, your question is out of scope". Sure there might be better places to seek answers, and sure maybe the first responder doesn't know the answer, but that's not a reason to respond with that phrase. This list is a called python tutor, not p

Re: [Tutor] Assistance with UnicodeDecodeError

2015-02-04 Thread James Chapman
= u.encode("utf-32") >>> print(s) ■ ¶ >>> s = u.encode("utf-16LE") >>> print(s) ¶ >>> s = u.encode("utf-16BE") >>> print(s) ¶ See https://en.wikipedia.org/wiki/Character_encoding to help with the understanding of charac

Re: [Tutor] Assistance with UnicodeDecodeError

2015-02-04 Thread James Chapman
rmap_encode(input,errors,encoding_map) UnicodeEncodeError: 'charmap' codec can't encode character u'\u2014' in position 0: character maps to >>> s = u.encode("utf-8") >>> print(s) ÔÇö I also strongly suggest you read: h

Re: [Tutor] Python 3.4.1 ImportError Linux

2014-12-16 Thread James Chapman
> Further to my last email, here's some reading regarding Python Paths > > http://www.stereoplex.com/blog/understanding-imports-and-pythonpath ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/m

Re: [Tutor] Python 3.4.1 ImportError Linux

2014-12-16 Thread James Chapman
cd .. Terminal (~/lorem): python3 app/main.py import statement is relative to pwd. -- James On 16 December 2014 at 14:18, Juan Christian wrote: > > Python 3.4.1 > Fedora 21 Server > > My paths: > ~/lorem > ~/lorem/app > ~/lorem/core > > I want to execute: ~/

Re: [Tutor] While Loop Help

2014-12-11 Thread James Chapman
While Alan has given you a far better solution, I feel someone should mention the break statement as you will likely come across it a lot, and it is quite an important flow control statement. You could add a break statement to the else which would break out of the while loop. https://docs.python.o

Re: [Tutor] Does the user need to install Python, when we deploy our c++ products using python?

2014-12-11 Thread James Chapman
On 2 December 2014 at 20:28, gordon zhang wrote: > > > I downloaded python 3.4.2 for c++ and create a vc++ project using python, > but I have no idea what python dlls and other stuff needed to deploy the > products. > > I know if we put Python34.dll and Python.dll in the folder of executable, > i

Re: [Tutor] Does the user need to install Python, when we deploy our c++ products using python?

2014-12-11 Thread James Chapman
x27;m unsure of. -- James On 11 December 2014 at 11:39, James Chapman wrote: > > On 2 December 2014 at 20:28, gordon zhang > wrote: > >> >> >> I downloaded python 3.4.2 for c++ and create a vc++ project using python, >> but I have no idea what python

[Tutor] break and exit

2014-11-20 Thread James Rieve
I accidently used 'exit' in a loop where I meant to use 'break' and, in that case, the program seemed to work as expected but in some cases 'exit' seems to behave differently from 'break'. For example, in this code snippet using 'exit' or 'break' produces the same result: for i in range(10): i

Re: [Tutor] While Loop and Threads

2014-07-15 Thread James Chapman
used as an exit mechanism for normal operation. Where to place the timer is up to you. Another thread is an option, but is it necessary? Overhead needs to be considered. -- James On 15 July 2014 14:14, James Chapman wrote: > So if I understand this correctly, you want to start a thread and

Re: [Tutor] While Loop and Threads

2014-07-15 Thread James Chapman
ead should exit because the Event is set. Hope this helps... James import time import threading class ThreadExample(object): def __init__(self): self.thread1Stop = threading.Event() self.thread2Stop = threading.Event() self.timeFinish = time.time() + 1

Re: [Tutor] While Loop and Threads

2014-07-14 Thread James Chapman
g_threadStop") g_threadStop.set() time.sleep(3) print("Main thread exiting...") if __name__ == '__main__': main() -- James On 14 July 2014 19:03, James Chapman wrote: > Multi-threading takes practice! > > Are you using an event object to s

Re: [Tutor] While Loop and Threads

2014-07-14 Thread James Chapman
therefore can't mock up a working example. If I have time later/tomorrow and you haven't solved it or no one else has commented I'll try and put something together. IMO, move away from GTK until you get threading working as expected, then add the additional layer. Solve one problem at

Re: [Tutor] How can I let the Python Console display more decimal precision?

2014-07-01 Thread James Chapman
work: >>> varA = float(26) >>> varB = 12 >>> varA/varB 2.1665 This works in Python2 or Python3 without importing any extra libs. -- James On 12 June 2014 13:31, Steven D'Aprano wrote: > On Thu, Jun 12, 2014 at 08:48:25AM +0800, Marino David

Re: [Tutor] mixing 64 bit and 32 bit

2014-03-21 Thread James Chapman
with these types of problems and do one thing or another depending on the base OS. -- James On 19 March 2014 19:53, John Fabiani wrote: > Thanks > Johnf > > On 03/19/2014 11:01 AM, Reuben wrote: > > Hi John, > > The generated bytecodes will be different - but bot

Re: [Tutor] c++ on python

2014-03-13 Thread James Chapman
ain__': dll_file = 'PythonDLL.dll' external_lib = DllInterface(dll_file) int_a = ctypes.c_int(1) int_b = ctypes.c_int(2) result = external_lib.add_a_and_b(int_a, int_b) print(result) --- -- James -- James On 13 March 2014 15:57, Stef

Re: [Tutor] When to use multiprocessing Managers?

2014-03-03 Thread James Chapman
validation / error checking before submitting to the Queue. This could be important if the data going into the Queue was for example, user generated. Hmm, yeah I'd say question answered. Thanks eryksun. -- James On 1 March 2014 16:48, eryksun wrote: > On Fri, Feb 28, 2014 at 6:31 A

Re: [Tutor] Python help

2014-02-28 Thread James Chapman
The answer lies in this page: http://docs.python.org/3.3/library/stdtypes.html#string-methods -- James On 28 February 2014 11:44, James Chapman wrote: > The answer lies in this page: > http://docs.python.org/3.3/library/stdtypes.html#string-methods > > > -- > James > >

Re: [Tutor] When to use multiprocessing Managers?

2014-02-28 Thread James Chapman
mportant if I was writing to a Queue and expecting all threads to see that message? Although if I needed to command a thread to do something I'd probably have a separate class and separate thread for that purpose. James -- James On 26 February 2014 14:19, David Palao wrote: > 2014

[Tutor] When to use multiprocessing Managers?

2014-02-25 Thread James Chapman
thing for other objects available under the managers package. So unless the other process is on a different machine, is there a reason to use a manager? Does anyone have any use case examples or snippets I could look at even? Thanks in advance James ___

Re: [Tutor] I can't understand where python class methods come from

2014-02-23 Thread James Scholes
for elem in self.current_data['address_components']: if attribute in elem['types']: return elem[prop] -- James Scholes http://twitter.com/JamesScholes ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Python .decode issue

2014-02-09 Thread james campbell
I have been currently trying to get a small piece of code to work, but keep getting an error: header_bin = header_hex.decode('hex') AttributeError: 'str' object has no attribute 'decode' The source of this code is from: https://en.bitcoin.it/wiki/Block_hashing_algorithm  Here is the the code:

Re: [Tutor] Unit testing infinite loops

2014-01-31 Thread James Chapman
lines could break the build and possibly cost you hours or even days tracking it down. If those lines were tested however, your continuous integration build system would hopefully highlight the fault. In my experience testing works, saves time down the line, and makes code easier to come back to. --

Re: [Tutor] Unit testing infinite loops

2014-01-31 Thread James Chapman
alls were made. ** Obviously the print lines will be substituted for some kind of assert lines ** FYI I'm using CPython 2.7. -- James On 31 January 2014 12:57, eryksun wrote: > > On Fri, Jan 31, 2014 at 6:31 AM, James Chapman wrote: > > try: > > while se

[Tutor] Unit testing infinite loops

2014-01-31 Thread James Chapman
Thanks in advance, and hopefully there are no formatting issues this time. -- James ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Mocking with "mock" in unit testing

2014-01-17 Thread James Chapman
Really! import mock import unittest import pinger It should be three lines, but somehow it got all messed up, either through rich text formatting or copy paste. Being a bit pedantic now about import statements which are clearly unintentionally messed up. - Sent in plain text. -- James

Re: [Tutor] Mocking with "mock" in unit testing

2014-01-17 Thread James Chapman
rrors. -- James On 17 January 2014 11:23, Steven D'Aprano wrote: > On Fri, Jan 17, 2014 at 09:58:06AM +, James Chapman wrote: > > > As this question was just about mock and not really dealing with the bad > > return code or exception handling or raising my final working e

Re: [Tutor] Mocking with "mock" in unit testing

2014-01-17 Thread James Chapman
ue) def test_ping_host_fails_and_throws_exception(self): pinger = tutor.Pinger() with mock.patch('tutor.subprocess') as subprocess: subprocess.Popen.return_value.returncode = 1 self.assertRaises(Exception, pinger.ping_host, 'localhost') if

Re: [Tutor] Mocking with "mock" in unit testing

2014-01-17 Thread James Chapman
pinger = pinger.Pinger() with mock.patch('pinger.subprocess') as subprocess: subprocess.Popen.return_value.returncode = 1 self.assertRaises(Exception, pinger.ping_host, 'localhost') if __name__ == '__main__': unittest.main() ----

[Tutor] Mocking with "mock" in unit testing

2014-01-16 Thread James Chapman
sert_called_once_with(['ping','localhost']) pinger.ping_host('127.0.0.1') if __name__ == '__main__': unittest.main() --- Can anyone point me in the right direction on how to mock up these subprocess calls? Thanks James __

Re: [Tutor] i installed the package statsmodels but i get an error when i use it

2013-12-16 Thread Derry, James R
;1%': -4.9386902332361515, '10%': -2.8438679591836733}, 15.971188911270618) -- james From: Tutor [tutor-bounces+jderry=mail.utexas@python.org] on behalf of eva maria gualandi [evamaria.guala...@gmail.com] Sent: Monday, December 16, 20

Re: [Tutor] why do i keep getting syntax errors in python when this runs

2013-09-07 Thread James Griffin
!-- On Fri 6.Sep'13 at 5:27:23 BST, mike johnson (pretor...@hotmail.com), wrote: > can you please help me figure out why this isnt working thanks > # convert.py > # this program is used to convert Celsius temps to Fahrenheit > # By: James Michael Johnson > > Def mai

Re: [Tutor] Can't install latest PIL

2013-05-16 Thread James Reynolds
You may want to consider pillow. Oil hasn't been maintained in some time. On May 16, 2013 6:12 PM, "Jim Mooney" wrote: > Make sure you have the correct architecture. The builds from > PythonWare are 32-bit. Christoph Gohlke has 64-bit builds here: > > http://www.lfd.uci.edu/~gohlke/pythonlibs/#p

Re: [Tutor] building a website with python

2013-04-09 Thread James Reynolds
As far as hosts, I use digital ocean. It's a cloud based thing like EC2, but it's cheap (5/10/20 and up). You will of course have to configure everything yourself, but that's not such a bad thing. It will give you good experience configuring a linux box as well and learning about deployment. Sinc

Re: [Tutor] python on ipad

2013-03-13 Thread James Griffin
[- Sun 10.Mar'13 at 16:42:59 -0500 Benjamin Fishbein :-] > Hello. I wrote some python programs for my small business that I run on my > computer...macbook air. I'm planning to backpack around Mexico and perhaps > south america. I'll still be working though. Basically my computer

Re: [Tutor] Which pip for Ubuntu 12.04

2013-02-10 Thread James Reynolds
The bigger issue with mongo is the apt versions are old. Be sure to follow the instructions on mongos site. If you pip install pymongo with a ubunuto or mint build your gtg ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription opt

Re: [Tutor] First Python Test

2013-02-03 Thread James Griffin
--> Shall, Sydney [2013-02-02 12:45:15 +]: > Two free good text editors for the MAC are; > 1. Komodo > 2. Text Wrangler. > hth > Sydney aquamacs is the correct gui version to use. There is also a gvim binary available. Both emacs and vim are installed already on Mac OS X but in text only ver

[Tutor] How can I overwrite the previous version on linux ?

2012-12-18 Thread Dae James
My linux distribution is CentOs 6.3. And python attached to the OS is 2.6. How can I overwrite the previous version with python 2.7 ? Or how can I uninstall the previous version? Dae James___ Tutor maillist - Tutor@python.org To unsubscribe or cha

Re: [Tutor] PostreSQL

2012-11-15 Thread James Reynolds
Psycopg2 is the driver for postgres. Not sure if it is py3k compliant On Nov 15, 2012 6:13 AM, "Válas Péter" wrote: > Two listings, of course. :-) > I failed to tell that my PG version is "PostgreSQL 8.1.2" (and my client > uses Windows 7, if this has relevance). > > 2012/11/15 Válas Péter > >>

[Tutor] Why VPython can't be searched out in PyPI?

2012-10-17 Thread Dae James
I found that VPython is not in PyPI(python packet index from www.python.org). Why ? Dae James___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Question about language code

2012-10-11 Thread Dae James
Here is a example in "Python v2.7.2 document": >>> import locale >>> loc = locale.getlocale() # get current locale # use German locale; name might vary with platform >>> locale.setlocale(locale.LC_ALL, 'de_DE') However, the result of executing on my computer is: >>> locale.setlocale(locale.LC_ALL

Re: [Tutor] What can I do if I'm banned from a website??

2012-10-10 Thread James Reynolds
On Wed, Oct 10, 2012 at 4:35 PM, Benjamin Fishbein wrote: > I've been scraping info from a website with a url program I wrote. But now > I can't open their webpage, no matter which web browser I use. I think > they've somehow blocked me. How can I get back in? Is it a temporary block? > And can I

[Tutor] new student

2012-09-28 Thread james gillis
I am looking for some recommendations books to read.websites,links,any information would be appreciated. Thanks, jmslgil...@gmail.com ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org

[Tutor] How can I convert a variable name to a string?

2012-09-21 Thread Dae James
How can I convert a variable name to a string ? For example: testVariable = 1000; How can I get the string "testVariable" ? Thank you~ Dae James___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.

Re: [Tutor] Python cms

2012-08-19 Thread James Reynolds
I agree with Steven. You will notice efficiency gains by moving to python. I'm a django developer myself, but some of the other frameworks work well also. That said the django community is fairly large, and there is an active cms project called django-cms. https://www.django-cms.org/ Sent f

Re: [Tutor] I-Phone App in Python?

2012-08-04 Thread James Reynolds
n outside of it, then I suppose you won't be able to use Python to any degree. But, if you do, then you can write fantastic apps using python libraries for the backend needs. On Sat, Aug 4, 2012 at 2:28 PM, Chris Fox wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 >

Re: [Tutor] I-Phone App in Python?

2012-08-04 Thread James Reynolds
To clarify, that is their server side arc. The native app itself... I'm not sure what is written in. Probably java if I had to guess. In making an app, most of your work is going to be backend in any event. Also, what happens when an android user wants to download your app? Sent from my iPad

Re: [Tutor] I-Phone App in Python?

2012-08-04 Thread James Reynolds
Instagram is written in python django. Sent from my iPad On Aug 3, 2012, at 7:13 PM, Fred G wrote: > I just googled whether it is possible to write an i-phone app in Python and > got very confusing, and not super good results. > > Is it possible? And if so, what module(s) do I need to instal

Re: [Tutor] advice on global variables

2012-07-11 Thread James Reynolds
On Wed, Jul 11, 2012 at 10:30 AM, Chris Hare wrote: > > On Jul 11, 2012, at 8:05 AM, Walter Prins wrote: > > > [snip] > > > Your original example modified as demonstration: > > > > a.py: > > > > import shared > > import b > > > > def func1(): > >print "global var in func1 = %s" % sha

[Tutor] Define Build Deployment

2012-07-11 Thread James Bell
I'm fairly new to software development in an enterprise environment I'm constantly hearing the term "build deployment" and do no want to ask what it means since it seems simple. I cannot find a definition online. if the word is context specific please describe what it means at your company. thank

Re: [Tutor] advice on global variables

2012-07-10 Thread James Reynolds
Sent from my iPad On Jul 10, 2012, at 3:11 PM, Chris Hare wrote: > > I know they are bad. That is why I would prefer not to use it, but I am not > sure how else to handle this problem. > > In this app, the user must log in. Once authenticated, they have a userid > stored in the SQLite da

Re: [Tutor] advice on global variables

2012-07-10 Thread James Reynolds
On Tue, Jul 10, 2012 at 4:32 PM, Prasad, Ramit wrote: > > You should avoid using the global statement. > > > > In your case, I would think you could just add an argument to the method: > > > > class MyObj(object): > > def __init__(self, arg): > > self.arg = arg > > def my_func(self

Re: [Tutor] advice on global variables

2012-07-10 Thread James Reynolds
On Tue, Jul 10, 2012 at 3:11 PM, Chris Hare wrote: > > I know they are bad. That is why I would prefer not to use it, but I am > not sure how else to handle this problem. > > In this app, the user must log in. Once authenticated, they have a userid > stored in the SQLite database. Before split

[Tutor] Examples of "With....As Statement" in Python

2012-07-10 Thread James Bell
I'm attempting to learn how to use the "withas" statement in python. I've read the documentation and also a few tutorials but I still cannot understand the concept. or how this is normally used. Can someone please write an example or 2 of simple ways to use the "with statement". I understand

Re: [Tutor] Opening filenames with unicode characters

2012-06-28 Thread James Chapman
27;s related to the virtual machine or whether it's related to Windows 2008. I guess I'll find out tomorrow. Oh and Tim, you'll be happy to know that regex does not affect the string in this case. Well, at least not the way I'm using it to extract data. -- James At Thursday, 2

Re: [Tutor] Opening filenames with unicode characters

2012-06-28 Thread James Chapman
line 881, in open file = __builtin__.open(filename, mode, buffering) IOError: [Errno 2] No such file or directory: u'\u6854\u7369\u6920\u5f73\u2d61\u6574\u7473\u4627\u4c49\u2045\u6f74\u4520\u736e\u72 75\u2465\u7420\u6168\u9c74\u7320\u7574\u\u205e\u6f77\u6b72\u2e73\u7874\u2e74\u736a

Re: [Tutor] Opening filenames with unicode characters

2012-06-28 Thread James Chapman
rror: 'utf8' codec can't decode byte 0x9c in position 35: invalid start byte -- James At Thursday, 28/06/2012 on 18:58 Jerry Hill wrote: On Thu, Jun 28, 2012 at 1:55 PM, James Chapman wrote: > Thanks Tim, while this works, I need the name to be stored in a variable as > it&#x

Re: [Tutor] Opening filenames with unicode characters

2012-06-28 Thread James Chapman
Thanks Tim, while this works, I need the name to be stored in a variable as it's dynamic. In other words, how do I rewrite open(u"blah£.txt") to be filename = "blah£.txt" open(filename) At Thursday, 28/06/2012 on 18:39 Tim Golden wrote: On 28/06/2012 18:19, James

[Tutor] Opening filenames with unicode characters

2012-06-28 Thread James Chapman
can't decode byte 0x9c in position 35: ordinal not in range(128) I've tried all sorts of encode and decode methods on the string containing the file name but nothing seems to be working. Any help would be appreciated. James PS: This is on 64bit Windows with ActivePython 2.7.3 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] web design and python

2012-06-21 Thread James Reynolds
On Thu, Jun 21, 2012 at 6:53 PM, Tamar Osher wrote: > I have many questions, and eagerly ask you to please respond to me. I > value your expertise, and greatly appreciate you taking the time to share. > I want to find out, in elaborate detail, about the Python/Django > relationship to web desig

Re: [Tutor] Pymongo Error

2012-06-19 Thread James Reynolds
On Tue, Jun 19, 2012 at 1:22 AM, Ranjith Kumar wrote: > Hi all, > I tried Django with Mongodb while running manage.py syncdb I endup with > this error > > note : it works fine with sqlite and mysql db > > (django-1.3)ranjith@ranjith:~/ > sandbox/python-box/hukkster-core-site/hukk$ ./manage.py sync

Re: [Tutor] Dictionary

2012-06-17 Thread James Reynolds
Does this language have grammar independent of english? If no, just use .split() on the string and loop through that. If yes, well, its much more complicated On Jun 17, 2012 2:27 PM, "Selby Rowley-Cannon" wrote: > Version: 2.7 > OS: Ubuntu 12.04 LTS > > I am writing a small translation app for

Re: [Tutor] Web Questionnaire

2012-06-04 Thread James Reynolds
I would say start using django. The best way to learn is by doing. This will let you learn about databases, servers, webapps, and you can get some functionality out of it. Just start going through the django tutorial. On Jun 4, 2012 11:57 AM, "Joel Goldstick" wrote: > On Mon, Jun 4, 2012 at 11:

Re: [Tutor] Connecting to MySQLdb

2012-06-01 Thread James Reynolds
Virtualenv works just fine in windows On Jun 1, 2012 7:20 PM, "Corey Richardson" wrote: > On Fri, 1 Jun 2012 19:01:00 -0400 > Nicholas Picciano wrote: > > > Hello, > > > > I have downloaded MySQLdb 1.2.3 from: > > > > http://pypi.python.org/pypi/MySQL-python > > > > Also, I'm using Python 2.7,

Re: [Tutor] Benefit/Disadvantage to storing data as dictionary vs. in a class

2012-06-01 Thread James Reynolds
On Fri, Jun 1, 2012 at 9:12 AM, Adam wrote: > I'm working on a class that handles multiple rooms that generate a large > amount of data. Currently my class model looks something like this (more > apologies for any indentation errors): > Class Model: >rooms= {} >for z in range(num_of_zones

Re: [Tutor] How install Pyramid on a Windows 7 computer?

2012-05-31 Thread James Reynolds
I don't think django 1.5 is ready, but they are targeting python3k. There is a fork of django i think on bitbucket that works as well. On May 31, 2012 12:33 PM, "Vince Spicer" wrote: > Step 1) install Ubuntu > > OK sorry couldn't resist. > > This should help. > > http://docs.pylonsproject.org/pr

[Tutor] Thanks Everyone!!!

2012-04-19 Thread James Stauble
Thanks for the tips everyone! I am fairly new to programming and am finding myself both bewildered and amazed. Its fun when it works, but boy oh boy, when it doesn't Anyway thanks again, you all have been very helpful. [?] <<330.gif>>___ Tutor maillis

  1   2   3   4   >