On Mon, Nov 12, 2018 at 3:31 PM Mats Wichmann wrote:
>
> Reconstruct the virtualenv you want maybe? Their whole concept is that
> they're cheap and easy and can just be thrown away. Of course, you then
> have to remember what you did to create it in order to make a new one...
It's been 3 years,
I haven't coded in about 3 years and I used to use Python3.4 on
openSUSE13.1. I had a virtual environment with this Python for a
development Django website. Before I stopped coding, I upgraded to
Python3.5, but everything still worked if I remember correctly. But
now I'm back to coding I tried to
Thank you all for replying, I really appreciate it. It's all I've been
thinking about lately and your responses have really cleared up a lot
of things for me.
On Tue, Dec 12, 2017 at 11:37 PM, Alan Gauld via Tutor wrote:
>
> But there are things you can learn now that won't
Hi all. I took 2-3 years off in 2012 to teach myself programming. I
learnt basic Javascript & Python with some Django. I don't have a
Computer Science (CS) degree so I never applied for a job because I
always thought I still had lots to learn and most jobs say a CS degree
is required. In 2015 I
On Fri, Sep 29, 2017 at 7:20 PM, Alan Gauld via Tutor wrote:
> If you want to follow the book use the version the book
> uses - probably 2.6 or something close?
>
I think the book uses either Python 3.0 or 3.1. It's been a while
since I read it but it doesn't use Python 2. The
PyQt or PySide offers QtDesigner. Which is a drag and drop builder.
They are both quite complex GUI toolkits so you will need some basic
knowledge on them first, but I Imagine there are good guides on using
QtDesigner if it's your last option.
On Thu, Sep 18, 2014 at 2:14 PM, Juan Christian
Hi this might not be the correct place to ask this. I am using the
google api and as soon as I use the build function:
service = build('books', 'v1', developerKey=api_key)
I get an SSL error. I'm not sure what build() does but it triggers an
SSL error. Here's the error message:
On Sun, Aug 17, 2014 at 11:26 PM, Danny Yoo d...@hashcollision.org wrote:
I would recommend checking whether the 'cacerts.txt' file in that
subdirectory is user-readable or not. Make sure it's readable. If it
isn't, chmod it and try again: that will probably fix it.
Thanks ever so much for
On Mon, Jul 7, 2014 at 12:55 PM, Dave Angel da...@davea.name wrote:
You will want to configure your DOS Box to make it easier to cut
and paste.
How is this done? I'm not on windows atm to test it.
___
Tutor maillist - Tutor@python.org
To
On Tue, Jun 10, 2014 at 5:28 PM, Jon Engle jon.en...@gmail.com wrote:
startingPort=input(\nPlease enter starting port: )
startingPort=int(startingPort)
def setup(PORT):
PORT = startingPort#arbitrary port not currently in use
There's a conflict with this PORT
Hey all. I've been meaning to get into web scraping and was pointed to
the directions of lxml (library) and scrapy (framework). Can I ask in
terms of web scraping, what's the difference between a library and a
framework? Surely everyone should use a framework but I get the idea
more people use the
Thanks for the response Alan. I forgot to reply to tutor on my 2nd
comment. Just incase someone might want to see it, here it is:
Okay I think learning how to scrap (library or framework) is not
worth the trouble. Especially if some people consider it illegal.
Thanks for the input.
Hi,
I'm completely new to programming in general and everything I have read so
far has pointed me to Python. I was just hoping to get some input as to where
I might start.
Start with Python programming for the absolute beginner Great
author. The book gives you lots of exercises at the
Hi I'm trying to install pyqt5.2 for Windows Vista (Python3.3). 1st i
need to install sip but i run into this issue.
after ./configure, a MAKEFILE is created. I'm supposed to do 'make'
and 'make install', but i get this cmd error:
C:\pathmake
'make' is not recognized as an internal or external
On Sat, Jan 11, 2014 at 2:55 PM, Mark Lawrence breamore...@yahoo.co.uk wrote:
On Windows finding a binary installer is always the first thing to do,
makefiles indeed. Go here
http://www.riverbankcomputing.co.uk/software/pyqt/download5, find the
section Binary Packages and this gives Windows
On Sun, Jan 12, 2014 at 1:13 AM, eryksun eryk...@gmail.com wrote:
The pre-built versions of PyQt4 and PyQt5 don't use the same version
of SIP. If you don't have a build system (e.g. Visual Studio 2010, the
Windows 7 SDK, or MinGW), then using a virtual environment should work
around the
Hi i wrote about a week ago about the problems i had with importing
sqlite3 on python 3.3 on ubuntu 12.04. Due to this ive tried to revert
back to python 3.2 which is the default installation along wit 2.7.
I've run into 2 problems.
1) I'm new to ubuntu and someone helped me install python3.3
On Tue, Jan 7, 2014 at 12:40 AM, eryksun eryk...@gmail.com wrote:
virtualenv allows you to specify the target Python:
virtualenv --python=/usr/bin/python3.3 myenv
Refer to `man virtualenv` for more options.
Or use synaptic if you prefer a GUI interface.
Ubuntu has a Python 3.3
On Sat, Jan 4, 2014 at 11:24 AM, blech...@fireflyuk.net wrote:
I havent included the script as it seems to be the use ' input' on my phone
that now wont work.
Even if the error is with 'input', it is still an odd error and no one
will be able to debug your program or have a clue what's
On Fri, Jan 3, 2014 at 10:36 AM, Alan Gauld alan.ga...@btinternet.com wrote:
On 03/01/14 02:17, Matthew Ngaha wrote:
im having problems importing sqlite3 on ubuntu python3.
File /usr/local/lib/python3.3/sqlite3/__init__.py, line 23, in
module
from sqlite3.dbapi2 import *
File
im having problems importing sqlite3 on ubuntu python3.
File /usr/local/lib/python3.3/sqlite3/__init__.py, line 23, in module
from sqlite3.dbapi2 import *
File /usr/local/lib/python3.3/sqlite3/dbapi2.py, line 26, in module
from _sqlite3 import *
ImportError: No module named '_sqlite3'
hey i've tried installing a few packages with pip that failed. i'm on
windows and python3.3. I have tried 'pip install pycurl' and 'pip
install flup' which is something i need for django. I tried flup today
and what bothers me is even though it failed, it's making some temp
folders in places i
:(
On Sun, Dec 22, 2013 at 11:21 PM, Steven D'Aprano st...@pearwood.info wrote:
On Sun, Dec 22, 2013 at 11:10:13PM +, Matthew Ngaha wrote:
hey i've tried installing a few packages with pip that failed. i'm on
windows and python3.3.
You're trying to use Python 3.3, but somehow your version of pip
hey guys ive got the very basics of django down. i was able to design
a very basic dynamite site and interacted with django. It's basic
limited in every way, with the little it does, and the plain ugly
design. This won't be good enough to put up anywhere but on localhost.
My question is, How do
On Sat, Dec 21, 2013 at 5:56 PM, Alan Gauld alan.ga...@btinternet.com wrote:
You really need to know html and css if you are building
modern web UIs. That's because most good modern web sites
use a lot of client side(browser) scripting, usually using
JQuery. JQuery requires that you really
Does pandas do the same thing numpy does? I've never used them and
unsure of what they are about.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
I'm always told to avoid using them. I read discussions on the python
irc channel about them but honestly i feel there are some times where
i can't avoid using them. Like where i want to keep track of a state
variable in many different functions that may or may not alter its
value and also not
On Thu, Aug 22, 2013 at 1:40 PM, Chris Down ch...@chrisdown.name wrote:
It sounds like you want to use a class.
Why would you not just use a class if you want to store state?
I don't feel my program needs a class. Also i have been told to stop
using classes by some very experienced Python
On Thu, Aug 22, 2013 at 2:52 PM, Chris Down ch...@chrisdown.name wrote:
I would doubt that anyone has told you don't ever use classes, because
that's nonsense; you've probably misread a dissuasion from that path in a
single instance as applying more broadly than was intended.
I am being totally
On Thu, Aug 22, 2013 at 3:04 PM, Alan Gauld alan.ga...@btinternet.com wrote:
On 22/08/13 13:36, Matthew Ngaha wrote:
Global variables in themselves are not the problem.
It's how they tend to get used that causes problems.
Globals that are only changed via a set of
dedicated functions
On Thu, Aug 22, 2013 at 4:35 PM, Steven D'Aprano st...@pearwood.info wrote:
Good question! And one that needs a long answer.
Hey i just checked mail again... A big thank you for your responses, i
will read all of them now.. im pretty my programs/designs will be much
cleaner by the time i done.
Sorry for the forward, i forgot to reply to tutor
On Mon, May 27, 2013 at 3:53 AM, Sunitha Misra sunith...@gmail.com wrote:
self.fileDialog = QtGui.QFileDialog()
QtCore.QObject.connect(self.toolButton,
QtCore.SIGNAL(_fromUtf8(clicked())), self.fileDialog.getOpenFileName)
i think the way
On Mon, May 27, 2013 at 2:14 PM, SM sunith...@gmail.com wrote:
But then I also had to use self.fileDialog from within the function. Not
sure how I could avoid using fileDialog.
Thanks.
No problem. to do it without the instance variable, you access its
method directly. so replace:
path =
wait for someone more knowledgeable to answer, but from what i know,
Yes it does have a profound meaning. Strings consist of character
sets. Something that was here way before Python
Like i said my experience is limited so i too would like to hear some reponses
On Wed, May 22, 2013 at 6:02 AM, Andrew Triplett andrew139...@yahoo.com wrote:
I am on chapter two for Python Programming working on the challenges and the
question is:
1. Create a list of legal and illegal variable names. Describe why each is
either legal or illegal. Next, create a list of
Thanks guys i had no idea about these method attributes and also
these underlying oop __objects__
@ eryksun
i understand your explanation, im still having trouble figuring out
how django is being used in the tutorial.
class Poll(models.Model):
# ...
def was_published_recently(self):
The default description is the name with underscores removed, unless
you set a custom description in the function's short_description
attribute. I'm not experienced with Django, so I can't ramble off lots
of examples, but hopefully you get the gist.
Thanks that does clear it up. Also thats a
class Poll(models.Model):
question = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def was_published_recently(self):
return self.pub_date = timezone.now() - datetime.timedelta(days=1)
#
options.py is the biggest module in the admin package. The link I
posted is to the get_actions method of ModelAdmin. In the tutorial,
PollAdmin extends this class.
oh ok thanks, yes i will definately look through it
I'm not coming from any framework. My knowledge of web development is
you are
quoting.
On 20/05/13 00:23, Matthew Ngaha wrote:
ok thanks i didnt think about that. I was quoting eryksun. I'll
includethat line from now on
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http
im following the official docs and after learning Python im sure of
how methods work, but the model example on the beginners guide has me
really confused.
The model definition is omitted but can anyone explain how this methed
(was_published_recently) is given these attributes:
class
Thank you Vasya and Eryksun. Sorry i didn't mention my OS i am on
windows. Thanks for the links and detailed explanations which after
following, i now have django up and running! thanks again
___
Tutor maillist - Tutor@python.org
To unsubscribe or
i completed this book and i did every exercise. are you asking for
help with the challenges, or have you completed them and want code to
compare yours too? im relunctant to share challenge code, incase you
havent done them. They are really good exercises to try doing.
i recommend getting a copy of Python Programming for the absolute
beginner. It offers end of chapter exercises to make sure you
understand everything you are reading. It was a great read for me and
made my learning experience really fun. I garantee by the end you
would have gained a lot of
i have to install django and ive come across some weird instructions.
it says to set Django's django-admin.py file to my environment
variable. I was instructed to get django via easy installer that was
located in my Python/Scripts folder. it installed django to a
different place in site-packages,
bWater.clicked.connect( water_clicked ) AttributeError: 'int
use a paste site like http://bpaste.net/+python to show us the code.
i am no expert @ programming myself but that error is telling you you
used an int and tried to access an int method called connect somewhere
in your code. ints do
Im following a tutorial on what i believe is using Python 2 and i'm a
bit confused. I use Python 3 on windows vista. I believe
urlretrieve() is a python 2 function that isnt in 3, but why is the
tutorial using urllib instead of urllib2? Also when i run the program
on Python 3, it says:
the whole program depends on the urlretrieve 3rd argument, the
function to be called.. is there no options to include a callback?
def _download(self):
def reporthook(pos, block, total):
if self.size != total:
self._size = total
Look in the module docs for urlib.request.
Hi. Ive never used the urllib before unless it was typing in something
from an unrelated tutorial. I've also never done anything related to
web programming. I'm looking at the urllib.request page and i really
don't understand what i'm looking at. I'm
You might want to look at requests module:
http://docs.python-requests.org/en/latest/
Many people think it is easier to use than the native python support.
are all of these modules related to web programming like clients and
(HTTP)servers? I've come across urllib a lot of times but only
Gauld alan.ga...@btinternet.com wrote:
On 07/04/13 17:20, Matthew Ngaha wrote:
Look in the module docs for urlib.request.
Hi. Ive never used the urllib before
In Python 3 urllib combines (the best) features of
urllib and urllib2 from Python 2.
web programming. I'm looking
org/2/library/urllib.html#urllib.urlretrieve
or
http://docs.python.org/3/library/urllib.request.html#urllib.request.urlretrieve
sorry about the top posting gmail has changed the way their messages
are done, it gave me a blank field i didnt realize i was writing above
the message.
i must have
Unless you're looking for something specific from the URL that the
tutorial uses, then you could use any address
Bodsda
thanks i did that and to my suprise an extra file showed up in my
folder, of the page i just visited:) thanks
___
Tutor maillist
i cant seem to break out of this loop. let me explain the variables you see:
Enemy.ships = [] #an Enemy class variable that contains enemy ships
self.missiles = [] an instance variable that appends how many Visible
missiles my ship has fired
Enemy.rects = [] an Enemy class variable that
if Enemy.ships:
for missile in self.missiles:
flag = False
for rect in Enemy.rects:
assert(!flag)
if QPoint(missile.x + 5, missile.y) in rect:
One good approach is to have a separate function or method with
both loops:
def attack(self, Enemy):
for missile in self.missiles:
for rect in Enemy.rects:
if QPoint(missile.x + 5, missile.y) in rect:
explosion = Explosion(rect.x(), rect.y())
thanks guys ive finally got it working. even though i didnt use the
flag due to invalid syntax i realized since i was getting no errors i
wasnt actually doing anything wrong. My mistake was i removed the
ememy ship but for some reason forgot to remove the missile so it was
still active on the next
understanding of how everything works.
Use it., Experiment with it. Break it.
Thats the best way. Read the source code its all available in
Python or C.
Hey can you please tell me which source code youre referring too? The
initial files that come with Python? also the C code, where can i
Hey, a Big thanks to everyone that has offered their input. I really
appreciate it. Also thanks for all the additional links, i will
definately start to read up on data structures , source code and
everything else that was suggested
___
Tutor maillist -
hi guys i am a python 3.1.1. user but really need to use python 2 to
be able to use certain libraries and frameworks. i have installed
python 2.7 but they cant run together as all .py and .pyw files are
opened with python 3. i can open simple python 2 files by right
clicking and finding pythons
Python 3.3 for Windows comes with a launcher, which will approximate (for
Python only) what Unix and Linux users have had for years for any scripting
language. You can get it separately, as Mark Lawrence has said, but maybe
it's time to bring your 3.x current.
there was a lot of reading in
You don't have to uninstall 3.1 but you would have to install all the
downloaded modules or packages that you have in your 3.1 site packages
folder to the 3.3 site packages folder. Maybe it's easier to simply grab
the standalone pylauncher as I suggested earlier. Only you know what is the
yes the 2nd option (standalone pylauncher) sounds more convienient for
me. i just have to try and comprehend all the instructions given..
hopefully ill get there in the end
i managed to install the laucher. on the site when i click the correct
launcher 32bit, i chose run and it automatically
Have you added shebang lines to those scripts yet?
yes i added them. i think the problem is at the start where it asks me to:
You should ensure the launcher is on your PATH - depending on how it was
installed it may already be there, but check just in case it is not.
From a command-prompt,
I'm not using it, since I'm not using Windows. So these are guesses based
on years stuck\b\b\b\b\b spent in the Windows environment.
Clearly, the name of the program is py.exe, so that's what you should try
searching for. From the cmd prompt, try dir /s py.exe
Or, you could just try
Did you find the control-panel-way to modify the PATH (assuming py.exe
wasn't already in there) ? Without it, I'd be surprised if right-click
would work correctly.
And as for IDLE, there are two different IDLEs, one in each directory. So
run the one that corresponds to the python you'll be
On Thu, Jan 24, 2013 at 9:35 PM, eryksun eryk...@gmail.com wrote:
On Thu, Jan 24, 2013 at 1:56 PM, Matthew Ngaha chigga...@gmail.com wrote:
py is not recognized and and it said depending on how it was
installed. the problem is it didnt allow me to select a path when
installing.
The simpler
In a cmd shell, check that 'assoc .py' is Python.File and that
'ftype Python.File' points to py.exe in your Windows directory, e.g.
C:\Windows\py.exe %1 %*'. If it's wrong, re-install. Or fix it
manually using assoc and ftype in an elevated cmd shell, which updates
the local machine registry
On Sat, Jan 19, 2013 at 10:56 PM, anthonym antho...@att.net wrote:
Thanks again for the info Alan. I am still passing the button process
until I can get my rectangle and ovals on the canvass. The program runs
and produces a window with the radio buttons on top. I would like them on
the
On Sun, Jan 20, 2013 at 12:05 AM, Matthew Ngaha chigga...@gmail.com wrote:
On Sat, Jan 19, 2013 at 11:29 PM, anthonym antho...@att.net wrote:
Sure thing. Here is the code. And after that is the box I get with the
radio buttons but no shapes.
i might be way off as im struggling to understand
hey guys, this is not really a Python question. When ever im doing a
tutorial, it could be pygame or some gui application, i usually find
everything straight forward until the demonstration involves drawing.
Then maths is applied and i can't follow along as easily. In the end
by commenting out
With the code not being on the page, I went to the directed website and got
the downloads, yet I couldn't find the source code
anywhere to be found. Am I missing something plainly obvious?
what exactly did you download? all the source code for every chapter
is included in the download
return {e for (e, g) in self.sort_email.items()
if g groups_list}
guys i think ive got it. The in that comprehension was really
confusing me, but i found out it means intersection, so i took the
sets manually and saw the results i got using intersection and it
became more
I typed in to my script:
a = open (dupli, r)
and got an error stating that dupli is not deffined.
it needs the quotes around it. so try:
a = open (dupli, r)
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
Traceback (most recent call last):
File Match finder GUI.py, line 87, in ?
app = Application(root)
File \Match finder GUI.py, line 23, in __init__
self.create_widgets()
File Match finder GUI.py, line 61, in create_widgets
self.submit_bttn = Button(self, text = Submit,
It's asking a lot if you want people to read your whole code to try
and spot the errors. Try to run it from the console and paste what the
errors are here.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
working through my tutorial ive been told to set up a simple webserver. i
can't even get started because the 1st line of code its asked me to do
fails with a syntax error. here's the code:
python3 -m http.server
any ideas what is going wrong? it asked me to make some simple .html files,
then in
Always, *always* include the *full* error message, otherwise we have to
guess. Not fun. Some other questions: What operating system are you using?
What version of Python does your tutorial assume? Do you in fact have
Python 3 installed on your system?
maybe im running it from the
Works for me with 3.3:
aclark@Alexs-MacBook-Pro:~/ python3.3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 ...
hey how do you start it or where do you run it from. did you type that
in the command line?
___
Tutor maillist -
If you got an error, quote it in full in your message (using copy/paste,
not by retyping or paraphrasing. As it stands, we don't know if the
error was in bash, in csh, in cmd, or in Python, and if it was in
python, we don''t know what version.
python3 -m http.server
Where did you type
Don't run it from inside IDLE. You were right to run it from cmd.
Pasting the error message you showed elsewhere:
'python3' is not recognized as an internal or external
command, operable program or batch file.
That simply says that the PATH does not point to your PYTHON3.bat or
The interpreter executable in Windows is always called python
(console) or pythonw (no console). The 3.1 installer doesn't put the
executable's directory on the system PATH. The option to add this was
added to the 3.3 installer. Otherwise you'll have to add the directory
manually. In IDLE
No, in your case it's
set PATH=%PATH%;D:\Data\Program Files Data\Py
That's just a temporary modification for the current cmd process. It's
easiest to show how to change it permanently with screen captures;
search for vista set path.
i followed the instructions at
Py is a directory.
Once you've added the Python executable's directory to the path, you
can start the http.server module as a script by running the following:
python -m http.server
Don't use pythonw in this case. The latter is associated with the
.pyw file extension, used for scripts
In your original getNames do something like this.
Initialise a counter to zero.
Every time you get a valid name increment the count.
If the count is three you're finished.
hey i was looking at the question as im learning also. With the counter,
would you use a while loop instead of a for
In many of the tutorial examples ive come across, the main code's program
is never at the top level, but always in a function of some sort. i
understand why but, there is always a different way used to access the main
code, i want to know which is the best.
main()
main's code
#top level
oh ok i understand it.. Thanks for the help guys
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
Thank you xDog and Steven. The whole assignment makes a lot of sense now
after your explanations of what hasattr is doing. Thanks
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
im trying to understand this hasattr function. i am supposed to pass in an
object and an attribute name into its parametres... so im trying to get it
to return True. Here's a quick test
class Test:
def __init__(self):
self.att = testing
e = Test()
hasattr(e, e.att)
False
Thanks for everyone that replied. I really gained a lot from all the
input. Also thanks to Dave and Prasad for explaining why i had errors
trying to run the program. I fully understand the code now and im able to
run it without errors.
___
Tutor maillist
i need help on 2 topics.
1) can someone please tell me what sys is doing, and why its using weird
indexing?
if __name__ == __main__:
A_Class(*sys.argv[1:4]).A_Class_Method()
is sys able to call methods? if so why does it need indexing if it uses * .
Obviously a Monty Python fan as I see 3 methods :)
lol i dont know what i was looking at.. yes its 3 methods sorry:(
def __init__(self):
self.zipping_directory = unzipped-{}.format(filename)
Where did filename appear from above?
sorry i didnt write everything. the init method
sorry i sent the email directly by mistake. Just like to say thanks once
again for all the help
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
sorry i sent the email directly by mistake. Just like to say thanks once
again for all the help
this email was a mistake, meant for anything mailing section.. please
ignore it
___
Tutor maillist - Tutor@python.org
To unsubscribe or change
You need to install PIL to use the tutorial you are doing.
http://www.pythonware.com/products/pil/
the site says
The current free version is PIL 1.1.7. This release supports Python
1.5.2 and newer, including 2.5 and 2.6. A version for 3.X will be
released later.
i have python 3. all the
It would appear you're running some form of event loop, such as
wxpython, tkinter, pygame, or whatever. If so, you have to do your
delays using the mechanism that system defines, not using sleep(). As
you've discovered, sleep() stops the whole thread, and that's not what
you want. What you
Hi guys. my Python tutorial set me a task to recreate a simon game
using livewires.
http://www.youtube.com/watch?v=agUABjGAJww
this is quite long, i understand if you can't help right away
summary:
i create 4 squared shaped objects(red, blue, green, yellow) as
instances for a class derived from
i have a way to set a timer for creating new objects copied from a
book but as i have started my next exercise in a very different way, i
want to avoid that math method/formula as it will cause me to
rearrange some classes totally...
i tried a simple method but its not working. any ideas? heres
Get a slower computer.
I expect that if you find an old Commodore 64 from 1982, or perhaps
an 1984 Apple Macintosh, it might be slow enough for your count down
idea to work. But with modern computers, counting up to, or down from,
5 is more or less instantaneous in human terms.
A
Sounds as though what is wanted in a Pythonic version of an early electronic
game Simon that was marketed back in the late 70's. It was roughly Frisbee
shaped although slightly larger. The top was divided into four
quadrant-shaped paddles each of a different color. The game consisted of
1 - 100 of 120 matches
Mail list logo