On 04/02/16 23:26, Tom Brodle wrote:
> While true:
> Turn LED on
> sleep 5 seconds
> Turn LED off
> sleep .5 seconds
> # Coming from the world of Basic I did/do not understand what made the
> program loop
> # back to while True: line of c
On Thu, Feb 4, 2016 at 6:26 PM, Tom Brodle wrote:
> I am very new to Python. I am just practicing code using a simple plug
> board. The code is working as I want it to but the last message and the
> original looping makes me have questions. Because the main code works I
> will just abbreviate
I am very new to Python. I am just practicing code using a simple plug board.
The code is working as I want it to but the last message and the original
looping makes me have questions. Because the main code works I will just
abbreviate it.
import GPIO
import time
Gpio setmode (BCM)
led_pin
As others have pointed out, a mapping/dictionary or just a list of lists
seems like how you would want to organize the data for input. I think your
problem is insistence on using sets. I am no Python guru, but I think this
list is more for exploratory learning of Python. I think people are trying
t
Thanks for the response Smith, I was thinking make be I have done something
incorrect and if there is some other function that can be used to display
the output in desired order but don't see it possible thats why was
wondering if any of you Python gurus have any inputs for me :-)
On Sat, Apr 26
err, set also is unordered. I can see you are using set for a reason, but
has no concept of order.
On Sat, Apr 26, 2014 at 3:20 PM, C Smith wrote:
> Just glancing at your work, I see you have curly braces around what looks
> like it should be a list. If you are concerned with the order of your
>
Just glancing at your work, I see you have curly braces around what looks
like it should be a list. If you are concerned with the order of your
output, dictionaries do not have a concept of order.
On Sat, Apr 26, 2014 at 3:16 PM, Suhana Vidyarthi wrote:
> Hi Danny,
>
> Let me give you a high le
Hi Danny,
Let me give you a high level brief of what I am doing:
I am working on doing "disaster aware routing" considering the 24-node US
network where I will be setting up connection between two any two nodes (I
will select the source and destination nodes randomly). Also I have some
links whose
>>> I want to create two arrays using the above file (Links array and Prob
>>> array) that should give following output:
>>>
>>> *Links *= { [3,5] [5,4] [5,8] [7,8] [14,10] [14,13] [17,13] [14,18]
>>> [10,13] [14,13] [17,13] [12,13] [11,6] [11,9][11,12] [11,19] [19,20]
>>> [15,20] [21,20] [20,21] [
Thanks for the response Alan. my clarifications are below:
On Sat, Apr 26, 2014 at 1:41 AM, Alan Gauld wrote:
> On 26/04/14 01:46, Suhana Vidyarthi wrote:
>
> I have this file:
>>
>> 1,3,5,0.03
>>
>> 2,3,5,5,4,0.11
>>
>> 3,3,5,5,4,5,8,0.04
>>
>
>
>> And each line is interpreted as:
>>
>>
Hi,
The reason I opened a link is because there are changes in the code. Does
it make sense? Else I can definitely go back to the thread.
On Sat, Apr 26, 2014 at 9:05 AM, Danny Yoo wrote:
> Hi Suhana,
>
> Also note that you asked this question just a few days ago.
>
> https://mail.pytho
Hi Suhana,
Also note that you asked this question just a few days ago.
https://mail.python.org/pipermail/tutor/2014-April/101019.html
We're not robots. We don't like repetition unless there's a reason
for it, and in this case, you got responses to the earlier question.
For example:
htt
On 26/04/14 01:46, Suhana Vidyarthi wrote:
I have this file:
1,3,5,0.03
2,3,5,5,4,0.11
3,3,5,5,4,5,8,0.04
And each line is interpreted as:
* 1,3,5,0.03-> This line means 1 link can be down i.e. between 3—5
with a probability of failure *0.03*
* 2,3,5,5,4,0.11 -> This line mean
Hi,
I need help with coding for the problem below. I am new in this area, so
needed help. If anyone can help me program the below scenario, I will be
thankful.
I have this file:
1,3,5,0.03
2,3,5,5,4,0.11
3,3,5,5,4,5,8,0.04
2,5,8,7,8,0.04
3,14,10,14,13,17,13,0.04
1,14,18,0.06
4,10,13,
Unfortunately, we can't give too much specific help on your particular
problem because it's homework.
You should use the knowledge you learned in your introductory
programming class about designing programs. In particular, give a
name to the function or functions your are designing. Be rigorous
On 22/04/2014 12:41, Steven D'Aprano wrote:
On Mon, Apr 21, 2014 at 06:16:20PM -0700, Suhana Vidyarthi wrote:
[...]
# on Windows either of these will be okay
filename = "C:/path/to/file.txt"
filename = "C:\\path\\to\\file.txt"
Or a raw string r'C:\path\to\file.txt'
--
My fellow Pythonis
On Mon, Apr 21, 2014 at 06:16:20PM -0700, Suhana Vidyarthi wrote:
[...]
> I have a python code that shows a set of shortest paths between nodes A and
> B. Now I have to select the least risky path among them. To do that I have
> to consider the risk values of each link. I know how to calculate the
On 22/04/14 02:16, Suhana Vidyarthi wrote:
I have a python code that shows a set of shortest paths between nodes A
and B.
It would help if you showed us this code. Otherwise we are
just making wild guesses about how you are modelling this.
Also knowing which Python version you are using would
My knowledge of coding is fairly limited and I am having a hard time
writing a Python code which might be pretty simple for you :-)
Here is what I am doing and I need help with:
I have a python code that shows a set of shortest paths between nodes A and
B. Now I have to select the least risky pat
Hello,
I have a file with actions and time points at which they occur.
I want to find how many times an action occurs, and how many times it
occurs in combination with an other action at the same time point
(overlapping between onset and apex)
Below is the input file. in this file, action 50 occu
On 08/04/2011 03:57, Aaron Brown wrote:
I am in an online python class and am failing badly. I am not sure
where the problem is here but any insight would be great.
def main():
while (True):
allowed = int(input("Please enter minutes allowed between 100
and 700: "))
used =
"Aaron Brown" wrote
I am in an online python class and am failing badly. I am not sure
where
the problem is here but any insight would be great.
When posting always include the full error text since
it usually helps locate the precise location more clearly
than a verbal description or summ
On Fri, Apr 8, 2011 at 3:57 AM, Aaron Brown wrote:
> I am in an online python class and am failing badly. I am not sure where
> the problem is here but any insight would be great.
>
> def main():
> while (True):
> allowed = int(input("Please enter minutes allowed between 100 and
> 700
I am in an online python class and am failing badly. I am not sure where
the problem is here but any insight would be great.
def main():
while (True):
allowed = int(input("Please enter minutes allowed between 100 and
700: "))
used = int(input("How many minutes were used: "))
> Also is there a way to say reverse the string in a way so the reversed
> string would result to "this take" if you use my example? And is there a way
> to stop the loop without the use of break? Thanks for the help!
>
Sure. First take your string S and use S.split() to get a list of the
individu
On Tue, Jun 16, 2009 at 8:59 PM, ayyaz wrote:
> The following works also.
>
> msg = raw_input("\nPlease enter a message to print backwards: ")
> x = range(0,len(msg))
> x.reverse()
> for i in x: print msg[i],
or even simpler, allow range to generate the reverse:
range(len(msg)-1, -1, -1)
Some
Raj Medhekar wrote:
So I figured out the solution to the missing letter and I will post my
code here. But I still need help figuring out the other stuff (please
see my original message included in this email)! Thanks for putting up
with me. Python is slowly but surely coming to me! I am psyched
wrote
mystring="Mary had a little lamb."
mystring.split()
['Mary', 'had', 'a', 'little', 'lamb.']
And then you can use slicing to reverse the created list the same way you
did with the full string.
Or use the reverse() method of the list...
Alan G
__
"Raj Medhekar" wrote
... I came up with the code I have included in this email.
Wy to complicated!
message = raw_input("Enter your message: ")
print message
high = len(message)
low = -len(message)
begin=None
while begin != "":
begin = int(high)
if begin:
end = int(low)
> My Original message:
>
> I had previously emailed y'all regarding inverting a message input by
the user of the program backwards. After much
> contemplation on your earlier replies I came up with the code I have
included in this email. The problem I am having
> with this code is that the the
Raj Medhekar wrote:
> So I figured out the solution to the missing letter and I will post my
> code here. But I still need help figuring out the other stuff (please
> see my original message included in this email)! Thanks for putting up
> with me. Python is slowly but surely coming to me! I am psy
So I figured out the solution to the missing letter and I will post my code
here. But I still need help figuring out the other stuff (please see my
original message included in this email)! Thanks for putting up with me. Python
is slowly but surely coming to me! I am psyched since this is the fi
You are putting far too much work into the solution. Look up slicing on
the python web page. Then, as an example,
In [1]: s1 = 'hello world'
In [2]: s1[::-1]
Out[2]: 'dlrow olleh'
Hope this helps,
Robert
On Tue, 2009-06-16 at 14:25 -0700, Raj Medhekar wrote:
> I had previously emailed y'all r
I had previously emailed y'all regarding inverting a message input by the user
of the program backwards. After much contemplation on your earlier replies I
came up with the code I have included in this email. The problem I am having
with this code is that the the first character of the message t
Hi,
This is how I would do it, although there might be more readable solutions:
s = raw_input("Enter a message: ")
print "".join([s[-letter] for letter in range(len(s)+1)])
Cheers!!
Albert-Jan
--- On Tue, 6/16/09, Alan Gauld wrote:
> From: Alan Gauld
> Subject: Re
print s
dlrow olleh
>>>
---
Gil Cosson
Bremerton, Washington
360 620 0431
--- On Mon, 6/15/09, Wayne wrote:
From: Wayne
Subject: Re: [Tutor] Help Needed
To: "Raj Medhekar"
Cc: "Python Tutor"
Date: Monday, June 15, 2009, 5:28 PM
On Mon, Jun 15, 2009 at 3:00 PM,
"Raj Medhekar" wrote
I am looking to build a program that gets a message from
the user and then prints it backward. I 've been at it for
hours now but I can't seem to figure it out.
So tell us what you re thinking? How would you solve
it manually?
I've been having trouble trying to inde
On Mon, Jun 15, 2009 at 3:00 PM, Raj Medhekar wrote:
> I am looking to build a program that gets a message from the user and then
> prints it backward. I 've been at it for hours now but I can't seem to
> figure it out. I've been having trouble trying to index the message so I can
> print it out b
Hi Raj,
It might be easier if you create a simple test string inside the
python interpreter and then tinker with it there. once you've found
the solution, you can graft it onto the broader program that accepts
user input.
For example, you might create the following variable
message = "This
I am looking to build a program that gets a message from the user and then
prints it backward. I 've been at it for hours now but I can't seem to figure
it out. I've been having trouble trying to index the message so I can print it
out backwards. I would've posted my code but I really haven't go
"moham ilias" wrote in message
news:74b58e470812230730n4c3c5d1eg9f44a87b1bf9...@mail.gmail.com...
can anybody help me to get the example codes for some existing
python
projects. pls help in this regard
For simple examples try the Useless Python web site.
In particular check out the link t
On Tue, Dec 23, 2008 at 10:30 AM, moham ilias wrote:
> can anybody help me to get the example codes for some existing python
> projects. pls help in this regard
I'm not sure I understand your question. Do you want examples to look at?
Most of the Python standard library is written in Python so t
can anybody help me to get the example codes for some existing python
projects. pls help in this regard
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Varsha Purohit wrote:
> I am writing a program basically in python gui to open a file and
> display its content. i know similar program in simple
> python but wanna figure out how to do that in wxpython...
See DocViewDemo.py in the wxPythohn demo package
/Samples/samples/docview/DocViewDemo.py
While I would say wxPython in its fullblown glory is a little much for
this mailing list, an easy to use toolkit and associated tutorials for
it is not. I would suggest you use pythoncard, which is a toolkit that
calls down to wxPython and is much faster to get going with:
This will get you up and
Hi Kent,
I am writing a program basically in python gui to open a file and display
its content. File contains ascii data... here is an example of that.
a text file having info like this
ncols 4
nrows 4
xllcorner 392800
yllcorner 5376340
cellsize 55
NODATA_value -
Varsha Purohit wrote:
> Hello everyone,
> I need a basic tutorial which can help me in reading or writing
> ascii grid file
What is an ascii grid file? Reading and writing text files should be
covered in any Python tutorial, find one you like here:
http://wiki.python.org/moin/Beginner
Hello everyone,
I need a basic tutorial which can help me in reading or writing ascii
grid file
thanks in advance,
--
Varsha Purohit,
Graduate Student,
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Asrarahmed Kadri schrieb:
> I want to install the SOAPpy module on my windows box. I have python
> 2.4.3
>
> Can you help me with the steps and the URL from where can I get the
> download..??
What have you tried so far? Did you google for "SOAPpy download"?
Are you experiencing any problems?
Chr
Hi Folks,I want to install the SOAPpy module on my windows box. I have python2.4.3Can you help me with the steps and the URL from where can I get thedownload..??TIA.
Regards,Asrarahmed
-- To HIM you shall return.
___
Tutor maillist - Tutor@python.
Akanksha Govil wrote:
> Hi,
>
> I have downloaded an add on python script "etherealXML.py" for parsing
> the ethereal captured packets.
>
> This script runs fine on python 2.3 but on python 2.4 it gives error.\
What is the error?
>
> Has any one tried porting this script?
This might give a c
Hi,I have downloaded an add on python script "etherealXML.py" for parsing the ethereal captured packets.This script runs fine on python 2.3 but on python 2.4 it gives error.Has any one tried porting this script?Also I found the SAX parser earlier used to return a call back function which is no long
Steve Haley wrote:
> When I am in Python Shell of the IDLE GUI, when I click Edit/Run Script,
> I am getting a dialog box that is titled “Not saved” and states “The
> buffer for Python shell is not saved. Please save it first.” With an
> “OK” button that just takes me back to the Shell window.
hi,
make sure in the
option/general/Startup preferences/at startup/open edit windowoption/general/Startup preferences/autosave preferences/NoPrompt
run the program by clicking F5
Cheers,
pujo
On 10/5/05, Steve Haley <[EMAIL PROTECTED]> wrote:
Hello,
I am trying to learn Python which I a
Hello,
I am trying to learn Python which I am brand new to. I have
run into a problem that I would appreciate help with.
When I am in Python Shell of the IDLE GUI, when I click
Edit/Run Script, I am getting a dialog box that is titled “Not saved”
and states “The buffer for Python s
Dear All,
Just a quick follow up for those of you who are interested. The batching script
is now working and is attached below.
The intermediate step of saving the xy layer to a folder was unecessary and has
been removed. The 'MakeXYEventLayer' command only creates "in memory" layers
and not
Chris Bromley said unto the world upon 2005-02-17 11:05:
Prior to running the script I use the check button in the
PythonWin and the scripts syntax is fine. When I run the script
though, the message
Script C:\ dBase_File_To_Shapefile.py returned exit code 0
appears in the status bar at the
Hello again,
First off, please accept my apologies for my last message, which was sorely
lacking in the detail department. I'm such a beginner with programming that I
assumed the error would be glaringly obvious to an experienced programmer and
would jump of the page/screen right away. This was
On Wed, 16 Feb 2005 21:37:10 +, Chris Bromley
<[EMAIL PROTECTED]> wrote:
> Any help would be greatly appreciated!
Others have already pointed out that we will have a hard time helping
without a bit more information. But I've noticed something odd in
your code -- it probably doesn't have anyt
On Wed, 16 Feb 2005, Bill Mill wrote:
> > I have several thousand files in dBaseIV format that I need to convert
> > to shapefiles for use in ArcGIS. I've written a script (see below) to
> > automate this process but thus far have been unable to get it to work.
> > I suspect that there's a simpl
What are you getting? What are you expecting? Are you getting an
error? If so, what's it telling you? Can you email this stuff up?
I suspect you want to find the pywin documentation and go through that.
Cheers,
Liam Clarke
On Wed, 16 Feb 2005 16:47:26 -0500, Bill Mill <[EMAIL PROTECTED]> wrot
Chris,
On Wed, 16 Feb 2005 21:37:10 +, Chris Bromley
<[EMAIL PROTECTED]> wrote:
> Dear all,
>
> I have several thousand files in dBaseIV format that I need to convert to
> shapefiles for use in ArcGIS. I've written a script (see below) to automate
> this process but thus far have been unab
Dear all,
I have several thousand files in dBaseIV format that I need to convert to
shapefiles for use in ArcGIS. I've written a script (see below) to automate
this process but thus far have been unable to get it to work. I suspect that
there's a simple reason for this, but I'm a complete novi
63 matches
Mail list logo