Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: py2 to py3 conversion
Post: py2 to py3 conversion
Hey guys, its been a while since I have worked with Python. I remember there were a few changes when py moved from 2 too 3. I am getting a syntax error with this code:
if old_contents <> new_co... |
|
Vysero |
General Coding Help |
1 |
1,712 |
May-14-2019, 03:40 PM |
|
|
Thread: Help With Error Handling
Post: RE: Help With Error Handling
If you get that error when you run your code its not coming from the code you posted here. The code you posted here works just as you would expect. |
|
Vysero |
General Coding Help |
6 |
4,127 |
Sep-14-2018, 03:48 PM |
|
|
Thread: Fork the process (factorial)
Post: RE: Fork the process (factorial)
Here's what I got:
Output:22142807374883101672219837615212451194....
time with 4 multiprocessing: 2.968395948410034
22142807374883101672219837615212451194....
time as usual: 2.9568259716033936As you c... |
|
Vysero |
Homework |
3 |
3,416 |
Sep-06-2018, 07:57 PM |
|
|
Thread: Python script runs on startup but does not register keystrokes.
Post: RE: Python script runs on startup but does not reg...
Just for a quick check try setting up wasd for up/down/left/right to determine if the keyboard is communicating at all. |
|
Vysero |
General Coding Help |
3 |
3,466 |
Sep-06-2018, 07:34 PM |
|
|
Thread: edit rotate function to consider capitalized letter
Post: RE: edit rotate function to consider capitalized l...
Personally, I would need more information about your program. What's it doing (on the hole) what's its purpose? Also, what are 'letter' and 'rot'; what is their type and where are they coming from. Th... |
|
Vysero |
Homework |
2 |
2,464 |
Aug-31-2018, 08:24 PM |
|
|
Thread: Traceback error
Post: RE: Traceback error
Well without diving to deeply I would start by trying to figure out which variable is of type None. Essentially, the error is telling you that there is a variable that you are attempting to iterate th... |
|
Vysero |
Web Scraping & Web Development |
3 |
3,577 |
Aug-28-2018, 07:26 PM |
|
|
Thread: 24x24 matrix solution
Post: RE: 24x24 matrix solution
What is the error you are getting? Since you know the length of the array just specify it. Rather than running a loop for some len(t) just run it 4 times. |
|
Vysero |
Homework |
1 |
2,447 |
Aug-22-2018, 03:28 PM |
|
|
Thread: Methods of running a script on Linux distro
Post: RE: Methods of running a script on Linux distro
|
Vysero |
General Coding Help |
6 |
3,903 |
Aug-21-2018, 08:07 PM |
|
|
Thread: Methods of running a script on Linux distro
Post: RE: Methods of running a script on Linux distro
(Aug-21-2018, 05:12 PM)heras Wrote: Normally you would chmod +x script.py to make it executable without having to specify python on the command line explicitly.
I have the script.py on my desktop. I... |
|
Vysero |
General Coding Help |
6 |
3,903 |
Aug-21-2018, 05:46 PM |
|
|
Thread: Methods of running a script on Linux distro
Post: Methods of running a script on Linux distro
I am currently running ubuntu 16.04. I have a python script that is supposed to create a symlink from the current linux header directory to /usr/src/linux:
#!/usr/bin/env python
import os
import sy... |
|
Vysero |
General Coding Help |
6 |
3,903 |
Aug-21-2018, 03:31 PM |
|
|
Thread: Square reverse sum(overloaded)
Post: RE: Square reverse sum(overloaded)
Whats your execution time? This only took 3.2 seconds for my machine to compute is that too slow? |
|
Vysero |
Homework |
6 |
4,107 |
Aug-17-2018, 08:08 PM |
|
|
Thread: List and Dictionaries with Pandas
Post: RE: List and Dictionaries with Pandas
I am a bit confused about the format of your excel file. Could you just take a screen shot of it and post the picture or show the output of pd.head()? |
|
Vysero |
Data Science |
3 |
2,996 |
Aug-14-2018, 09:04 PM |
|
|
Thread: can you tell me what editor other than geany is the best for linux mint
Post: RE: can you tell me what editor other than geany i...
I would suggest PyCharm its what I use on Ubuntu 16.04. |
|
Vysero |
Bar |
11 |
183,314 |
Aug-14-2018, 03:33 PM |
|
|
Thread: Dictionary multi dimension support
Post: RE: Dictionary multi dimension support
I am not 100% sure why you would attempt to instantiate your dictonary like you have. Normally, if I were trying to do something like that I would say:
dict = {'key1': 'Value1', 'key2': 'Value2'}
pri... |
|
Vysero |
General Coding Help |
3 |
3,009 |
Aug-14-2018, 03:25 PM |
|
|
Thread: Need help using pathlib to read text file into dictionary
Post: RE: Need help using pathlib to read text file into...
(Aug-13-2018, 04:14 PM)gwilli3 Wrote: The structure of the dictionary is: boarders[brdr_year][brdr_month][brdr_day]{pet_name}
I am a bit confused. So when a client come in and checks in a pet. You w... |
|
Vysero |
General Coding Help |
4 |
4,198 |
Aug-13-2018, 05:36 PM |
|
|
Thread: Calling a function whch is inside a function
Post: RE: Calling a function whch is inside a function
Good question but I am going to skirt around the answer because I believe inner functions are used in python because (as you found out) they are protected. At least, that's what I have gathered so far... |
|
Vysero |
General Coding Help |
4 |
3,503 |
Aug-10-2018, 08:32 PM |
|
|
Thread: Trouble with "Weather Program" Assignment
Post: RE: Trouble with "Weather Program" Assignment
(Aug-05-2018, 05:32 PM)sarah_mb_sues Wrote: I included the code line itself because I don't have it in the code from the original post
--------------------------------------------------------------... |
|
Vysero |
Homework |
5 |
9,038 |
Aug-09-2018, 09:45 PM |
|
|
Thread: sorting a list of tuples based on date
Post: RE: sorting a list of tuples based on date
Sure, sorted() as your using it generates a new list without altering the old one so try:
import operator
from datetime import datetime
phones = [('Samsung S7', '11 March 2016'), ('Samsung S8','29 M... |
|
Vysero |
General Coding Help |
2 |
5,774 |
Aug-09-2018, 09:37 PM |
|
|
Thread: List comparison in Python
Post: RE: List comparison in Python
(Aug-09-2018, 02:42 PM)Nirmal Wrote: Thanks
Sure no problem! |
|
Vysero |
General Coding Help |
13 |
6,487 |
Aug-09-2018, 04:30 PM |
|
|
Thread: general conversion to int
Post: RE: general conversion to int
I probably don't understand the whole scope of your questing but here's what I am thinking and its a bit more general:
def force_to_int(input, new_output=None):
try:
return int(input)
except ... |
|
Vysero |
General Coding Help |
3 |
2,663 |
Aug-08-2018, 04:33 PM |