On 11/10/18 04:19, Holly Jo wrote:
>
> I have no clue what I’m doing wrong, I’m a new student
>
> food_1=input("Sushi")
> food_2=input("Quesdilla")
> new_food=food_1+food_2
> print("Combining these foods will you,",new_food)
> input("Press enter to continue")
Please always tell us what has gon
On 10/10/18 20:54, Mats Wichmann wrote:
>>> This is actually the concept of test driven development (TDD), which I'm
>>> not a huge proponent of personally, but kind of useful for this:
>>
>> I'm curious: What are the things you find less than satisfactory for TDD?
> "TDD as religion" seems to m
On 10/10/18 10:53, Mariam Haji wrote:
>...my current challenge
> with the projects bit is how to pseudo-code and which approach to use as I
> am not very familiar with the entire python syntax and how I can use it
And that's the whole point of doing projects. You need to
really be comfortable wit
On 09/10/18 20:09, Mariam Haji wrote:
> Hi guys, I am on the last exercises of learn python the hard> by Zed.A Shaw
> and I am looking for recommendations on what
> to follow next or what book to try next
The main thing is to write a lot of code, so think of a
project and build it. The experience
On 09/10/18 17:32, Mark Lawrence wrote:
> On 09/10/18 17:10, Alan Gauld via Tutor wrote:
>> On 09/10/18 13:45, Chip Wachob wrote:
>>
>>> Another related question. How do I know I want to do dir(int) vs.. I
>>> don't know dir(long)?
>>
>> Beca
On 09/10/18 14:21, Chip Wachob wrote:
> The API is providing me with a bytearray-formatted result, but the API
> only reads one whole byte, or eight bits, at a time.
Being slightly picky but an octet and a byte are subtly different.
An octet is a group of 8 bits with no meaning attached.
So an
On 09/10/18 13:45, Chip Wachob wrote:
> Another related question. How do I know I want to do dir(int) vs.. I
> don't know dir(long)?
Because you want to convert the byte array into an int.
And there is no long in Python...
> And, when I do dir(int) I get the following results. I must not be
>
On 09/10/18 02:55, Chip Wachob wrote:
> This bit stream is complicated in that I have to reverse the bytes as
> well since I'm reading off the 'end' of a bunch of registers. So, the
> MSByte comes to me first and goes into the [0] location and the extra
> bits get added to the '0th' end of the LS
On 09/10/18 02:48, Chip Wachob wrote:
>> bytearray(b'\x00\xff\x7f\x00')
>> py> n = int.from_bytes(b, 'big')
>
> I'm not familiar with this int.from_bytes.
>
> Being new to Python, I don't have a mental library of these nifty
> functions. How / where does one find a library of these wonderful
>
On 05/10/18 21:17, Chip Wachob wrote:
>
> I have an array of bytes. Up to 64, which makes for 512 bits.
>
> I am reading these bytes in serially, and once I have a collection of
> them, I want to shift them by 'n' bits. The size of the array and the
> number of bits are both variable up to the l
On 04/10/18 20:02, Roger Lea Scherer wrote:
> In the example pictured below, the array has 2 axes. The first axis has a
> length of 2, the second axis has a length of 3.
> [[ 1., 0., 0.],
> [ 0., 1., 2.]]
>
> (I think) I understand the 2 axes. [1,0,0] (I'm lazy and don't want to type
> the peri
On 04/10/18 15:15, Roger B. Atkins wrote:
> That's very helpful, thanks. After reading the Tutor information last
> night, I wrote a little program I named sysinfo. The code run line by
> line in a Spyder console yields:
>
> In [3]: sys.path
> Out[3]:
> ['',
> 'C:\\Users\\rba21\\Anaconda3\\python
On 04/10/18 05:22, ramanpreet baidwan wrote:
> Can anyone tell me how to code to display permutations in a table
> for all values of z=x^2+y by getting input from user for range of x and y?
There are several problems with your question.
First it sounds suspiciously like homework and
we won't do t
On 04/10/18 04:20, Roger B. Atkins wrote:
> System: Windows 10, Anaconda, Python 3, Spyder3
>
> I changed my system path variable to include:
> C:\Users\rba21\Anaconda3\lib\site-packages# Result: same error message
When you say the "system path" do you mean the PYTHONPATH
variable? It's PYT
On 30/09/18 02:22, Jorge Herrera wrote:
> Hello, I'm new to Python and I've been having a frustrating time with
> python because I'm trying to import tkinter and it's saying that tkinter is
> not defined, that it doesn't exist
That suggests that Tkinter is not installed on your system.
What OS ar
On 28/09/18 20:03, Rahul Koparde wrote:
> How to install twilio module in python?
Searching "python install twilio" on Google yielded:
https://stackoverflow.com/questions/51985401/how-to-install-twilio-via-pip
It may help.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me
Forwarded to list
I have, I suspect, an elementary problem that I am too inexperienced to
resolve.
I have two numpy arrays, each representing the values of a specific
property of a set of cells.
Now, I want to associate the two values for each cell, that is fo
On 11/09/18 23:31, Denis Dzhindo wrote:
> Hello!
> May I know, how I can clean the Shell,
I'm not sure what you mean by that, however,
if you mean reset the IDLE shell back to square
one there is a menu option to restart the shell.
Shell->Restart Shell.
If you mean the command line interpreter th
On 11/09/18 19:57, Roger Lea Scherer wrote:
> Can you direct me to where or how to update from Python 3.6.5 Shell, I
> think it is also called IDLE 3.6.5, to Python 3.7 Shell?
The Python shell and IDLE are really two different things.
The shell is normally considered to mean the interactive
inte
On 10/09/18 19:15, Chip Wachob wrote:
> So I see why my .join() isn't working. I'm not sure how to fix it though.
I already showed you the sum() function.
It can take a list of lists and add them together
end_array = sum(results,[])
> My background is in C and other 'historical' languages, so
On 10/09/18 04:00, Chip Wachob wrote:
> I presume that I need to instantiate an array of slice_size-sized bytearrays.
Cameron has already addressed this and explained
that you don't need to and if you did how to do it.
I'd only add that you need to readjust your thinking
when it comes to Python
On 08/09/18 03:15, Chip Wachob wrote:
> my function's main pieces are:
It would probably be better to post the entire function,
a partial code sample like this just gives us an inkling
of what you are trying to do but not enough to be sure
of where the errors lie.
> def transfer_byte_array():
>
On 08/09/18 03:15, Chip Wachob wrote:
> Admin, please remove my earlier messages.
No can do, once the emails are sent by the server
they are out there on the net, stored in people's
mailboxes and in various internet archives.
When using a mailing list always check before
sending, there's no going
On 08/09/18 04:57, Chip Wachob wrote:
> was my attempt at 'setting' the type of the variable.
A variable in Python is just a name. It has no type.
Only values have types. So you can set (or change)
the type of a value but not of a variable.
> Coming from a 'C' background, I find the lack of ty
On 06/09/18 20:09, Roger Lea Scherer wrote:
> I removed the "3" in "python3" and it works; along with moving the "www"
> folder to where python resides. Thanks for the help.
That may appear to work but I suspect its just hiding the real issue
which is about setting the correct path values.
Did y
On 06/09/18 17:32, Brandon Creech wrote:
> Hi, I am working to forecast the temperatures for the next 5 days using an
> API and a for loop. I would like write the output of this loop to a csv in
> this format::
>
> Columns: City, min1, max1, min2, max2,min3,max3,min4,max4,min5,max5
> data:
On 06/09/18 04:14, Donna Black via Tutor wrote:
> How do we save our work on python? IDLE hasn’t installed itself on my
> computer
Which OS are you using? That will help us
find/install IDLE.
However, you don't need IDLE to work with Python,
just a text editor.
If I assume you are using Window
On 05/09/18 18:12, Chip Wachob wrote:
> In your examples name1 and name2 could be anything that is contained
> in that module.. a variable, function, class, etc.. correct?
Correct. They are just names.
Again a difference between Python and C.
In C a name is a label associated with a memory addr
On 05/09/18 15:06, Chip Wachob wrote:
> Okay, I think I'm starting to get a handle on the visibility of
> things. As you said, much different than C.
Yes. The significant thing is to remember that in
Python you are importing names. In C you include
the contents of the file.
#include
Lets you
On 05/09/18 14:05, Chip Wachob wrote:
> # module AdafruitInit.py
> # from the Adafruit tutorials..
> import Adafruit_GPIO.FT232H as FT232H
> import Adafruit_GPIO as GPIO
>
> FT232H.use_FT232H()
>
> ft232h = FT232H.FT232H()
>
> # config settings for the SPI 'machine'
> spi = FT232.SPI(ft232h, 4, 200
On 05/09/18 04:12, Chip Wachob wrote:
> # module RSI.py
> def write(byte):
>spi.write(byte)
You don't have any import statements here.
You need to import spi to use it.
> # toggle the latch signal
>ft232h.output(5, GPIO.LOW)
>ft232h.output(5, GPIO.HIGH)
And the same for ft232h
>
>
On 04/09/18 16:10, Chip Wachob wrote:
> (like I would do in C). I then used the import statement to 'include'
> them into the main.py file.
OK a basically good idea but how did you use the import statement?
There are many forms:
import foo
from foo import name1, name2,...
from foo import *
impo
On 02/09/18 14:27, kanzan wrote:
> ☻ I found direct method of octal and hexadecimal conversions ☻ (without
> using binary or decimal)
I'm not sure what you mean but numbertheory has been
around for along time and has long had methods to
convert from one base to another (not just computer
bases but
On 01/09/18 18:40, Dana O'Connor wrote:
> I've been trying to download and use Python 3.7 for the past few days
How exactly did you download it (from which site and in which format?)
And how did you then install it?
> every time I try to open it it tells me I don't have "pip"
That seems unlik
On 01/09/18 12:41, krishna chaitanya via Tutor wrote:
> Below is my code, i am frequently hitting timeout issue to login to linux or
> router.
Have you tried extending the timeout?
> child = spawn('su x',timeout = 50)
What is the timeout interval? If its in milliseconds
then 50 is much to
On 30/08/18 10:30, Cameron Simpson wrote:
>> That is inherent in using version control systems.
>
...> state. Personally I use mercurial which does include the
permissions in the
> state.
Ah, interesting. I've never found a VC system that preserved
permissions. Usually they zap everything to re
On 30/08/18 03:56, Matthew Polack wrote:
> Hi,
>
> We have a spreadsheet from a local weather station.it summarises the
> amount of rainfall per day since 1863.
>
> http://www.bom.gov.au/jsp/ncc/cdio/weatherData/av?p_nccObsCode=136&p_display_type=dailyDataFile&p_startYear=1863&p_c=-1249186659
On 30/08/18 00:09, Roger Lea Scherer wrote:
> I'm trying to implement a local host. My instructions tell me to type the
> following command in the command line, make sure I'm in the "www" folder
So this is not the folder where python3 is installed. (See below)
> python3 -m http.server --cgi 8000
On 30/08/18 04:44, boB Stepp wrote:
> good news side we went from the vi editor to Vim/gVim; from Python 2.4
> to 2.7; in addition to Tkinter there is now a Python interface to GTK;
> went from no SQLite to having it; and a few other goodies that
Hooray!!!
> system installed, SCCS (RIP!) went by
On 28/08/18 02:53, boB Stepp wrote:
> Wouldn't a single JSON file be wasteful? If I used this program for a
> couple of years or so and habitually played a lot of solitaire, that
> would be a lot of stuff to load into RAM when on any given solitaire
> session I might only play one to three kinds
On 27/08/18 04:58, boB Stepp wrote:
> So you are saying do something like:
>
> class SolitaireGame():
> def __init__(self, name):
> self.name = name
>
> def describe_self(self):
> print("This game of solitaire is called", self.name, ".")
>
> game_objects = {}
> def make_
On 26/08/18 18:42, Michael Munn wrote:
> I’m using Python 3.6 and I heard a friend of mine told me that He write his
> code using a word processer called Note pad plus some thing like that to
> code.
I assume you are on Windows OS?
In which case you probably mean Notepad++ (like
in the C++ progra
On 26/08/18 23:38, boB Stepp wrote:
> class SolitaireGame():
> def __init__(self, name):
> self.name = name
> Say I go with the aforementioned game with 13 separate scores to keep
> track of. The names of these games might be "Two_Mastery",
> "Three_Mastery", ... , "Ace_Mastery". In
On 24/08/18 10:02, Alan Gauld via Tutor wrote:
> CCing list, please always use Reply-All or Reply-List when responding
> to the tutor list so that everyone gets a chance to reply.
>
>
> On 24/08/18 00:35, Roger Lea Scherer wrote:
>>
>> Lots of code missing, but the lin
CCing list, please always use Reply-All or Reply-List when responding
to the tutor list so that everyone gets a chance to reply.
On 24/08/18 00:35, Roger Lea Scherer wrote:
>
> Lots of code missing, but the line I'm interested in is this:
> print("Your number " + str(numerator) + "/" + str(denom
On 23/08/18 06:10, Matthew Polack wrote:
> I'm also trying to solve the rounding issue...but can't work out the syntax
> using the example provided...have tried this but I get an error...
>
> def viewPercent():
> percentCalc = score/total*100
> percentViewLab["text %.2f"] % percentCalc
On 23/08/18 05:47, Matthew Polack wrote:
> Hi Alan,
>
> I'm working my way through some of the tips you provided and tried to use
> the code givenbut am getting an error at Line 75 in my code re: not
> enough arguments for format string
>
> _
> return self.func(*args)
> File "Timespict
On 22/08/18 17:27, Mats Wichmann wrote:
> I'm really unfond of accessing members of a collection by numeric index.
>
> >>> numer, denom = d["twothirds"]
> >>> print(numer, denom)
> (2, 3)
>
> I think that's nicer than: numer = d["twothirds][0]
You can alsao avoid indexes with the namedtu
On 22/08/18 15:45, JGledhill via Tutor wrote:
> I'm at the point where I want to actually start "programming",> and solving
> problems by thinking through them, not just copying code
examples.
Well done, it's good to recognise that stage in your development.
> Any recommendations on how I can b
On 22/08/18 11:29, Rafael Knuth wrote:
> my code below did not require a return statement, hence I was assuming
> it wouldn't be needed in my function either.
return is only used inside a function, it makes no
sense outside (and is a syntax error). Its purpose
is to return a value to the caller o
On 21/08/18 23:27, Roger Lea Scherer wrote:
> I can't find anything in StackOverflow or Python documentation specifically
> about this. They talk about accessing a list or a tuple or a dictionary,
> but not when the value is a tuple or list.
The value is irrelevant youi access the value in
exactl
On 22/08/18 07:46, Rafael Knuth wrote:
> import pandas as pd
> cities_lst = pd.read_table("cool_cities.csv")
> cities_lst.head()
>
> I was trying to rewrite the above as a function.
> Unlike my code above, my function below did not return the first 5
> rows, but just nothing:
>
> def cities(file_
On 21/08/18 14:10, Glenn Schultz via Tutor wrote:
> Either I am a complete moron or packaging python is a poorly documented
> nightmare.
I suspect the latter is true to some extent.
To be fair Python packaging was a complete mess for
many years with competing technologies and tools.
It is only
On 21/08/18 12:16, Jacob Braig wrote:
> I am just starting out coding and decided on python.
It looks like you are using Python v2 (maybe v2.7?) but
the latest version is 3.7 and for beginners we normally
recommend adopting v3. It doesn't change anything much
in this case but it saves you relearn
On 19/08/18 12:11, Abdur-Rahmaan Janhangeer wrote:
> btw qpython supports sl4a since long
>
> maybe you meant : "no packaged options"
Never heard of sl4a, ... OK I did a search.
Its a scripting interface to the Android API that
supports Python.
It looks interesting, next time I have a spare week
On 17/08/18 03:19, Matthew Polack wrote:
> def viewPercent():
> percentCalc = score/total*100
> rounded = round(percentCalc, 2)
> percentViewLab["text"] = rounded
Since you only want the rounded value for display
this is usually achieved using string formatting:
>>> s = "Here is a st
On 17/08/18 03:19, Matthew Polack wrote:
> 1.) Centre feature
>
> When I use txt.insert I need to use the feature Peter found...
>
> center = txt.tag_config("center", justify="center")
> txt.insert(0.0, result, "center")
>
> but in the Enter label section...I could just use it straight away..wit
On 17/08/18 05:40, Matthew Polack wrote:
> Does this always require Python being installed as a full language on the
> end users computer?
No. It does require the Python interpreter plus any modules
you write or use(including any modules your modules use...)
There are a few tools around that can
On 16/08/18 08:18, Matthew Polack wrote:
> The last remaining issue is the program does not calculate the percentage
> right when you make mistakes...it just keeps giving a result of 100%.
> def percentCheck():
> global percentScore
> global score
> global mistakes
> global total
On 15/08/18 18:45, Hamid Nehoray via Tutor wrote:
> Greetings,
Greetings, welcome to the tutor list.
> I'm an old programmer who has some old ERP systems...
> I need somebody to teach me the new ways using Python,
For anyone who can already program I always recommend
starting with the official
On 15/08/18 10:18, Peter Otten wrote:
> Matthew Polack wrote:
>
>> *Question 2:*
>> Is there a way to centre text within the text frame? I can change the font
>> and size...but don't know how to centre it?
>
> Ok, I wanted to know it myself, and found
>
> https://stackoverflow.com/questions/4256
On 15/08/18 08:32, Rafael Knuth wrote:
> I am trying to wrap my head around naming conventions & semantics in Python.
A good question with a none to simple answer.
In truth some of it goes back to essentially
arbitrary decisions made by Guido vanRossum
when he originally designed Python!
The othe
On 15/08/18 01:56, Matthew Polack wrote:
> from tkinter import *
>
> import random
>
> answer = "global"
You have the right concept but the wrong implementation.
To declare a variable as global you declare it as normal in the outer
scope then inside each function that uses it add a global line
On 14/08/18 22:38, Cameron Simpson wrote:
> If you're trying to partition words into values starting with "x" and values
> not starting with "x", you're better off making a separate collection for the
> "not starting with x" values. And that has me wondering what the list "b" in
> your code was
On 14/08/18 23:16, Peter Otten wrote:
> For a simple solution you do need a and b: leave words unchanged, append
> words starting with "x" to a and words not starting with "x" to b.
>
> Someone familiar with Python might do it with a sort key instead:
Or, for one definition of simple, a list co
On 14/08/18 09:11, Deepti K wrote:
> when I pass ['bbb', 'ccc', 'axx', 'xzz', 'xaa'] as words to the below
> function, it picks up only 'xzz' and not 'xaa'
Correct because
> def front_x(words):
> # +++your code here+++
> a = []
> b = []
> for z in words:
> if z.startswith('x'):
>
On 14/08/18 07:56, Rafael Knuth wrote:
> List comprehension is really cool. One thing I like about list
> comprehension is that you can get a dictionary, tuples or lists as a
> result by just changing the type of braces.
>
> # dictionary
> colors = ["red", "blue", "white", "yellow"]
> colors_len
Forwarding to list since I seem to have messed up the address last time...
Forwarded Message
Subject:Re: [Tutor] Argparse Error
Date: Sun, 12 Aug 2018 23:44:04 +0100
From: Alan Gauld
Reply-To: tutor
To: Nathan Johnson
On 12/08/18 19:58, Nathan Johnson
On 13/08/18 06:15, Gautam Desai wrote:
> I am currently working with the lattice.py code attached.
The server doesn't like attachments so strips them off
for security. As a result we can't see the code.
Please resend, but paste the code into the body of your
message (in plain text to preserve f
This thread is getting seriously off topic, but I'm
interested so I'm letting it run... :-)
On 13/08/18 07:46, Wallis Short wrote:
> To learn Ubuntu, I would recommend installing Windows Subsystem for Linux
> onto your existing Windows 10 setup and then get the Ubuntu (or SUSE and
> Debian) from
On 12/08/18 18:59, Nathan Johnson wrote:
> Here is what comes out when I use the command for each program.
>
> Command Prompt:
> C:\Users\natha> C:\WINDOWS\PROMPT> python D:\Python\bytsh.py
> D:\Video\test.mp4
> 'C:\WINDOWS\PROMPT' is not recognized as an internal or external command,
> operable pr
On 12/08/18 16:52, Nathan Johnson wrote:
> Okay so I downloaded and saved the script as a .py file in a folder named
> Python on the D; Drive, and also moved my video file to a folder in my D:
> drive with the name Video. I tried using it in Command Prompt, Python, and
> Python IDLE, but I got the
On 12/08/18 00:51, Nathan Johnson wrote:
> Hello I am trying to glitch video files for artistic purposes by using a
> scrip I found on Reddit (linked below). This is the first time I have tried
> to use Python and I need some help with an error that I keep getting after
> I input this first part o
On 11/08/18 18:48, Carlos Monge wrote:
> have learned To do those sections I need to install Pygame and make sure I
> have 'pip' as well as Matplotlib.
If you are using a recent Python (v3.4+) then pip should
already be installed. PyGame comes with a Windows installer
that should set everything
On 09/08/18 05:10, Matthew Polack wrote:
> I'm trying to configure a button that prints a variable and calls a
> function at the same time...but I can't figure out how to get the syntax
> right...or if this is even possible:
Of couse its possible just wrap it in a higher level function:
def newfu
On 07/08/18 22:32, Evuraan wrote:
print('\u00b0'+ " F")
> ° F
>
> Elsewhere, it no longer seem to work:
>
> $ python3
> Python 3.5.2 (default, Nov 23 2017, 16:37:01)
> [GCC 5.4.0 20160609] on linux
> Type "help", "copyright", "credits" or "license" for more information.
import platfor
On 07/08/18 13:46, Rafael Knuth wrote:
> Now I want to convert the code above into a function.
> This is what I wrote:
>
> def FileReader(file_path):
> with open(file_path) as file_object:
> contents = file_object.read
> return contents
>
> print(FilePrinter("C:\\Users\\...\\
On 06/08/18 20:50, Ali M wrote:
> If i delete this line "self.textbox.delete(1.0, tk.END)" in my
> enter_meaning function the listbox items won't lower down to 1 item and i
> just want 1 item to be shown after user searches the item in entrybox.
So just display 1 item.
What you are currently doing
On 04/08/18 09:07, Ali M wrote:
> I have taken the delete statement out of the for loop, but still nothing
> happens when i click the button.
You never assign the search_word function to a widget either
via the command option or via a bind statement.
If you don't bind the function to a widget it
On 03/08/18 12:14, Rafael Knuth wrote:
> I wrote a function which is supposed to count the number of items on
> each index #.
> For starters, here's a list I created to test the function:
>
> properties = ["mansion, modern, swimming_pool" , "mansion, historic,
> air_conditioning", "penthouse, mod
On 02/08/18 15:29, Shall, Sydney wrote:
> uvc = 2
> msg = "Bad argument provided, the value of uvc must be a float."
>
> try:
> type(uvc) == float
> except TypeError as e:
> print(e, msg)
The try block contains an expression that will always evaluate
to True or False and thus never rai
On 02/08/18 21:12, Ali M wrote:
> I tried writing the search_word function and binded it to the button, but
> it doesn't work, please help i'm still a beginner.
>
> def search_word(self, tag):
> esperanto = self.listbox.selection_set(0)
> results = self.cur.execute("SELECT Eng
On 01/08/18 14:17, Matthew Polack wrote:
>
> c:\Python>python crops3.py
> Traceback (most recent call last):
> File "crops3.py", line 30, in
> filemenu.add_command(label="Show", command=self.showImg)
> NameError: name 'self' is not defined
The problem with cutting and pasting/copying code..
On 01/08/18 05:07, Saket Mehrotra wrote:
> Hi
>
> I am also not using any Open SSL package.
> I have just added " import requests" in py file. And when I run the module
> I get the SSL package error ,not sure why.
Then you really need to send the complete error message
and the code that genera
On 31/07/18 03:52, Saket Mehrotra wrote:
> error ssl.PROTOCOL_SSLv23: OpenSSL.SSL.SSLv23_METHOD,
> AttributeError: module 'ssl' has no attribute 'PROTOCOL_SSLv23'
Are you sure you spelled the attribute correctly?
Have you tried
>>> import ssl
>>> dir(ssl)
Top see what the attribute names loo
On 30/07/18 19:11, Zachary Ware wrote:
> On Mon, Jul 30, 2018 at 1:08 PM Alan Gauld via Tutor wrote:
>> There are lots of options including those suggested elsewhere.
>> Another involves using get() which makes your function
>> look like:
>>
>> def viceversa(d):
&
On 30/07/18 08:24, Matthew Polack wrote:
> I'm trying to simply add an image to our program to make the GUI more
> interesting...but most of the tutorials describe using the 'Pack'
> method not the grid method of layout...
That's completely irrelevant since you can add images to widgets
regar
On 30/07/18 13:40, Valerio Pachera wrote:
> users = {'user1':['office-a', 'office-b'],
> 'user2':['office-b'],
> 'user3':['office-a','office-c']}
>
> It's a list of users.
> For each user there's a list of room it can access to.
>
> I wish to get the same info but "sorted" by room.
Re
On 27/07/18 23:32, Cameron Simpson wrote:
>> for index, s in l:
>> l[index] = s.replace('X','')
>> print(l)
>
> I think you meant:
>
> for index, s in enumerate(l):
Oops, yes. Sorry.
>> In Python you very rarely need to resort to using indexes
>> to process the members of a collection. And
On 27/07/18 13:56, Valerio Pachera wrote:
> l = ['unoX', 'dueX']
> c = 0
> for n in l:
> l[c] = l[c].replace('X','')
> c = c + 1
> print (l)
> ---
>
> it works but I wonder if there's a better way to achieve the same.
Yes, a much better way.
for index, s in l:
l[index] = s.re
On 27/07/18 11:55, Shall, Sydney wrote:
> On 01/07/2018 11:19, Steven D'Aprano wrote:
>> Even better would be to learn a form of VCS (version control system)
>> such as Mercurial (hg) or git. Depending on the text editor you are
>> using, it may have VCS integration available.
>
> Does Spyder have
On 18/07/18 17:00, Alan Gauld via Tutor wrote:
> Now the child class must import parent and dereference
> Parent within its module. (ie use parent.Parent)
>
> So two classes is more work for you and more work
> for the interpreter.
Oops, that should be two *files* is more
On 18/07/18 14:10, Matthew Polack wrote:
> Thanks for the reply Alan.
>
> I found another fix where I could just use this:
>
> num1 =int(input('Ener inches here?: '))
>
>
> but a lot of people like yourself seem to be recommending this
> 'float' method.
It all depends whether your input is a f
On 18/07/18 14:46, Shall, Sydney wrote:
> > is no need to put every class in a separate file, and it usually leads
> > to complicated dependencies and circular imports.
> I have constructed a program which has a parent class and a child class
> and I have them in two different files. I import
On 18/07/18 00:52, Matthew Polack wrote:
> Hi,
>
> I'm a teacher trying to learn Python with my students.
>
> I am trying to make a very simple 'unit calculator' program...but I get an
> error ..I think python is treating my num1 variable as a text string...not
> an integer.
You are correct.
>
On 17/07/18 07:26, Jeanne Ruiz wrote:
> I can't seem to find documentation in docs.python.org that talks > about
> whether or not the Python Build Distribution command,
> bdist_wininst performs checksum verification upon installing
> a Windows executable *.exe.
That's probably a bit off topic
On 16/07/18 18:29, Ali M wrote:
> The accents which i want to be automatically converted and put upon letters
> is circumflex and another one which shape is like the opposite of
> circumflex.
It doesn't really matter what the shapes are provided the result
is a unicode character.
You just want to
On 16/07/18 23:28, Crystal Frommert wrote:
> are learning how to read from a txt file and search for a string.
>
> Here is a sample of text from the txt file:
> TX,F,1910,Mary,895
> TX,F,1910,Ruby,314
> TX,F,1910,Annie,277
>
> How do they read the number after a certain searched name and then ad
On 15/07/18 20:44, Ali M wrote:
> Hi. I want to write these (ĝ, ĉ, ĵ, ĥ, ŭ, ĉ) accented letters when the user
> types (gx, cx, jx, ux, cx).
>
> when user types 'gx' for example i want to remove that x and replace it
> with the accent. how should i do that? and how should i specify which
> accent g
On 14/07/18 22:51, boB Stepp wrote:
> Linux Mint 19 comes with Python 3.6.5 pre-installed. However, my son
> and I are working on a couple of things together, and decided to use
> the latest bugfix releases of Python 3.6 for them. I would not think
> that upgrading from 3.6.5 to 3.6.6 would brea
301 - 400 of 1423 matches
Mail list logo