On 19/05/17 15:15, Peter Otten wrote:
> call the destroy() rather than the quit() method.
Nice!
>
> However, as your code gets away without calling destroy() I'm still
> puzzled...
withdraw hides the window then quit ends the mainloop
so the procedure falls through to the end and everything
On 19/05/17 10:29, Alan Gauld via Tutor wrote:
> is something that seems to work for jpegs. I hope bmp files
> will too, I didn't have any to test...
I converted a few jpg to bmp.
It does work but it turns out Pillow is quite fussy about the BMP
format. I had to turn off colour space
On 18/05/17 18:06, Alan Gauld via Tutor wrote:
> Here is some untested Tkinter code to display an image
> for 2 seconds:
I tried this last night and it turned out to be harder
than I expected. Eventually I got to bed at 3am! But here
is something that seems to work for jpegs. I hope bmp
On 18/05/17 16:43, Michael C wrote:
> os.startfile('1.bmp')
>
> works like a charm!
>
> Now I need to figure out how to close this window once I finish with it!
Sadly that is manual. Unless you care to write code to search for the
process and use the Windows API to kill it off.
If you really wa
On 18/05/17 02:58, Michael C wrote:
> when I run this, while it's called test.pyw, this pops up
>
> from PIL import Image
>
> im = Image.open('1.bmp')
> im.show()
One suggestion is to use Pillow instead of PIL.
So far as I know PIL is frozen and all new development
is on Pillow. It is backwardly
On 17/05/17 20:50, Stephen P. Molnar wrote:
> I'm beginning to think that I don't know how to ask the question as
> Google and Stack Overflow have resulted in nothing. All of the results
> seem to deal with integers.
Have you tried asking on the scipy forum?
https://www.scipy.org/scipylib/mail
On 18/05/17 00:24, Michael C wrote:
> or to find another way to display the picture without using python image
> library.
There are lots of ways it depends on what you actually want
to do with the image. For example you can run your favourite
image viewer program(that looks like what PIL is doin
On 18/05/17 00:38, Alan G via Tutor wrote:
>Please always use reply all, or reply list when responding to list
Oops, it seems like you did that already, my apologies.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my
Please use Reply-All or Reply-List when replying to the list,
otherwise it only goes to me.
On 17/05/17 17:21, Grace Sanford wrote:
> Syntactically speaking, how can I check if an element in the list
> "board" at position p equals "_" and then change that element to "0"?
You can use the == operat
On 17/05/17 21:33, Michael C wrote:
> How do I display a picture?
What do you mean? What kind of picture?
Where do you want it displayed (what kind
of window/screen)?
There are a dozen possible ways to "display a picture"
depending on what you specifically want.
--
Alan G
Author of the Learn t
On 17/05/17 20:09, Michael C wrote:
> How do I move files to a designated folder or copy/paste?
copy/paste is a UI specific thing, you don't do that in Python code.
What you do is either copy a file or move it.
The shutil module provides easy functions for both.
See the documentation for the mo
On 17/05/17 19:17, keith quach wrote:
> I hope you could help. I am new to the Python community. I am looking
> for your recommendation for a Windows 10 (64 bit) Python 3.6
> distribution package that covers all the necessary installtions/files.
It depends on what you want to do. There is no si
On 17/05/17 17:26, Grace Sanford wrote:
> with "board" with elements 0-8). If one of these is the case, it is
> suppose to print the "You won" string. Nevertheless, when I change list
> variable to reflect one of these conditions, there is no printing
> occurring. I cannot figure out why.
You
On 17/05/17 15:07, Pooja Bhalode wrote:
> */Users/poojabhalode/.bash_profile: line 1: .bashrc: No such file or
> directory*
I'd start with this one.
Where is the bash script error coming from?
Is there really no .bashrc?
If not what is the impact of not having it?
I'm also not clear what is call
On 17/05/17 14:31, Grace Sanford wrote:
> I am wondering if someone can help/advise me on finishing the code for this
> function:
Please only send one email for a given i8ssue it gets confusing
when people start responding to two different threads about
the same question.
Also please give us more
On 17/05/17 03:49, boB Stepp wrote:
> corresponding to one of his functions or methods, if he could use that
> word to run a function of the same name. I said I had done something
> once where I used the word as a dictionary key, which was then used to
> call the function.
That's the usual appr
On 16/05/17 19:49, Michael C wrote:
> I am running this code so I can do some image manipulation with them.
> The thing is, I have a lot of pictures to go through, so I can't type the
> file names
Do you know the folder where they live?
If so os.listdir() will give you a list of filenames.
If ther
On 15/05/17 07:11, Phil wrote:
> I'd like to place a red frame in the centre of the main window.
What do you want surrounding it?
You are going to have to use whichever layout manager
fits the scenario. Remember you can use different layout
managers in each frame in your app - and you will usuall
On 14/05/17 19:03, Sydney Shall wrote:
> The code that I have so far is as folows:
>
> def __str__(self):
> return("\n"
> " Output from __str__ of POCWP. "
> "\n"
> "\n After the first turnover, during the "
>
On 11/05/17 20:46, Stephen P. Molnar wrote:
>> script uses the np.savetxt() quite a few times, but one use generates
>> the title error. The offending line is np.savetxt(name_s,I_z) where I_z
>> is a single number of type float64 with a size of 1.
I'm glad you found the problem but please, when y
On 11/05/17 02:50, Rafael Skovron wrote:
> I dont understand why j can have any value other than zero in this:
>
> for i in range(1, 5):
j = 0
while j < i:
print(j, end = " ")
j += 1
Because i can go as high as 4 (from range(1,5)->1,2,3,4).
So lets consider that fin
On 11/05/17 00:54, Mats Wichmann wrote:
> and it turns out some people don't think flowcharts are really a useful
> model...
Yes, but as usual it depends. They are quite good for documenting
human based processes, which is what they were originally designed
for.
They work very well for document
On 11/05/17 01:02, Steven D'Aprano wrote:
> Looks like spam to me. A link to a mystery URL with no context, by
> somebody signing their email with a radically different name from the
> email address used,
And the address is not subscribed to the list so the message
should have gone to moderation
On 11/05/17 00:34, Steven D'Aprano wrote:
> I didn't request anything. What is this? Do you have a question or are
> you just sharing?
It was me did the requesting. Adil originally posted his
pdf's as attachments so I rejected the post, requesting
he use a link instead. Unfortunately he left out
On 10/05/17 00:25, adil gourinda wrote:
> As you requested, I uploaded my flowcharts on a web storage link as:
Thanks, although it would have helped if you included
your original message since I am the only person to
see it! It never got sent to the rest of the list.
> "https://app.box.com/s/cama
On 10/05/17 17:06, Rafael Knuth wrote:
>>> Then, there is another package, along with a dozen other
>>> urllib-related packages (such as aiourllib).
>>
>> Again, where are you finding these? They are not in
>> the standard library. Have you been installing other
>> packages that may have their own
On 08/05/17 16:23, Rafael Knuth wrote:
> Which package should I use to fetch and open an URL?
> I am using Python 3.5 and there are presently 4 versions:
>
> urllib2
> urllib3
> urllib4
> urllib5
I don't know where you are getting those from but the
standard install of Python v3.6 only has urllib
On 07/05/17 16:23, Jojo Mwebaze wrote:
> I am trying to figure out the best Python Web-Development Applications
> framework. I trying to get started with building Web-Based Applications.
> Kindly give advise which one is the best for a novice user
It depends on several factors which you haven't
On 05/05/17 14:45, Rafael Knuth wrote:
> How do I know which libraries I need to perform a certain task?
Mostly youn learn by experience, but otherwise google
(or other search engine) is your friend.
It doesn't do any harm to read the Library Reference
document on the python.org web site too, it
On 04/05/17 22:09, Alan Gauld via Tutor wrote:
> And the reasons above are only scratching the
> surface, there are many more gains that apply to
> testing in general but are only practical if
> testing is automated.
One thing I meant to add is that "automated" does
not ne
On 04/05/17 19:44, Palm Tree wrote:
> Sorry i'm a bit new to automated testing.
>
> I have explored python wide and deep but can someone just tell me why as a
> coder i need automated testing?
You don't, you can test it all by hand.
But it will take you much longer, especially after
you've done,
On 04/05/17 13:50, Stephen P. Molnar wrote:
>> I'll assume that's where the problem lies.
>> Try checking if the string is not empty before using it:
>>
>> for line in f.readlines():
>> if line:
>> atm_chg.append(float( line.split()[-1] ))
> I have edited the code:
>
On 04/05/17 13:21, Stephen P. Molnar wrote:
> Here are the error messages:
>
> Enter Molecule ID: A
> A.lac.dat
> Traceback (most recent call last):
>
>File "", line 1, in
> runfile('/home/comp/Apps/Python/Testing/ReadFile_1.py',
> wdir='/home/comp/Apps/Python/Testing')
There appears
On 04/05/17 04:11, Nathan D'Elboux wrote:
> when i run the above code it prompts me to enter the domain so i do,
> then the out put is a "Value error: Unexpected '{' in field name
Always, always, always post the full error message.
Do not shorten it to the summary line. We can't
see the location
On 04/05/17 00:32, Stephen P. Molnar wrote:
> import numpy as np
>
> name = input("Enter Molecule ID: ")
> name = str(name)
You don't need the str(), input always returns a string.
> name_in =name[:]+'.lac.dat'
And you don't need the [:]. Just use
name_in = name + '.lac.dat'
> print(name_in)
On 03/05/17 06:22, shubham goyal wrote:
> Hello tutors,
>
> here i am trying to create a cluster on cloud using json data but its
> giving some error
> File "/usr/lib/python2.7/urllib2.py", line 1197, in do_open
> raise URLError(err)
> urllib2.URLError:
It says connection refused.
Do you
On 03/05/17 00:28, Cameron Simpson wrote:
>> And so forth? I assume you mean
>>
>> MMDD.png format?
>>
>> You should read about the strftime function in the time
>
> Further to this, I would also advocate that you consider writing the
> timestamp
> from largest unit to smallest unit, like a
On 02/05/17 19:09, Michael C wrote:
> from PIL import Image
> from PIL import ImageGrab
>
> screenshot = ImageGrab.grab()
> screenshot.show()
> screenshot.save("\test\missed.png")
>
> This is my current code, using Python Image Library!
You should probably investigate Pillow, I believe
developme
On 02/05/17 19:06, Ian Monat wrote:
> I could give them reasons why .exe files won't work for me but they don't
> really care if I take the data files on their site or not.
But do they care about their reputation?
The biggest issue here is not the technical one but the security
one, they could b
On 02/05/17 04:03, Michael C wrote:
> holy cow
I did warn you it was non trivial :-)
Basically Eryksun has done what your scripting
tool is doing in the background.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my phot
On 02/05/17 01:42, David Wolfe wrote:
> I'm working through Pycharm Edu, and I'm stuck on the following:
>
> phrase = """
> It is a really long string
> triple-quoted strings are used
> to define multi-line strings
> """
> first_half = phrase[:len(phrase)//2]
> print(first_half)
>
>
> The instr
On 02/05/17 01:12, Ian Monat wrote:
> 1) Use Python to download the file from the web (but not by using a
> webscraper, according to Alan)
Things like BeautifulSoup will help you read the HTML and
extract links etc but they won't help you actually fetch
the file/documents from the web site. A pac
On 01/05/17 18:20, Ian Monat wrote:
> ... I've written a script using the requests module but I
> think a web scraper like Scrapy, Beautiful Soup or Selinium may be
> required.
I'm not sure what you are looking for. Scrapy, BS etc will
help you read the HTML but not to fetch the file. Also do
you
On 01/05/17 19:28, Michael C wrote:
> Hi all, I found out that one way to press ESC to kill the script was to
> use my previous script language, AutoHotKey and this is how it works:
>
> ## When ESC is pressed, runs the function 'kill'
> Esc::kill()
> Is there a way to write it i
On 01/05/17 15:54, Stephen P. Molnar wrote:
> Unfortunately, I'm still missing something. Here is my latest attempt
> to incorporate your solution:
> name = input("Enter Molecule ID: ")
> name = str(name)
you don't need the str() since input() always returns whatever string
the user enters.
> name
How, embarrassing, I forgot to CC the list! :-)
On 30/04/17 11:09, Stephen P. Molnar wrote:
> I would have managed to extract input data from another calculation (not
> a Python program) into the following text file.
>
> LOEWDIN ATOMIC CHARGES
> --
> 0 C : -0.78063
On 26/04/17 07:56, Phil wrote:
>> Your messages come into the moderation queue, I'm
>
> Thanks Alan, maybe the reason ...is because I'm
> on the bounces list.
I don;t know what bounces list you mean but it looks
like your messages are going through directly now,
I don't know what changed...
Po
On 30/04/17 00:58, Phil wrote:
> Thank you Ben. A rethink of the problem during the 20 hours since
> I posted my most recent question has led to a solution.
You don;t say what so i'll go with what you say below...
> The strings are the given numbers while the sets are
> the likely candidates.
On 25/04/17 12:39, boB Stepp wrote:
>>> I wish the displayed window to initially display with no button
>>> selected. What am I missing here?
>>
>> It looks like the empty string is special. On my (linux) system all buttons
>> appear grayed (while a selected button would be black). Any other stri
On 29/04/17 18:13, Rafael Knuth wrote:
> can anyone recommend good resources? I am primarily in search of
> simple, clean code examples & practical usecases (Google APIs for
> example).
An API is just a set of classes or functions.
The Python standard library is an API.
You already have lots of
On 24/04/17 23:40, Phil wrote:
By the way, I notice that my messages to this list,
> and not other's, can take up to four hours
Your messages come into the moderation queue, I'm
not sure why because the moderation flag is not
set on your account(it is automatically for new
members).
I'll have
On 24/04/17 20:02, Alan Gauld via Tutor wrote:
And you could wrap that up as a pair of get/set
functions if you so wished.
def get_sudoku_grid(x,y):
# code above
return item
def set_sudoku_grid(x,y,value):
#code above
item = value
I should point out that to use my table code
On 24/04/17 01:50, Phil wrote:
On Mon, 24 Apr 2017 09:24:55 +1000
Phil wrote:
On Sun, 23 Apr 2017 09:39:54 +0200
Sibylle Koczian wrote:
Am 20.04.2017 um 14:43 schrieb Alan Gauld via Tutor:
Its not too bad you can map the large 9x9 table to the smaller
units using divmod()
So the 7th
On 20/04/17 13:43, Alan Gauld via Tutor wrote:
> So the 7th element becomes
> divmod(7) -> 2,1
>
> ie. element 7 maps to the 2nd cell, element 1
That should of course be the 3rd cell (0 based), oops.
--
Alan G
Author of the Learn to Program web site
http://www.ala
On 20/04/17 11:48, John R wrote:
> I am just trying to understand that how it is possible to
> frame test cases on data science projcets using python!
Can you clarify what you mean by "data science" projects?
Do you mean projects built in Python and how to use, say, unittest with
that code?
Or
On 20/04/17 11:56, John R wrote:
> Most of the examples in google are looking simple in automation so I am not
> getting an understanding of how a complex data processing application is
> to be tested using python.
Is this a different question to the other one you posted?
If so in what way?
If
On 20/04/17 10:33, Phil wrote:
>> So, for a Suduko grid put 3x3 Entry boxes into a Frame.
>> Then put 3x3 such frames into another frame.
>
> OK, so I'll go back to my original idea and use edit boxes. A grid of 9 x 9
> edit boxes does actually work and it makes it easy to keep track of the
> d
On 19/04/17 23:48, Phil wrote:
> I created a 9 x 9 grid on a canvas which looks much better.
> I can display digits in the centre of the squares but
> entering the digits from the keyboard seems to be beyond me.
Eek! that's a recipe for premature baldness!
Canvas is designed to display things no
On 18/04/17 03:12, Tyler Seacrist wrote:
> How do I avoid this error message everytime I utilize wordlist =
> open("words.text") ?
>
wordlist = open("words.txt")
> Traceback (most recent call last):
> File "", line 1, in
> wordlist = open("words.txt")
> FileNotFoundError: [Errno 2] N
On 19/04/17 11:35, Mohanad Ismail via Tutor wrote:
> Read data from serial and write to file 1 for 15 sec,
> after the 15 seconds continue writing the data on to
> file 2 for 15 seconds
>... each file should write for 15 seconds and stop for 15 seconds
> Code:
> #!/usr/bin/env python
> from date
On 19/04/17 08:43, Alan Gauld via Tutor wrote:
> Probably because it is such a rare use case and because
> its not that hard to do yourself if you really need it.
Having read Steven's post I'll retract the bit about
it being not that hard! :-)
But I still think its a fairly rare
On 19/04/17 03:21, Marilyn Davis wrote:
> connection.execute("SELECT * FROM BRIGHTEST")
>
> returns a , not a regular python
> sequence.
Pretty much everything inn SQL land uses cursor objects.
It's why best practice creates an explicit cursor for
executing statements rather than the impl8ici
On 19/04/17 08:28, Thomas Güttler wrote:
> Nice, if it is that simple.
>
> Is there a reason why this is not in the standard library?
Probably because it is such a rare use case and because
its not that hard to do yourself if you really need it.
But the standard library, like any open source pr
On 18/04/17 17:55, Rafael Knuth wrote:
> I wanted to start my first project using matplotlib (I have never
> worked with libraries before).
Every time you do an import you are using a library.
eg
import sys
import os
etc
It's no big deal.
> I am trying to get started with VS Community 2017,
>
On 18/04/17 11:00, Thomas Güttler wrote:
> I would like to have read-only class properties in Python.
Is there a specific reason why? Do you think for example
that users of the class will deliberately try to modify
the attribute? Normally in Python we leave all attributes
public and unprotected (p
On 18/04/17 00:13, Phil wrote:
> Thank you for reading this.
>
> How do I reference the_canvas from my solve() method?
> class Sudoku(Frame):
> def __init__(self, parent):
> Frame.__init__(self, parent)
> self.parent = parent
>
> parent.title("Sudoku solver")
>
On 18/04/17 00:36, Marilyn Davis wrote:
> #!/usr/bin/env python3
> """
> Hello Tutors,
>
> I can't figure out why the FillWithStars() function puts Canopus in the db
> twice.
>
> What am I missing?
I don;t know but I converted your script into the more
conventional form and it worked. it was the
On 16/04/17 18:26, Tyler Seacrist wrote:
> I need to draw a stack diagram for print_n
> called with s = 'Hello' and n=2 and am unsure of how to do so.
Me too.
What is print_n?
Which stack?
One in your program or the interpreters internal stack?
We need a lot more detail.
--
Alan G
Author of
On 17/04/17 05:01, boB Stepp wrote:
> Am I missing anything? If not, then why did the code snippet use the
> (I believe to be misleading.) class variable approach with "func =
> mySuperWhammyFunction" and "self.func(self.arg)"?
I suspect it was a slightly broken attempt at reuse in that
you can
On 16/04/17 16:21, boB Stepp wrote:
> I did this and it indeed works. But how do I use this technique to
> unittest the given function? I am just not seeing how to do it with
> this with this mixin approach, and I have yet to study mixins, though
> apparently I have just now started!
I'm not fa
On 16/04/17 03:18, Aaron Myatt via Tutor wrote:
> My favourite book on testing. It is a pretty thorough walk through of
> building a django app that helps you get a feel for the TDD work flow and
> red, green, refactor cycle. A rather more practical and real world
> applicable introduction to TDD,
On 16/04/17 00:17, boB Stepp wrote:
> --
> #!/usr/bin/env python3
>
> def mySuperWhammyFunction(any_input):
> return any_input
This is a simple function, its not bound to an object
>
> import unittest
>
>
On 15/04/17 15:33, Rafael Knuth wrote:
> can anyone point me to good learning resources on this subject?
I'd recommend YouTube as your first port of call.
There are a few python unit test videos but most of
the best stuff is Java focused, but it translates
to Python easily enough.
Once you've wat
On 15/04/17 09:33, Aero Maxx D wrote:
> With Python I'm not finding which modules I need
Search for the functionality within the python.org site.
The documentation tells you which module you are looking for.
> ...I thought I'd connect to a MySQL database
There is a standard DB interface in Py
On 15/04/17 03:17, Palm Tree wrote:
> s="2*3+3(8-4(5+6+9))+2+3+3(4/4)"
>
> i want to find expression enclosed in brackets.
>
> i want outputs to be like:
> (8-4(5+6+9))
> (5+6+9)
> (4/4)
>
You probably could do it with some fancy regex but personally
I'd investigate a proper text parser. There
On 15/04/17 03:38, Alex Kleider wrote:
>> Whatever he does he will need to separate his UI from his
>> logic - a good programming skill regardless of UI.
>
> Can anyone suggest a good tutorial that explains exactly what this means
> and how to achieve it?
> (separate UI from logic I mean.)
I do
On 14/04/17 19:29, shubham goyal wrote:
> sorted function is not working when i am trying to sort the list of strings
> but list.sort() is working. can you please help me understand.
sort() sorts the list "in place". That is it sorts itself.
sorted() returns a sorted copy of the list. It does not
On 14/04/17 13:41, Stephen P. Molnar wrote:
> The equation that I a want to evaluate (the one that I programmed in
> FORTRAN) is equation (7) in the attached scan of one of the pages of
>
> Stephen P. Molnar and James W. King, Theory and Applications of the
> Integrated Molecular Transform and
On 13/04/17 17:32, Rafael Knuth wrote:
> Is there a way to split these two into separate steps:
> a) creating a .json file
> b) manipulating it (a, r, w ...)
Of course.
> What if I just wanted to create a .json file and do nothing with it?
>
> import json
> file_name = "my_numbers.json"
>
> The
On 13/04/17 17:10, marcus lütolf wrote:
> Dear experts, Mats
> I have found the solution, I put the counting variable at the wrong place:
I don;t think so, what you have done now is count the times
through the loop, but thats not (always) the same as the
number of times the function gets called,
On 13/04/17 15:33, Christina Hammer wrote:
> I downloaded the newest version of Python on my windows computer and am
> having some trouble using it. I need to save my work because I am using it
> for an online class and am going to have to send it to my professor. But I
> cannot access a tool bar
On 12/04/17 15:32, Daniel Berger wrote:
>For me it is not clear what is going wrong and I would be happy to get
>some help to solve the problem.
This list is for the core language and library, so while we
can help with installing third party packages that doesn't
mean anyone here will kno
On 12/04/17 13:47, Wim Berrelkamp wrote:
a=2
Here you assign the number 2 to 'a'
d=a+4
print(d)
> 6
> a=input('-->' )
Here you assign whatever character(s) the user types to 'a'.
The fact that it looks like 2 doesn't change the fact that it
is really the character '2'. So you nee
On 11/04/17 19:44, Mats Wichmann wrote:
> import decimal
>
> Pi_Number =
> str(decimal.Decimal(3.14159265358979323846264338327950288419716939))
>
Unfortunately that doesn't work either:
>>> " " + str(decimal.Decimal(
... 3.14159265358979323846264338327950288419716939))
' 3.1415926535897931
On 11/04/17 17:48, Rafael Knuth wrote:
> Pi_Number = str(3.14159265358979323846264338327950288419716939)
> Pi_Number = "3" + Pi_Number[2:]
> print(Pi_Number)
> 3141592653589793
>
> How come that not the entire string is being printed, but only the
> first 16 digits?
There are two problems h
On 10/04/17 10:18, Phil wrote:
> def my_method(self.event):
> print("method called")
>
> (self.event) is a syntax error and if I leave off "self", this is the result:
You want two parameters
self becaiuse its a method of a class so must have a self
event which is the event passsed by the GUI
On 10/04/17 08:55, marcus lütolf wrote:
> Dear experts,
> I have written the following code for motion detection with a PIR sensor
> with a function and
> I need to count how many times the funtion is called, but I get a traceback:
>
> #!/usr/bin/python3
> import sys, time
> import RPi.GPIO as gpi
On 10/04/17 05:43, Phil wrote:
> I would like a function to be called when I enter text
> and then tab to the next entry box.
One of the things about Entry boxes is that they are extremely
flexible and have many event types associated with them.
The consequence of this is that you as a programmer
On 09/04/17 11:42, shubham goyal wrote:
> Hello, I am a c++ programmer and wants to learn python for internship
> purposes. How can i learn the advanced python fast mostly data science
> packages, I know basic python.
There are tutorials on most things.
But it depends on what you mean by advanced
On 09/04/17 13:58, Mats Wichmann wrote:
> All of these can of course be done without enums. So the extra benefit
> of an enum is that the set is closed (immutable) and requires
> uniqueness: picking some other value will be an error,
Indeed, good catch. The value of an enum over an integer is
t
On 09/04/17 04:00, boB Stepp wrote:
> understandable to me, but I am having difficulty imagining where I
> might want to use these features.
>
Steven has given the basics, here are a few more real world examples:
Any kind of status value:
(open,closed,opening, closing,locked) - control valve
(
On 08/04/17 13:49, Rafael Knuth wrote:
>> b = "3"+b[2:] #Removing the decimal point so that there are digits only in
>
> my_number = 3.14159
Here you assign a floating point number to mmy_number but
the code Sama wrote was for working with strings read
from a text file.
You would need to conve
On 07/04/17 20:21, Phil wrote:
> After a bit more thought I now realise that I just
> need to use self to reference e[][] in my check function.
You need to use self any time you access any member of your
class. So in your case:
class TestGUI:
def __init__(self, master):
self.master
On 07/04/17 17:00, Phil wrote:
> ...I'm now having a problem knowing when to use the "self" reference.
self is needed every time you use an instance attribute or method.
It is equivalent to 'this' in C++(or Java), but in Python it is
never implicit you always have to explicitly specify self when
On 07/04/17 23:01, Tianjiao Cui wrote:
> Hi, all. I have met a very annoying issue that i messed up with IDlL
> configuration. I changed "run" key in settings but i found it does not work
> and then i tried to reset it to default but i failed.
You need to give us more detailed descriptions of wha
Please always send the full error trace not just the last line. The
message is full of useful details which we can't currently see.
On 07/04/17 09:28, Allan Tanaka via Tutor wrote:
> Hi
> I have added b so that it translates into bytes object. save_cPickle part is
> not problem...
> But i still
On 07/04/17 11:08, Phil wrote:
> ...In this case I become confused because had expected [][]
> to be the same as a C two dimensional array.
It is, sort of.
If you set the data up correctly to start with :-)
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.am
On 07/04/17 03:09, Phil wrote:
> Thank you for reading this.
>
> This is my first attempt at using Tkinter and I've quickly run into a problem.
>
Peter has already answered the problem but I'd like
to point out how he used the interactive prompt >>> to
demonstrate what was going wrong. You shoul
On 07/04/17 06:07, Some Developer wrote:
> How would I go about writing a Python 3.6 script for Windows that would
> sniff the network traffic and take the individual packets and then
> reassemble them into something that is useful data?
That is definitely possible using Python although it is f
On 05/04/17 20:07, Fazal Khan wrote:
> assign different variables with each loop
You can't, but you can fake it...
> def BeamInfo(x):
> for Bnum in x:
> if plan1.IonBeamSequence[Bnum].ScanMode == 'MODULATED':
> TxTableAngle =
> plan1.IonBeamSequence[Bnum].IonControlPointSeq
801 - 900 of 1423 matches
Mail list logo